Package org.jbpm.api.listener

Examples of org.jbpm.api.listener.EventListener


    if (eventListenerReferences==null) {
      return null;
    }
    List<EventListener> eventListeners = new ArrayList<EventListener>(eventListenerReferences.size());
    for (ObjectReference<EventListener> eventListenerReference : eventListenerReferences) {
      EventListener eventListener = eventListenerReference.get();
      eventListeners.add(eventListener);
    }
    return eventListeners;
  }
View Full Code Here


 
  void executeHandler(ExecutionImpl execution, Exception exception) {
    if (eventListenerReferences!=null) {
      for (ObjectReference<EventListener> eventListenerReference: eventListenerReferences) {
       
        EventListener eventListener = eventListenerReference.get();
       
        log.trace("executing "+eventListener+" for "+this);
        try {
          eventListener.notify(execution);
        } catch (RuntimeException e) {
          throw e;
        } catch (Exception e) {
          throw new JbpmException("couldn't execute "+eventListener, e);
        }
View Full Code Here

         && (!eventListenerReferences.isEmpty())
       ) {
      EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
      ObservableElement eventSource = execution.getEventSource();
      if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
        EventListener eventListener = eventListenerReference.get();
        log.trace("executing " + eventListener + " for " + event);
        try {
          // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
          eventListener.notify(execution);
        } catch (Exception e) {
          log.trace("exception during action: " + e);
          execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action " + eventListener);
        }
      }
View Full Code Here

    super("event-listener");
  }

  public Object parse(Element element, Parse parse, Parser parser) {
    Descriptor descriptor = JpdlParser.parseObjectDescriptor(element, parse);
    EventListener eventListener = (EventListener) WireContext.create(descriptor);
    return eventListener;
  }
View Full Code Here

      }

      for (Element eventListenerElement: XmlUtil.elements(element)) {
        JpdlBinding eventBinding = (JpdlBinding) getBinding(eventListenerElement, CATEGORY_EVENT_LISTENER);
        if (eventBinding!=null) {
          EventListener eventListener = (EventListener) eventBinding.parse(eventListenerElement, parse, this);
          EventListenerReference eventListenerReference = event.createEventListenerReference(eventListener);
         
          if (XmlUtil.attributeBoolean(eventListenerElement, "propagation", false, parse, false)) {
            eventListenerReference.setPropagationEnabled(true);
          }
View Full Code Here

  public EventListener getEventListener() {
    if (eventListener!=null) {
      return eventListener;
    }
    if (eventListenerDescriptor!=null) {
      EventListener createdEventListener = (EventListener) ReflectUtil.instantiateUserCode(eventListenerDescriptor, processDefinition);
      if (!isEventListenerStateful) {
        eventListener = createdEventListener;
      }
      return createdEventListener;
    }
View Full Code Here

         && (!eventListenerReferences.isEmpty())
       ) {
      EventListenerReference eventListenerReference = eventListenerReferences.get(eventListenerIndex);
      ObservableElement eventSource = execution.getEventSource();
      if ((eventSource == observableElement) || (eventListenerReference.isPropagationEnabled())) {
        EventListener eventListener = eventListenerReference.getEventListener();
        log.trace("executing " + eventListener + " for " + event);
        try {
          // TODO can/should this invocation be unified with the exception handler invocation of the event notification method?
          eventListener.notify(execution);
        } catch (Exception e) {
          log.trace("exception during action: " + e);
          execution.handleException((ObservableElementImpl) observableElement, event, eventListenerReference, e, "couldn't run action " + eventListener);
        }
      }
View Full Code Here

  private static final long serialVersionUID = 1L;
 
  protected UserCodeReference eventListenerReference;

  public void notify(EventListenerExecution execution) throws Exception {
    EventListener eventListener = (EventListener) eventListenerReference.getObject(execution);
    eventListener.notify(execution);
  }
View Full Code Here

 
  void executeHandler(ExecutionImpl execution, Exception exception) {
    if (eventListenerReferences!=null) {
      for (EventListenerReference eventListenerReference: eventListenerReferences) {
       
        EventListener eventListener = eventListenerReference.getEventListener();
       
        log.trace("executing "+eventListener+" for "+this);
        try {
          eventListener.notify(execution);
        } catch (RuntimeException e) {
          throw e;
        } catch (Exception e) {
          throw new JbpmException("couldn't execute "+eventListener, e);
        }
View Full Code Here

        JpdlBinding eventBinding = (JpdlBinding) getBinding(eventListenerElement, CATEGORY_EVENT_LISTENER);
        if (eventBinding!=null) {
          EventListenerReference eventListenerReference = null;
          Object parseResult = eventBinding.parse(eventListenerElement, parse, this);
          if (parseResult instanceof EventListener) {
            EventListener eventListener = (EventListener) parseResult;
            eventListenerReference = event.createEventListenerReference(eventListener);
          } else {
            Descriptor eventListenerDescriptor = (Descriptor) parseResult;
            eventListenerReference = event.createEventListenerReference(eventListenerDescriptor);
          }
View Full Code Here

TOP

Related Classes of org.jbpm.api.listener.EventListener

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.