예제 #1
0
  public RuntimeInstanceImpl(RuntimeImpl runtime, ExecutionQueueImpl soup) {
    _runtime = runtime;
    _vpu = new JacobVPU();
    _vpu.registerExtension(OdeRTInstanceContext.class, this);
    if (soup == null) {
      _soup = new ExecutionQueueImpl(getClass().getClassLoader());
      _soup.setGlobalData(new OutstandingRequestManager());
    } else {
      _soup = soup;
    }

    _soup.setReplacementMap(_runtime._replacementMap);
    _vpu.setContext(_soup);
  }
예제 #2
0
  public void testReloadProcess() throws Exception {
    File soupsDir =
        new File(CompatibilityTest.class.getClassLoader().getResource("soups").getFile());
    for (File soupState :
        soupsDir.listFiles(
            new FilenameFilter() {
              public boolean accept(File dir, String name) {
                return name.startsWith("sa");
              }
            })) {
      ExecutionQueueImpl soup = new ExecutionQueueImpl(CoreBpelTest.class.getClassLoader());
      Serializer ser =
          new Serializer(
              CompatibilityTest.class.getClassLoader().getResourceAsStream("TestActivityFlow.cbp"));
      soup.setReplacementMap(new ReplacementMapImpl((OProcess) ser.readPModel()));

      soup.read(new FileInputStream(soupState));

      //            JacobVPU vpu = new JacobVPU(soup);
      //            CoreBpelTest instance = new CoreBpelTest();
      //            vpu.registerExtension(OdeRTInstanceContext.class, instance);
      //
      //            instance._completedOk = false;
      //            instance._terminate = false;
      //            instance._fault = null;
      //
      //            int i = 0;
      //            try {
      //            for (i = 0; i < 100000 && !instance._completedOk && instance._fault == null &&
      // !instance._terminate; ++i) {
      //                vpu.execute();
      //            }
      //            } catch (Exception npe) {
      //                npe.printStackTrace();
      //            }
      //            System.out.println("=> " + i);
    }
  }