@Override public void removeExecutionListener( final GraphProcess process, final ExecutionListener listener, final ExecutionEventType... eventTypes) { process.getEventQueue().removeListener(this, listener, eventTypes); }
@Override public void removeExecutionListener( GraphProcess process, ExecutionListener listener, ExecutionEventType... eventTypes) { process.getEventQueue().removeListener(this, listener, eventTypes); List<ExecutionEventType> types = eventTypes == null ? null : Arrays.asList(eventTypes); for (HibProcessListener hibListener : ((HibGraphProcess) process).getListeners()) { if (process.equals(hibListener.getProcess()) && (eventTypes == null || eventTypes.length == 0 || types.contains(hibListener.getEventType()))) { session.delete(hibListener); } } }
@Override public void addExecutionListener( GraphProcess process, ExecutionListener listener, ExecutionEventType... eventTypes) { if (eventTypes == null || listener == null) { return; } for (ExecutionEventType eventType : eventTypes) { if (eventType != null) { HibProcessListener hibListener = new HibProcessListener(listener.getClass().getName(), eventType, process); session.save(hibListener); } } process.getEventQueue().addListener(this, listener, eventTypes); listenerCache.ensureContainsListenerType(listener); }