Examples of TaskProcessor


Examples of org.apache.oodt.cas.workflow.engine.processor.TaskProcessor

   *
   * @see java.lang.Runnable#run()
   */
  @Override
  public void run() {
    TaskProcessor nextTaskProcessor = null;

    while (running) {
      nextTaskProcessor = taskQuerier.getNext();

      try {
View Full Code Here

Examples of org.apache.oodt.cas.workflow.engine.processor.TaskProcessor

   *
   * @see org.apache.oodt.cas.workflow.engine.TaskQuerier#getNext()
   */
  @Override
  public TaskProcessor getNext() {
    TaskProcessor taskProcessor = super.getNext();
    if(taskProcessor == null) return null;
    Metadata met = new Metadata();
    met.addMetadata("StartDateTime", DateUtils.toString(Calendar.getInstance()));
    taskProcessor.getWorkflowInstance().setSharedContext(met);
    return taskProcessor;
  }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.engine.processor.TaskProcessor

    }

    querier.setRunning(false);
    assertNotNull(runnables);
    assertEquals(2, runnables.size());
    TaskProcessor next = querier.getNext();
    assertNotNull(next);
    assertEquals(1, querier.getRunnableProcessors().size());
  }
View Full Code Here

Examples of org.apache.oodt.cas.workflow.engine.processor.TaskProcessor

  protected File testDir;

  private QuerierAndRunnerUtils utils;

  public void testRun() {
    TaskProcessor taskProcessor1 = null;
    TaskProcessor taskProcessor2 = null;

    try {
      taskProcessor1 = (TaskProcessor) utils.getProcessor(Priority.getDefault()
          .getValue(), "Executing", "running");
      taskProcessor2 = (TaskProcessor) utils.getProcessor(Priority.getDefault()
          .getValue(), "Executing", "running");
    } catch (Exception e) {
      fail(e.getMessage());
    }

    Metadata met = new Metadata();
    met.addMetadata("StartDateTime", DateUtils.toString(Calendar.getInstance()));

    taskProcessor1.getWorkflowInstance().getSharedContext().addMetadata(met);
    taskProcessor2.getWorkflowInstance().getSharedContext().addMetadata(met);

    try {
      runner.execute(taskProcessor1);
      runner.execute(taskProcessor2);
      assertTrue(ranFast());
View Full Code Here

Examples of org.apache.oodt.cas.workflow.engine.processor.TaskProcessor

    inst.setCurrentTaskId(workflow.getTasks().get(0).getTaskId());
    inst.setParentChildWorkflow(workflow);
    WorkflowProcessorBuilder builder = WorkflowProcessorBuilder
        .aWorkflowProcessor().withLifecycleManager(lifecycleManager)
        .withPriority(priority).withInstance(inst);
    TaskProcessor taskProcessor = (TaskProcessor) builder
        .build(TaskProcessor.class);
    taskProcessor.getWorkflowInstance().setState(lifecycleManager.getDefaultLifecycle().createState(
        stateName, categoryName, ""));   
    return taskProcessor;
  }
View Full Code Here

Examples of org.glassfish.tyrus.container.grizzly.client.TaskProcessor

    @Override
    public NextAction handleClose(FilterChainContext ctx) throws IOException {

        final org.glassfish.tyrus.spi.Connection connection = getConnection(ctx);
        if (connection != null) {
            TaskProcessor taskProcessor = getTaskProcessor(ctx);
            taskProcessor.processTask(new CloseTask(connection, CloseReasons.CLOSED_ABNORMALLY.getCloseReason(), ctx.getConnection()));
        }
        return ctx.getStopAction();
    }
View Full Code Here

Examples of org.glassfish.tyrus.container.grizzly.client.TaskProcessor

            // get the frame(s) content

            Buffer buffer = message.getContent();
            message.recycle();
            final ReadHandler readHandler = tyrusConnection.getReadHandler();
            TaskProcessor taskProcessor = getTaskProcessor(ctx);
            if (!buffer.isComposite()) {
                taskProcessor.processTask(new ProcessTask(buffer.toByteBuffer(), readHandler));
            } else {
                final ByteBufferArray byteBufferArray = buffer.toByteBufferArray();
                final ByteBuffer[] array = byteBufferArray.getArray();

                for (int i = 0; i < byteBufferArray.size(); i++) {
                    taskProcessor.processTask(new ProcessTask(array[i], readHandler));
                }

                byteBufferArray.recycle();
            }
        }
View Full Code Here

Examples of org.glassfish.tyrus.container.grizzly.client.TaskProcessor

                        grizzlyConnection.close();
                    }
                });

                TYRUS_CONNECTION.set(grizzlyConnection, connection);
                TASK_PROCESSOR.set(grizzlyConnection, new TaskProcessor());

                grizzlyConnection.addCloseListener(new CloseListener() {
                    @Override
                    public void onClosed(Closeable closeable, ICloseType type) throws IOException {
                        // close detected on connection
View Full Code Here

Examples of org.jacorb.notification.engine.TaskProcessor

    }

    public void testInvokeDrinkingCoffee() throws Exception
    {
        MockControl controlTaskProcessor = MockControl.createControl(TaskProcessor.class);
        TaskProcessor mockTaskProcessor = (TaskProcessor) controlTaskProcessor.getMock();

        TypedEventMessage message = new TypedEventMessage();
        Message handle = message.getHandle();

        mockTaskProcessor.processMessage(handle);
        controlTaskProcessor.setMatcher(new AbstractMatcher()
        {
            protected boolean argumentMatches(Object exp, Object act)
            {
                Message mesg = (Message) exp;
View Full Code Here

Examples of org.jacorb.notification.engine.TaskProcessor

    }

    public void testInvokeDrinkingCoffee() throws Exception
    {
        MockControl controlTaskProcessor = MockControl.createControl(TaskProcessor.class);
        TaskProcessor mockTaskProcessor = (TaskProcessor) controlTaskProcessor.getMock();

        TypedEventMessage message = new TypedEventMessage();
        Message handle = message.getHandle();

        mockTaskProcessor.processMessage(handle);
        controlTaskProcessor.setMatcher(new AbstractMatcher()
        {
            protected boolean argumentMatches(Object exp, Object act)
            {
                Message mesg = (Message) exp;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.