Package org.jbpm.wire.descriptor

Examples of org.jbpm.wire.descriptor.ReferenceDescriptor


* @see WireParser
*/
public class RefBinding implements Binding {

  public Object parse(Element element, Parse parse, Parser parser) {
    ReferenceDescriptor descriptor = new ReferenceDescriptor();
    if (element.hasAttribute("object")) {
      descriptor.setValue(element.getAttribute("object"));
    } else {
      parse.addProblem("ref must have object attribute: "+XmlUtil.toString(element));
    }
    return descriptor;
  }
View Full Code Here


*/
public class PersistenceSessionBinding implements Binding {

  public Object parse(Element element, Parse parse, Parser parser) {
    String factoryName = XmlUtil.attribute(element, "factory");
    ReferenceDescriptor factoryDescriptor = new ReferenceDescriptor();
    factoryDescriptor.setValue(factoryName);

    ObjectDescriptor persistenceSessionDescriptor = new ObjectDescriptor();
    persistenceSessionDescriptor.setFactoryDescriptor(factoryDescriptor);
    persistenceSessionDescriptor.setMethodName("openPersistenceSession");

    persistenceSessionDescriptor.setAutoWireEnabled(true);

    String connectionName = XmlUtil.attribute(element, "connection");
    if (connectionName!=null) {
      List<ArgDescriptor> argDescriptors = new ArrayList<ArgDescriptor>();
      persistenceSessionDescriptor.setArgDescriptors(argDescriptors);

      ArgDescriptor argDescriptor = new ArgDescriptor();
      argDescriptor.setTypeName(Connection.class.getName());
      ReferenceDescriptor connectionDescriptor = new ReferenceDescriptor();
      connectionDescriptor.setValue(connectionName);
      argDescriptor.setDescriptor(connectionDescriptor);
    }

    SubscribeOperation subscribeOperation = new SubscribeOperation();
    subscribeOperation.setWireEvents(false);
View Full Code Here

TOP

Related Classes of org.jbpm.wire.descriptor.ReferenceDescriptor

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.