import org.biojava.dasobert.dasregistry.*;
import org.biojava.dasobert.eventmodel.*;
-/** a thread that connects to a DAS - Feature service and gets the features
- *
+/**
+ * a thread that connects to a DAS - Feature service and gets the features
+ *
* @author Andreas Prlic
*/
-
-
-public class FeatureThread
- implements Runnable
+public class FeatureThread implements Runnable
{
- /** number of times the client tries to reconnect to the server if a "come back later" is returned.
- * the server should provide a reasonable estimation how long it will take him to create results.
- * if this number of requests is still not successfull, give up.
+ /**
+ * number of times the client tries to reconnect to the server if a "come back
+ * later" is returned. the server should provide a reasonable estimation how
+ * long it will take him to create results. if this number of requests is
+ * still not successfull, give up.
*/
public static int MAX_COME_BACK_ITERATIONS = 5;
static Logger logger = Logger.getLogger("org.biojava.spice");
Das1Source dasSource;
+
String ac;
+
List featureListeners;
+
Thread thread;
public FeatureThread(String accessionCode, Das1Source dasSource)
try
{
cmd = new URL(queryString);
- }
- catch (MalformedURLException e)
+ } catch (MalformedURLException e)
{
logger.warning("got MalformedURL from das source " + dasSource);
e.printStackTrace();
int comeBackLater = ftmp.getComeBackLater();
int securityCounter = 0;
- while ( (thread == me) && (comeBackLater > 0))
+ while ((thread == me) && (comeBackLater > 0))
{
securityCounter++;
if (securityCounter >= MAX_COME_BACK_ITERATIONS)
try
{
wait(comeBackLater);
- }
- catch (InterruptedException e)
+ } catch (InterruptedException e)
{
comeBackLater = -1;
break;
comeBackLater = ftmp.getComeBackLater();
}
- if (! (thread == me))
+ if (!(thread == me))
{
break;
}
// a fallback mechanism to prevent DAS sources from bringing down spice
if (features.size() > MAX_NR_FEATURES)
{
- logger.warning("DAS source returned more than " + MAX_NR_FEATURES +
- "features. " +
- " throwing away excess features at " + cmd);
+ logger
+ .warning("DAS source returned more than " + MAX_NR_FEATURES
+ + "features. "
+ + " throwing away excess features at " + cmd);
features = features.subList(0, MAX_NR_FEATURES);
}
}
}
- /** the Annotation server requested to be queried again in a while
- *
+ /**
+ * the Annotation server requested to be queried again in a while
+ *
* @param comeBackLater
*/
private void notifyComeBackLater(int comeBackLater)