Package org.apache.ode.bpel.iapi

Examples of org.apache.ode.bpel.iapi.Scheduler


    final Callable executionCallable;
   
    if(isTwoWay)
    {
      // Defer the invoke until the transaction commits.
      Scheduler scheduler = executionEnvironment.getScheduler();
      executionCallable = new TwoWayCallable(mex.getMessageExchangeId());
      scheduler.registerSynchronizer(new Scheduler.Synchronizer() {

            public void afterCompletion(boolean success)
            {
              // If the TX is rolled back, then we don't send the request.
              if (!success) return;

              // The invocation must happen in a separate thread, holding on the afterCompletion
              // blocks other operations that could have been listed there as well.
              ExecutorService executorService = executionEnvironment.getExecutorService();
              executorService.submit(executionCallable);
            }
           
            public void beforeCompletion(){}
          }
      );

      mex.replyAsync();
    }
    else
    {
      // one-way invocation, also defer the invoke until the transaction commits.
      Scheduler scheduler = executionEnvironment.getScheduler();
      executionCallable = new OneWayCallable(mex.getMessageExchangeId());
     
      scheduler.registerSynchronizer(new Scheduler.Synchronizer() {
   
    public void beforeCompletion() {
     
    }
   
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.iapi.Scheduler

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.