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

Code Examples of ExecutionQueueImpl



    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);
        }
    }

View Full Code Here



    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);
        }
    }

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);
  }

  static class CellTest1 extends JacobRunnable {

View Full Code Here


                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) {

View Full Code Here


                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) {

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);
  }

  static class CellTest1 extends JacobRunnable {

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


        }
    }

    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


        }
    }

    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

TOP

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

TOP