private boolean isFinalizing = false;
private int totalUpdates = 9;
+ private uk.ac.vamsas.client.VorbaId recover = null;
private void processVamsasDocument(IClientDocument doc)
{
if (doc.getVamsasRoots().length<4) {
- doc.addVamsasRoot(Core.getDemoVamsas());
+ doc.addVamsasRoot(Core.getDemoVamsas());
} else {
try {
uk.ac.vamsas.objects.core.DataSet ds = doc.getVamsasRoots()[1].getDataSet(0);
uk.ac.vamsas.objects.core.AlignmentSequence alsq = ds.getAlignment(0).getAlignmentSequence(0);
+ if (recover==null)
+ {
+ recover = alsq.getVorbaId();
+ } else {
+ Vobject recoverd = doc.getObject(recover);
+ System.out.println("Recovery of "+recover+" was "+((recoverd==null) ? "A FAILURE" : "SUCCESSFUL"));
+ }
System.out.println("Modifying Sequence:\n"+alsq.hashCode());
alsq.setSequence(alsq.getSequence()+ds.getAlignment(0).getGapChar());
System.out.println("Modifying Sequence:\n"+alsq.hashCode());
}
}
-
+ long shutdown = -1;
public void runMe(String[] args)
{
if (!parseArgs(args))
{
System.out
.println("Received |" + message.getRawMessage() + "|");
+ shutdown +=100; // hang around for 5 seconds or so before dying naturally.
+
}
});
}
+ shutdown = System.currentTimeMillis()+10000; // hang around for 10 seconds or so before dying naturally.
while (!isShuttingdown && update < totalUpdates)
{
// do something with data
System.out
.println("******************************************");
isUpdated = false; // TODO: saner update det method.
+ shutdown = System.currentTimeMillis()+10000;
if (update % 2 == 1)
{
try
e.printStackTrace(System.err);
}
}
+ } else {
+ if (System.currentTimeMillis()>shutdown)
+ {
+ isShuttingdown=true;
+ }
}
try { Thread.sleep(50); }