Package org.jbpm.client

Examples of org.jbpm.client.CommandService


    public void event(Object source, String eventName, Object info) {
      Transaction transaction = (Transaction) source;
      if (! transaction.isRolledBack()) {
        log.warning("no rollback after transactional exception handler. did you forget to rollback the transaction ?");
      }
      CommandService commandService = environmentFactory.get(CommandService.class);
      if (commandService==null) {
        throw new PvmException("environment factory doesn't have a command service");
      }
      commandService.execute(this);
    }
View Full Code Here


 
  CommandService commandService;
  List<Descriptor> interceptorDescriptors;

  public Object construct(WireContext wireContext) {
    CommandService interceptedCommandService = commandService;
    if (interceptorDescriptors!=null) {
      for (int i=interceptorDescriptors.size()-1 ; i>=0; i--) {
        Descriptor descriptor = interceptorDescriptors.get(i);
        Interceptor interceptor = (Interceptor) descriptor.construct(wireContext);
        interceptor.setNext(interceptedCommandService);
View Full Code Here

public class StandardCommandServiceBinding implements Binding {

  public Object parse(Element element, Parse parse, Parser parser) {
    CommandServiceDescriptor commandServiceDescriptor = new CommandServiceDescriptor();

    CommandService commandService = getCommandService(element, parse, parser);
    commandServiceDescriptor.setCommandService(commandService);
   
    List<Element> interceptorElements = XmlUtil.elements(element);
    if (interceptorElements!=null) {
      for (Element interceptorElement : interceptorElements) {
View Full Code Here

public class PvmServiceDescriptor extends AbstractDescriptor {

  private static final long serialVersionUID = 1L;

  public Object construct(WireContext wireContext) {
    CommandService commandService = wireContext.get(CommandService.class);
    if (commandService==null) {
      throw new WireException("no command-service available");
    }
    return new PvmServiceImpl(commandService);
  }
View Full Code Here

  public Object execute(Environment environment) throws Exception {
    if (userId!=null) {
      environment.setUserId(userId);
    }
    try {
      CommandService commandService = environment.get(CommandService.class);
      commandService.execute(command);
    } finally {
      if (userId!=null) {
        environment.setUserId(null);
      }
    }
View Full Code Here

      }
    }
  }

  protected Collection<Long> acquireJobs() {
    CommandService commandService = jobExecutor.getCommandExecutor();
    Command acquireJobsCommand = jobExecutor.getAcquireJobsCommand();
    return (Collection<Long>) commandService.execute(acquireJobsCommand);
  }
View Full Code Here

    Command acquireJobsCommand = jobExecutor.getAcquireJobsCommand();
    return (Collection<Long>) commandService.execute(acquireJobsCommand);
  }

  protected Date getNextDueDate() {
    CommandService commandService = jobExecutor.getCommandExecutor();
    Command getNextDueDate = jobExecutor.getNextDueDateCommand();
    return (Date) commandService.execute(getNextDueDate);
  }
View Full Code Here

   * transaction. */
  protected void handleJobExecutionException(Environment environment, Job job, Throwable exception) {
    Transaction transaction = environment.getTransaction();
    transaction.setRollbackOnly();

    CommandService commandService = (CommandService) environment.get(CommandService.class);
    JobExceptionHandler jobExceptionHandler = new JobExceptionHandler(job.getDbid(), exception, commandService);
    transaction.addListener(jobExceptionHandler, Transaction.EVENT_AFTERCOMPLETION);
  }
View Full Code Here

          Collection<Long> jobDbids = null;
          jobDbids = queue.take();
          log.fine("took job(s) "+jobDbids+" from queue");

          for (Long jobDbid: jobDbids) {
            CommandService commandService = jobExecutor.getCommandExecutor();
            commandService.execute(new ExecuteJobCommand(jobDbid));
          }
        } catch (InterruptedException e) {
          log.finest("waiting for acquired jobs got interrupted");
        } catch (Exception e) {
          log.log(Level.SEVERE, "exception in job executor thread", e);
View Full Code Here

TOP

Related Classes of org.jbpm.client.CommandService

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.