Package org.apache.ode.jacob.vpu

Examples of org.apache.ode.jacob.vpu.ExecutionQueueImpl


    }

    private void initVPU() {
        vpu = new JacobVPU();
        vpu.registerExtension(BpelRuntimeContext.class, this);
        soup = new ExecutionQueueImpl(null);
        soup.setReplacementMap(_bpelProcess.getReplacementMap());
        vpu.setContext(soup);
    }
View Full Code Here


        }
    }

    public static void main(String args[]) {
        JacobVPU vpu = new JacobVPU();
        vpu.setContext(new ExecutionQueueImpl(null));
        vpu.inject(new Tester());
        while (vpu.execute()) {
            // run
        }
    }
View Full Code Here

      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);
View Full Code Here

        // We have to wrap our transaction to make sure that we are hydrated when the transaction runs.
        return _server.enqueueTransaction(new ProcessCallable<T>(tx));
    }

    private Object getState(BpelInstanceWorker worker, ProcessInstanceDAO instanceDAO) {
        ExecutionQueueImpl state = (ExecutionQueueImpl) worker.getCachedState(instanceDAO.getExecutionStateCounter());
        if (state != null) return state;

        if (isInMemory()) {
            ProcessInstanceDaoImpl inmem = (ProcessInstanceDaoImpl) instanceDAO;
            if (inmem.getSoup() != null) {
                state = (ExecutionQueueImpl) inmem.getSoup();
            }
        } else {
            byte[] daoState = instanceDAO.getExecutionState();
            if (daoState != null) {
                state = new ExecutionQueueImpl(getClass().getClassLoader());
                state.setReplacementMap((ReplacementMap) _runtime.getReplacementMap(instanceDAO.getProcess().getProcessId()));

                ByteArrayInputStream iis = new ByteArrayInputStream(daoState);
                try {
                    state.read(iis);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
            }
        }
View Full Code Here

    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;
        }
View Full Code Here

    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;
        }
View Full Code Here

  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);
  }
View Full Code Here

    protected void setUp() throws Exception {
        _completedOk = false;
        _terminate = false;
        _fault = null;
        _soup = new ExecutionQueueImpl(CoreBpelTest.class.getClassLoader());
        _vpu = new JacobVPU(_soup);
        _vpu.registerExtension(OdeRTInstanceContext.class, this);
        _pid = (long) 19355;
    }
View Full Code Here

    protected void setUp() throws Exception {
        _completedOk = false;
        _terminate = false;
        _fault = null;
        _soup = new ExecutionQueueImpl(CoreBpelTest.class.getClassLoader());
        _vpu = new JacobVPU(_soup);
        _vpu.registerExtension(OdeRTInstanceContext.class, this);
        _pid = (long) 19355;
    }
View Full Code Here

        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);
//
View Full Code Here

TOP

Related Classes of org.apache.ode.jacob.vpu.ExecutionQueueImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.