Examples of ObjectDescriptor


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

    return taskDefinition;
  }

  public static ObjectDescriptor parseObjectDescriptor(Element element, Parse parse) {
    ObjectDescriptor objectDescriptor = new ObjectDescriptor();
 
    String className = XmlUtil.attribute(element, "class");
    if (className!=null) {
      objectDescriptor.setClassName(className);
 
      // read the operations elements
      List<Operation> operations = null;
      List<Element> elements = XmlUtil.elements(element);
     
      Set<String> operationTagNames = wireParser.getBindings().getTagNames(WireParser.CATEGORY_OPERATION);
      for (Element childElement: elements) {
        if (operationTagNames.contains(childElement.getTagName())) {
          Operation operation = (Operation) wireParser.parseElement(childElement, parse, WireParser.CATEGORY_OPERATION);
          if (operations==null) {
            operations = new ArrayList<Operation>();
          }
          operations.add(operation);
        }
      }
      objectDescriptor.setOperations(operations);
 
      // autowiring
      Boolean isAutoWireEnabled = XmlUtil.attributeBoolean(element, "auto-wire", false, parse);
      if (isAutoWireEnabled!=null) {
        objectDescriptor.setAutoWireEnabled(isAutoWireEnabled.booleanValue());
      }
    }
    return objectDescriptor;
  }
View Full Code Here

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

  public static MailProducer parseMailProducer(Element element, Parse parse, String defaultTemplateName) {
    // check whether the element is a generic object descriptor
    if (ObjectBinding.isObjectDescriptor(element)) {
      // TODO test custom mail producer
      ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
      return (MailProducer) WireContext.create(objectDescriptor);
    }

    // parse the default producer
    MailProducerImpl mailProducer = new MailProducerImpl();
View Full Code Here

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

  public JpdlDeployerBinding() {
    super("jpdl-deployer");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    return new ObjectDescriptor(JpdlDeployer.class);
  }
View Full Code Here

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

  public EjbLocalCommandServiceBinding() {
    super("ejb-local-command-service");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(EjbLocalCommandService.class);
    // retrieve home name
    String homeJndiName = "java:comp/env/ejb/LocalCommandExecutor";
    Element homeElement = XmlUtil.element(element, "home");
    if (homeElement != null && homeElement.hasAttribute("jndi-name")) {
      homeJndiName = homeElement.getAttribute("jndi-name");
    }
    // inject home name
    descriptor.addInjection("commandExecutorHome", new JndiDescriptor(homeJndiName));
    return descriptor;
  }
View Full Code Here

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

  public EjbTimerSessionBinding() {
    super("ejb-timer-session");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(EjbTimerSession.class);
    descriptor.addInjection("timerHome", new JndiDescriptor(
        "java:comp/env/ejb/LocalTimer"));
    return descriptor;
  }
View Full Code Here

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

  public ScriptManagerBinding() {
    super("script-manager");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(ScriptManager.class);
   
    if (element.hasAttribute("default-expression-language")) {
      String defaultLanguage = element.getAttribute("default-expression-language");
      descriptor.addInjection("defaultExpressionLanguage", new StringDescriptor(defaultLanguage));
    }

    if (element.hasAttribute("default-script-language")) {
      String defaultLanguage = element.getAttribute("default-script-language");
      descriptor.addInjection("defaultScriptLanguage", new StringDescriptor(defaultLanguage));
    }

    ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
    List<Element> scriptElements = XmlUtil.elements(element, "script-language");
    for (Element scriptElement : scriptElements) {
      String languageName = null;
      if (scriptElement.hasAttribute("name")) {
        languageName = scriptElement.getAttribute("name");
      } else {
        parse.addProblem("'name' is a required attribute in element <script-language />", element);
      }
      String factoryClassName = null;
      if (scriptElement.hasAttribute("factory")) {
        factoryClassName = scriptElement.getAttribute("factory");
      } else {
        parse.addProblem("'name' is a required attribute in element <script-language />", element);
      }
     
      if ( (languageName!=null)
           && (factoryClassName!=null)
         ) {
        try {
          ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
          Class<?> factoryClass = Class.forName(factoryClassName, true, classLoader);
          ScriptEngineFactory scriptEngineFactory = (ScriptEngineFactory) factoryClass.newInstance();
          scriptEngineManager.registerEngineName(languageName, scriptEngineFactory);
        } catch (Exception e) {
          parse.addProblem("couldn't instantiate ScriptEngineFactory "+factoryClassName, e);
        }
      }
    }
   
    descriptor.addInjection("scriptEngineManager", new ProvidedObjectDescriptor(scriptEngineManager));
   
    return descriptor;
  }
View Full Code Here

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

  public IdentityServiceBinding() {
    super("identity-service");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(IdentityServiceImpl.class);
    descriptor.addInjection("commandService", new ReferenceDescriptor(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE));
    return descriptor;
  }
View Full Code Here

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

  public ExecutionServiceBinding() {
    super("execution-service");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(ExecutionServiceImpl.class);
    descriptor.addInjection("commandService", new ReferenceDescriptor(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE));
    return descriptor;
  }
View Full Code Here

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

  public TaskServiceBinding() {
    super("task-service");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(TaskServiceImpl.class);
    descriptor.addInjection("commandService", new ReferenceDescriptor(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE));
    return descriptor;
  }
View Full Code Here

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

  public RepositoryServiceBinding() {
    super("repository-service");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    ObjectDescriptor descriptor = new ObjectDescriptor(RepositoryServiceImpl.class);
    descriptor.addInjection("commandService", new ReferenceDescriptor(CommandService.NAME_TX_REQUIRED_COMMAND_SERVICE));
    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.