Package org.jbpm.command

Examples of org.jbpm.command.Command


public class JobListenerBean extends CommandListenerBean {

  private static final long serialVersionUID = 1L;

  protected Command extractCommand(Message message) {
    Command command = null;
    try {
      // checking for availability of the jobId property
      boolean isJobIdAvailable = false;
      Enumeration enumeration = message.getPropertyNames();
      while ( (!isJobIdAvailable)
View Full Code Here


  private static final long serialVersionUID = 1L;
 
  protected MessageDrivenContext messageDrivenContext = null;

  public void onMessage(Message message) {
    Command command = extractCommand(message);
    if (command!=null) {
      try {
        log.debug("looking up local command service");
        Context initial = new InitialContext();
        Context environment = (Context) initial.lookup("java:comp/env");
View Full Code Here

      }
    }
  }

  protected Command extractCommand(Message message) {
    Command command = null;
    if (message instanceof ObjectMessage) {
      try {
        log.debug("deserializing command from jms message...");
        ObjectMessage objectMessage = (ObjectMessage)message;
        Serializable object = objectMessage.getObject();
View Full Code Here

      }
      message = dbMessageService.receiveNoWait(destination);
     
      if (message!=null) {
        checkForMoreMessages = true;
        Command command = (Command) message;
        log.trace("executing command '"+command+"'");
        command.execute();
      }
     
    } catch (Throwable t) {
      // rollback the transaction
      log.debug("command '"+message+"' threw exception. rolling back transaction", t);
View Full Code Here

     * @throws JMSException For errors during extraction.
     */
    protected Command extractCommand(Message message)
        throws JMSException
    {
        Command command = null;
        if (message instanceof ObjectMessage)
        {
            log.debug("deserializing command from jms message...");
            ObjectMessage objectMessage = (ObjectMessage)message;
            Serializable object = objectMessage.getObject();
View Full Code Here

     * @throws JMSException For errors during extraction.
     */
    protected Command extractCommand(Message message)
        throws JMSException
    {
        Command command = null;
        // checking for availability of the jobId property
        if (log.isDebugEnabled()) {
            log.debug("getting job id from jms message...");
        }
        Long jobId = (Long) message.getObjectProperty("jobId");
View Full Code Here

        {
            final JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
            try
            {
                // extract command from message
                Command command = extractCommand(message);
                if (log.isDebugEnabled())
                {
                    log.debug("Extracted command " + command) ;
                }
                if (command == null)
                {
                    discard(jbpmContext, message);
                    return;
                }
                final Object result = command.execute(jbpmContext);
                // send a response back if a "reply to" destination is set
                final Destination replyTo = message.getJMSReplyTo();
                if (replyTo != null && (result instanceof Serializable || result == null))
                {
                    sendResult(jbpmContext, (Serializable)result, replyTo, message.getJMSMessageID());
View Full Code Here

TOP

Related Classes of org.jbpm.command.Command

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.