Package org.jbpm.wire

Examples of org.jbpm.wire.Descriptor


  public void initialize(Object object, WireContext wireContext) {
    Map<Object,Object> map = (Map<Object,Object>) object;
    try {
      if (keyDescriptors!=null) {
        for (int i=0; i<keyDescriptors.size(); i++) {
          Descriptor keyDescriptor = keyDescriptors.get(i);
          Descriptor valueDescriptor = valueDescriptors.get(i);
          Object key = wireContext.create(keyDescriptor, true);
          Object value = wireContext.create(valueDescriptor, true);
          map.put(key, value);
        }
      }
View Full Code Here


        parse.addProblem("element factory is specified together with attribute factory in element object: "+XmlUtil.toString(element));
      }

    } else if (factoryElement!=null) {
      Element factoryDescriptorElement = XmlUtil.element(factoryElement);
      Descriptor factoryDescriptor = (Descriptor) parser.parseElement(factoryDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      descriptor.setFactoryDescriptor(factoryDescriptor);

    } else {
      parse.addProblem("element object must have one of {attribute class, attribute factory or element factory}: "+XmlUtil.toString(element));
    }
View Full Code Here

    } else {
      parse.addProblem("field must have name : "+XmlUtil.toString(element));
    }
    Element descriptorElement = XmlUtil.element(element);
    if (descriptorElement!=null) {
      Descriptor descriptor = (Descriptor) parser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      if (descriptor!=null) {
        fieldOperation.setDescriptor(descriptor);
      } else {
        parse.addProblem("unknown descriptor element "+descriptorElement.getTagName()+" inside field operation: "+XmlUtil.toString(element));
      }
View Full Code Here

      descriptor.setConfigurationName(element.getAttribute("configuration"));

    // if hibernate session factory binding has sub elements, we assume that
    // it is an inline configuration declaration
    } else if (XmlUtil.elements(element)!=null) {
      Descriptor configurationDescriptor = (Descriptor) super.parse(element, parse, parser);
      descriptor.setConfigurationDescriptor(configurationDescriptor);
    }

    return descriptor;
  }
View Full Code Here

  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);
        interceptedCommandService = interceptor;
      }
    }
    return interceptedCommandService;
View Full Code Here

   
    List<Descriptor> valueDescriptors = new ArrayList<Descriptor>();
    List<Element> elements = XmlUtil.elements(element);
    if (elements!=null) {
      for (Element valueElement: elements) {
        Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueElement, parse, WireParser.CATEGORY_DESCRIPTOR);
        if (valueDescriptor!=null) {
          valueDescriptors.add(valueDescriptor);
        }
      }
    }
View Full Code Here

    commandServiceDescriptor.setCommandService(commandService);
   
    List<Element> interceptorElements = XmlUtil.elements(element);
    if (interceptorElements!=null) {
      for (Element interceptorElement : interceptorElements) {
        Descriptor interceptorDescriptor = (Descriptor) parser.parseElement(interceptorElement, parse, WireParser.CATEGORY_INTERCEPTOR);
        commandServiceDescriptor.addInterceptorDescriptor(interceptorDescriptor);
      }
    }

    return commandServiceDescriptor;
View Full Code Here

    } else {
      parse.addProblem("property must have name or setter attribute: "+XmlUtil.toString(element));
    }
    Element descriptorElement = XmlUtil.element(element);
    if (descriptorElement!=null) {
      Descriptor descriptor = (Descriptor) parser.parseElement(descriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
      if (descriptor!=null) {
        propertyOperation.setDescriptor(descriptor);
      } else {
        parse.addProblem("couldn't parse property content element as a value descriptor: "+XmlUtil.toString(element));
      }
View Full Code Here

      for (Element entryElement: elements) {
        if ("entry".equals(XmlUtil.getTagName(entryElement))) {
          // key
          Element keyElement = XmlUtil.element(entryElement, "key");
          Element keyDescriptorElement = (keyElement!=null ? XmlUtil.element(keyElement) : null);
          Descriptor keyDescriptor = (Descriptor) parser.parseElement(keyDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);
          // value
          Element valueElement = XmlUtil.element(entryElement, "value");
          Element valueDescriptorElement = (valueElement!=null ? XmlUtil.element(valueElement) : null);
          Descriptor valueDescriptor = (Descriptor) parser.parseElement(valueDescriptorElement, parse, WireParser.CATEGORY_DESCRIPTOR);

          if ( (keyDescriptor!=null)
               && (valueDescriptor!=null)
             ) {
            keyDescriptors.add(keyDescriptor);
View Full Code Here

      } catch (JbpmReflectException e) {
        throw new WireException("couldn't create '"+(name!=null ? name : className)+"': "+e.getMessage(), e.getCause());
      }
    }
   
    Descriptor descriptor = null;
    if (factoryDescriptor!=null) {
      descriptor = factoryDescriptor;
    } else if (factoryObjectName!=null) {
      descriptor = wireDefinition.getDescriptor(factoryObjectName);
    }

    if (descriptor!=null) {
      Class<?> factoryClass = descriptor.getType(wireDefinition);
      if (factoryClass!=null) {
        Method method = ReflectUtil.findMethod(factoryClass, methodName, argDescriptors, null);
        if (method!=null) {
          return method.getReturnType();
        }
View Full Code Here

TOP

Related Classes of org.jbpm.wire.Descriptor

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.