public FlowExecutionListenerCriteria getListenerCriteria(String encodedCriteria) { if ("*".equals(encodedCriteria)) { return allFlows(); } else { String[] flowIds = StringUtils.commaDelimitedListToStringArray(encodedCriteria); for (int i = 0; i < flowIds.length; i++) { flowIds[i] = flowIds[i].trim(); } return flows(flowIds); } }
/** * Add a listener that will listen to executions to flows matching the specified criteria. * @param listener the listener * @param criteria the listener criteria */ public void addListener(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria) { if (listener == null) { throw new IllegalArgumentException("The flow execution listener cannot be null"); } if (logger.isDebugEnabled()) { logger.debug("Adding flow execution listener " + listener + " with criteria " + criteria); } ConditionalFlowExecutionListenerHolder conditional = getHolder(listener); if (conditional == null) { conditional = new ConditionalFlowExecutionListenerHolder(listener); listeners.add(conditional); } if (criteria == null) { criteria = new FlowExecutionListenerCriteriaFactory().allFlows(); } conditional.add(criteria); }
public FlowExecutionListenerCriteria getListenerCriteria(String encodedCriteria) { if ("*".equals(encodedCriteria)) { return allFlows(); } else { String[] flowIds = StringUtils.commaDelimitedListToStringArray(encodedCriteria); for (int i = 0; i < flowIds.length; i++) { flowIds[i] = flowIds[i].trim(); } return flows(flowIds); } }
public FlowExecutionListenerCriteria getListenerCriteria(String encodedCriteria) { if ("*".equals(encodedCriteria)) { return allFlows(); } else { String[] flowIds = StringUtils.commaDelimitedListToStringArray(encodedCriteria); for (int i = 0; i < flowIds.length; i++) { flowIds[i] = flowIds[i].trim(); } return flows(flowIds); } }
/** * Decode given string value into one of the well known criteria types. * @see FlowExecutionListenerCriteriaFactory */ protected FlowExecutionListenerCriteria getCriteria(String value) { if ("*".equals(value)) { return new FlowExecutionListenerCriteriaFactory().allFlows(); } else { String[] flowIds = StringUtils.commaDelimitedListToStringArray(value); for (int i = 0; i < flowIds.length; i++) { flowIds[i] = flowIds[i].trim(); } return new FlowExecutionListenerCriteriaFactory().flows(flowIds); } }
/** * Add a listener that will listen to executions to flows matching the specified criteria. * @param listener the listener * @param criteria the listener criteria */ public void addListener(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria) { if (listener == null) { throw new IllegalArgumentException("The flow execution listener cannot be null"); } if (logger.isDebugEnabled()) { logger.debug("Adding flow execution listener " + listener + " with criteria " + criteria); } ConditionalFlowExecutionListenerHolder conditional = getHolder(listener); if (conditional == null) { conditional = new ConditionalFlowExecutionListenerHolder(listener); listeners.add(conditional); } if (criteria == null) { criteria = new FlowExecutionListenerCriteriaFactory().allFlows(); } conditional.add(criteria); }
/** * Add a listener that will listen to executions to flows matching the specified criteria. * @param listener the listener * @param criteria the listener criteria */ public void addListener(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria) { if (listener == null) { throw new IllegalArgumentException("The flow execution listener cannot be null"); } if (logger.isDebugEnabled()) { logger.debug("Adding flow execution listener " + listener + " with criteria " + criteria); } ConditionalFlowExecutionListenerHolder conditional = getHolder(listener); if (conditional == null) { conditional = new ConditionalFlowExecutionListenerHolder(listener); listeners.add(conditional); } if (criteria == null) { criteria = new FlowExecutionListenerCriteriaFactory().allFlows(); } conditional.add(criteria); }
/** * Add a listener that will listen to executions to flows matching the specified criteria. * @param listener the listener * @param criteria the listener criteria */ public void addListener(FlowExecutionListener listener, FlowExecutionListenerCriteria criteria) { if (listener == null) { return; } if (logger.isDebugEnabled()) { logger.debug("Adding flow execution listener " + listener + " with criteria " + criteria); } ConditionalFlowExecutionListenerHolder conditional = getHolder(listener); if (conditional == null) { conditional = new ConditionalFlowExecutionListenerHolder(listener); listeners.add(conditional); } if (criteria == null) { criteria = new FlowExecutionListenerCriteriaFactory().allFlows(); } conditional.add(criteria); }
public void testAllFlows() { FlowExecutionListenerCriteria c = factory.allFlows(); assertEquals(true, c.appliesTo(new Flow("foo"))); }
public void testAddMultipleListeners() { FlowExecutionListener listener1 = new FlowExecutionListener() {}; FlowExecutionListener listener2 = new FlowExecutionListener() {}; loader.addListener(listener1, criteriaFactory.allFlows()); loader.addListener(listener2, criteriaFactory.allFlows()); Flow flow = new Flow("foo"); FlowExecutionListener[] listeners = loader.getListeners(flow); assertEquals(2, listeners.length); assertSame(listener1, listeners[0]); assertSame(listener2, listeners[1]); }
public void testAddConditionalListener() { FlowExecutionListener listener = new FlowExecutionListener() {}; loader.addListener(listener, criteriaFactory.allFlows()); Flow flow = new Flow("foo"); FlowExecutionListener[] listeners = loader.getListeners(flow); assertEquals(1, listeners.length); assertSame(listener, listeners[0]); }