A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
private ExecutionQueueImpl readOldState(ProcessInstanceDAO instance, OProcess oprocess,
ClassLoader cl, boolean changeKey) {
if (instance.getExecutionState() == null) return null;
try {
ExecutionQueueImpl soup = new ExecutionQueueImpl(cl);
ObjectStreamClass osc;
if (changeKey) {
osc = ObjectStreamClass.lookup(Class.forName(
"org.apache.ode.bpel.engine.migration.OldCorrelationKey", true, cl));
ExecutionQueueImpl._classDescriptors.put("org.apache.ode.bpel.common.CorrelationKey", osc);
}
osc = ObjectStreamClass.lookup(Class.forName(
"org.apache.ode.bpel.engine.migration.OldSelector", true, cl));
ExecutionQueueImpl._classDescriptors.put("org.apache.ode.bpel.runtime.Selector", osc);
osc = ObjectStreamClass.lookup(Class.forName(
"[Lorg.apache.ode.bpel.engine.migration.OldSelector;", true, getClass().getClassLoader()));
ExecutionQueueImpl._classDescriptors.put("[Lorg.apache.ode.bpel.runtime.Selector;", osc);
soup.setReplacementMap(new ReplacementMapImpl(oprocess));
ByteArrayInputStream iis = new ByteArrayInputStream(instance.getExecutionState());
soup.read(iis);
return soup;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private ExecutionQueueImpl readOldState(ProcessInstanceDAO instance, OProcess oprocess,
ClassLoader cl, boolean changeKey) {
if (instance.getExecutionState() == null) return null;
try {
ExecutionQueueImpl soup = new ExecutionQueueImpl(cl);
ObjectStreamClass osc;
if (changeKey) {
osc = ObjectStreamClass.lookup(Class.forName(
"org.apache.ode.bpel.engine.migration.OldCorrelationKey", true, cl));
ExecutionQueueImpl._classDescriptors.put("org.apache.ode.bpel.common.CorrelationKey", osc);
}
osc = ObjectStreamClass.lookup(Class.forName(
"org.apache.ode.bpel.engine.migration.OldSelector", true, cl));
ExecutionQueueImpl._classDescriptors.put("org.apache.ode.bpel.runtime.Selector", osc);
osc = ObjectStreamClass.lookup(Class.forName(
"[Lorg.apache.ode.bpel.engine.migration.OldSelector;", true, getClass().getClassLoader()));
ExecutionQueueImpl._classDescriptors.put("[Lorg.apache.ode.bpel.runtime.Selector;", osc);
soup.setReplacementMap(new ReplacementMapImpl(oprocess));
ByteArrayInputStream iis = new ByteArrayInputStream(instance.getExecutionState());
soup.read(iis);
return soup;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public JacobCellTest(String testName) {
super(testName);
}
public void testJacobCell1() throws IOException {
ExecutionQueueImpl fsoup = new ExecutionQueueImpl(null);
JacobVPU vpu = new JacobVPU(fsoup, new CellTest1());
while (vpu.execute()) {
vpu.flush();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
fsoup.write(bos);
bos.close();
System.err.println("CONTINUATION SIZE: " + bos.size());
}
vpu.dumpState();
fsoup.dumpState(System.err);
assertNotNull(_val);
assertEquals("foo", _val);
}
static class CellTest1 extends JacobRunnable {
try {
if (instance.getExecutionState() == null) {
//Completed instance
__log.debug("Skipped");
} else {
ExecutionQueueImpl soup = new ExecutionQueueImpl(this.getClass().getClassLoader());
soup.setReplacementMap(process.getReplacementMap(processDao.getProcessId()));
soup.read(new ByteArrayInputStream(instance.getExecutionState()));
Object data = soup.getGlobalData();
if (data instanceof OutstandingRequestManager) {
OutstandingRequestManager orm = (OutstandingRequestManager) data;
IMAManager imaManager = new IMAManager();
imaManager.migrateRids(orm.getRids());
soup.setGlobalData(imaManager);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
soup.write(bos);
instance.setExecutionState(bos.toByteArray());
__log.debug("Migrated outstanding requests for instance " + instance.getInstanceId());
}
}
} catch (Exception e) {
try {
if (instance.getExecutionState() == null) {
//Completed instance
__log.debug("Skipped");
} else {
ExecutionQueueImpl soup = new ExecutionQueueImpl(this.getClass().getClassLoader());
soup.setReplacementMap(process.getReplacementMap(processDao.getProcessId()));
soup.read(new ByteArrayInputStream(instance.getExecutionState()));
Object data = soup.getGlobalData();
if (data instanceof OutstandingRequestManager) {
OutstandingRequestManager orm = (OutstandingRequestManager) data;
IMAManager imaManager = new IMAManager();
imaManager.migrateRids(orm.getRids());
soup.setGlobalData(imaManager);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
soup.write(bos);
instance.setExecutionState(bos.toByteArray());
__log.debug("Migrated outstanding requests for instance " + instance.getInstanceId());
}
}
} catch (Exception e) {
public JacobCellTest(String testName) {
super(testName);
}
public void testJacobCell1() throws IOException {
ExecutionQueueImpl fsoup = new ExecutionQueueImpl(null);
JacobVPU vpu = new JacobVPU(fsoup, new CellTest1());
while (vpu.execute()) {
vpu.flush();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
fsoup.write(bos);
bos.close();
System.err.println("CONTINUATION SIZE: " + bos.size());
}
vpu.dumpState();
fsoup.dumpState(System.err);
assertNotNull(_val);
assertEquals("foo", _val);
}
static class CellTest1 extends JacobRunnable {
System.err.println(" requested-prime = which prime to show (0->inf)");
System.exit(1);
} else {
int request = Integer.parseInt(args[0]);
JacobVPU vpu = new JacobVPU();
vpu.setContext(new ExecutionQueueImpl(null));
vpu.inject(new Sieve());
while (_cnt != request) {
vpu.execute();
}
System.err.println("The " + _cnt + "th prime is " + _last);
}
}
public static void main(String args[]) {
JacobVPU vpu = new JacobVPU();
vpu.setContext(new ExecutionQueueImpl(null));
vpu.inject(new Tester());
while (vpu.execute()) {
// run
}
}
}
}
public static void main(String args[]) {
JacobVPU vpu = new JacobVPU();
vpu.setContext(new ExecutionQueueImpl(null));
vpu.inject(new Tester());
while (vpu.execute()) {
// run
}
}
System.err.println(" requested-prime = which prime to show (0->inf)");
System.exit(1);
} else {
int request = Integer.parseInt(args[0]);
JacobVPU vpu = new JacobVPU();
vpu.setContext(new ExecutionQueueImpl(null));
vpu.inject(new Sieve());
while (_cnt != request) {
vpu.execute();
}
System.err.println("The " + _cnt + "th prime is " + _last);