Package org.jbpm.pvm.internal.session

Examples of org.jbpm.pvm.internal.session.MessageSession


  public SendMessageCmd(Message message) {
    this.message = message;
  }

  public Object execute(Environment environment) throws Exception {
    MessageSession messageSession = environment.get(MessageSession.class);
    messageSession.send(message);
    return null;
  }
View Full Code Here


  public <T> T execute(Command<T> command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new JbpmException("no environment for verifying authorization");
    }
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new JbpmException("no message session for executing command asynchronously");
    }
    String userId = (propagateUserId ? environment.getUserId() : null);
    messageSession.send(new AsyncCommandMessage(command, userId));
    return null;
  }
View Full Code Here

    }
  }
 
  public void sendContinuationMessage(AtomicOperation operation) {
    Environment environment = Environment.getCurrent();
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new JbpmException("no message-session configured to send asynchronous continuation message");
    }
    MessageImpl<?> asyncMessage = operation.createAsyncMessage(this);
    setState(Execution.STATE_ASYNC);
    messageSession.send(asyncMessage);
  }
View Full Code Here

  public <T> T execute(Command<T> command) {
    EnvironmentImpl environment = EnvironmentImpl.getCurrent();
    if (environment==null) {
      throw new JbpmException("no environment for verifying authorization");
    }
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new JbpmException("no message session for executing command asynchronously");
    }
    String userId = (propagateUserId ? environment.getAuthenticatedUserId() : null);
    messageSession.send(new AsyncCommandMessage(command, userId));
    return null;
  }
View Full Code Here

    }
  }
 
  public void sendContinuationMessage(AtomicOperation operation) {
    EnvironmentImpl environment = EnvironmentImpl.getCurrent();
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new JbpmException("no message-session configured to send asynchronous continuation message");
    }
    MessageImpl<?> asyncMessage = operation.createAsyncMessage(this);
    setState(Execution.STATE_ASYNC);
    messageSession.send(asyncMessage);
  }
View Full Code Here

  public SendMessageCmd(Message message) {
    this.message = message;
  }

  public Object execute(Environment environment) throws Exception {
    MessageSession messageSession = environment.get(MessageSession.class);
    messageSession.send(message);
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.session.MessageSession

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.