Package org.jbpm.ejb

Examples of org.jbpm.ejb.LocalCommandService


    log.debug("ejb timer "+ejbTimer+" fires");
    String localCommandServiceJndiName = "java:comp/env/ejb/LocalCommandServiceBean";
    try {
      Context initial = new InitialContext();
      LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initial.lookup(localCommandServiceJndiName);
      LocalCommandService localCommandService = localCommandServiceHome.create();
      Serializable info = ejbTimer.getInfo();
      if (! (info instanceof TimerInfo)) {
        if (info ==null) {
          throw new NullPointerException("timer info is null");
        } else {
          throw new ClassCastException("timer info ("+info.getClass().getName()+") is not of the expected class "+TimerInfo.class.getName());
        }
      }
      TimerInfo timerInfo = (TimerInfo) info;
      Timer timer = (Timer) localCommandService.execute(new ExecuteTimerCommand(timerInfo.getTimerId()));
      // if the timer has repeat
      if ( (timer!=null)
           && (timer.getRepeat()!=null)
         ) {
        // create a new timer
View Full Code Here


    log.debug("ejb timer "+timer+" fires");
    String localCommandServiceJndiName = "java:comp/env/ejb/LocalCommandServiceBean";
    try {
      Context initial = new InitialContext();
      LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initial.lookup(localCommandServiceJndiName);
      LocalCommandService localCommandService = localCommandServiceHome.create();
      localCommandService.execute(new ExecuteTimerCommand(id.longValue()));
      // if the timer has repeat
      if (repeat!=null) {
        // create a new timer
        log.debug("repeating timer "+id);
        createTimer(repeat);
View Full Code Here

    log.debug("ejb timer "+ejbTimer+" fires");
    String localCommandServiceJndiName = "java:comp/env/ejb/LocalCommandServiceBean";
    try {
      Context initial = new InitialContext();
      LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) initial.lookup(localCommandServiceJndiName);
      LocalCommandService localCommandService = localCommandServiceHome.create();
      Serializable info = ejbTimer.getInfo();
      if (! (info instanceof TimerInfo)) {
        if (info ==null) {
          throw new NullPointerException("timer info is null");
        } else {
          throw new ClassCastException("timer info ("+info.getClass().getName()+") is not of the expected class "+TimerInfo.class.getName());
        }
      }
      TimerInfo timerInfo = (TimerInfo) info;
      localCommandService.execute(new ExecuteTimerCommand(timerInfo.getTimerId()));
    } catch (Exception e) {
      JbpmException jbpmException = new JbpmException("couldn't execute timer", e);
      log.error(jbpmException);
      throw jbpmException;
    }
View Full Code Here

      try {
        log.debug("looking up local command service");
        Context initial = new InitialContext();
        Context environment = (Context) initial.lookup("java:comp/env");
        LocalCommandServiceHome localCommandServiceHome = (LocalCommandServiceHome) environment.lookup("ejb/LocalCommandServiceBean");
        LocalCommandService localCommandService = localCommandServiceHome.create();
        try {
          // TODO add support for sending back the result
          // not a priority because i don't see much use cases for that.
          // let me know on the dev forums if you think otherwise.
          log.debug("executing command with local command service");
          localCommandService.execute(command);
        } finally {
          localCommandService.remove();
        }
      } catch (Exception e) {
        e.printStackTrace();
        // TODO add a retry mechanism or verify how this can be configured in the MDB itself
        throw new JbpmException("command "+command+" couldn't be executed", e);
View Full Code Here

TOP

Related Classes of org.jbpm.ejb.LocalCommandService

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.