Examples of JobExecutorDescriptor


Examples of org.jbpm.pvm.internal.wire.descriptor.JobExecutorDescriptor

    super("job-executor");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    // create a jobImpl executor object
    JobExecutorDescriptor descriptor = new JobExecutorDescriptor();

    // inject the command executor

    if (element.hasAttribute("command-service")) {
      descriptor.addInjection("commandService",
          new ReferenceDescriptor(element.getAttribute("command-service"))
      );
    } else {
      descriptor.addInjection("commandService",
          new ContextTypeRefDescriptor(CommandService.class)
      );
    }

    if (element.hasAttribute("name")) {
      descriptor.addInjection("name", new StringDescriptor(element.getAttribute("name")));
    }

    parseIntAttribute(element, "threads", descriptor, "nbrOfThreads", parse);
    parseIntAttribute(element, "idle", descriptor, "idleMillis", parse);
    parseIntAttribute(element, "idle-max", descriptor, "idleMillisMax", parse);
    parseIntAttribute(element, "history", descriptor, "historySize", parse);
    parseIntAttribute(element, "lock", descriptor, "lockMillis", parse);

    // by default invoke the start method, unless auto-start is disabled
    if (XmlUtil.attributeBoolean(element, "auto-start", false, parse, true)) {
      InvokeOperation invokeStartOperation = new InvokeOperation();
      invokeStartOperation.setMethodName("start");
      descriptor.addOperation(invokeStartOperation);
      descriptor.setAutoStart(true);
    }

    return descriptor;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.wire.descriptor.JobExecutorDescriptor

    super("job-executor");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    // create a jobImpl executor object
    JobExecutorDescriptor descriptor = new JobExecutorDescriptor();

    // inject the command executor

    if (element.hasAttribute("command-service")) {
      descriptor.addInjection("commandService",
          new ReferenceDescriptor(element.getAttribute("command-service"))
      );
    } else {
      descriptor.addInjection("commandService",
          new ReferenceDescriptor(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE)
      );
    }

    if (element.hasAttribute("name")) {
      descriptor.addInjection("name", new StringDescriptor(element.getAttribute("name")));
    }

    parseIntAttribute(element, "threads", descriptor, "nbrOfThreads", parse);
    parseIntAttribute(element, "idle", descriptor, "idleMillis", parse);
    parseIntAttribute(element, "idle-max", descriptor, "idleMillisMax", parse);
    parseIntAttribute(element, "history", descriptor, "historySize", parse);
    parseIntAttribute(element, "lock", descriptor, "lockMillis", parse);

    // by default invoke the start method, unless auto-start is disabled
    if (XmlUtil.attributeBoolean(element, "auto-start", false, parse, true)) {
      InvokeOperation invokeStartOperation = new InvokeOperation();
      invokeStartOperation.setMethodName("start");
      descriptor.addOperation(invokeStartOperation);
      descriptor.setAutoStart(true);
      descriptor.setInit(AbstractDescriptor.INIT_EAGER);
    }

    return descriptor;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.