public boolean isListenerForSource(Object source) { if (wrapped != null) { return wrapped.isListenerForSource(source); } return false; }
public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } else { return instanceClass.isAssignableFrom(component.getClass()); } }
public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } else { return instanceClass.isAssignableFrom(component.getClass()); } }
/** * Is this a listener for the given component. * * @param component * the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } return instanceClass.isAssignableFrom(component.getClass()); }
/** * Is this a listener for the given component. * * @param component the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } else { return instanceClass.isAssignableFrom(component.getClass()); } }
/** * Is this a listener for the given component. * * @param component * the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } return instanceClass.isAssignableFrom(component.getClass()); }
/** * Is this a listener for the given component. * * @param component the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } else { return instanceClass.isAssignableFrom(component.getClass()); } }
/** * Is this a listener for the given component. * * @param component * the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } return instanceClass.isAssignableFrom(component.getClass()); }
/** * Is this a listener for the given component. * * @param component * the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } return instanceClass.isAssignableFrom(component.getClass()); }
/** * Is this a listener for the given component. * * @param component the component. * @return <code>true</code> if it is a listener, <code>false</code> otherwise. */ @Override public boolean isListenerForSource(Object component) { if (wrapped instanceof SystemEventListener) { return ((SystemEventListener) wrapped).isListenerForSource(component); } else { return instanceClass.isAssignableFrom(component.getClass()); } }
public boolean isListenerForSource(Object source) { weaveDelegate(); return _delegate.isListenerForSource(source); }
@Override public void processEvent(final SystemEvent event) throws AbortProcessingException { if (event instanceof PreDestroyApplicationEvent && !isBeanManagerAvailable()) { log.info("BeanManager no longer available; Cannot notify CDI-managed listeners of " + PreDestroyApplicationEvent.class.getSimpleName()); return; } for (SystemEventListener l : getEventListeners()) { if (l.isListenerForSource(event.getSource())) { l.processEvent(event); } } }
/** * Iterate through and invoke the listeners. If the passed event was <code>null</code>, create * the event, and return it. */ private SystemEvent processListeners(Collection<SystemEventListener> listeners, SystemEvent event, Object source, EventInfo eventInfo) { if (listeners != null && !listeners.isEmpty()) { ArrayList<SystemEventListener> list = new ArrayList<>(listeners); for (SystemEventListener curListener : list) { if (curListener != null && curListener.isListenerForSource(source)) { if (event == null) { event = eventInfo.createSystemEvent(source); } assert event != null; if (event.isAppropriateListener(curListener)) { event.processListener(curListener); } } } } return event; }
/** * Iterate through and invoke the listeners. If the passed event was <code>null</code>, create * the event, and return it. */ private SystemEvent processListeners(Collection<SystemEventListener> listeners, SystemEvent event, Object source, EventInfo eventInfo) { if (listeners != null && !listeners.isEmpty()) { ArrayList<SystemEventListener> list = new ArrayList<>(listeners); for (SystemEventListener curListener : list) { if (curListener != null && curListener.isListenerForSource(source)) { if (event == null) { event = eventInfo.createSystemEvent(source); } assert event != null; if (event.isAppropriateListener(curListener)) { event.processListener(curListener); } } } } return event; }
/** * Iterate through and invoke the listeners. If the passed event was <code>null</code>, create * the event, and return it. */ private SystemEvent processListeners(Collection<SystemEventListener> listeners, SystemEvent event, Object source, EventInfo eventInfo) { if (listeners != null && !listeners.isEmpty()) { ArrayList<SystemEventListener> list = new ArrayList<>(listeners); for (SystemEventListener curListener : list) { if (curListener != null && curListener.isListenerForSource(source)) { if (event == null) { event = eventInfo.createSystemEvent(source); } assert event != null; if (event.isAppropriateListener(curListener)) { event.processListener(curListener); } } } } return event; }
/** * Iterate through and invoke the listeners. If the passed event was * <code>null</code>, create the event, and return it. */ private SystemEvent processListeners(Collection<SystemEventListener> listeners, SystemEvent event, Object source, EventInfo eventInfo) { if (listeners != null && !listeners.isEmpty()) { ArrayList<SystemEventListener> list = new ArrayList<SystemEventListener>(listeners); for (SystemEventListener curListener : list) { if (curListener != null && curListener.isListenerForSource(source)) { if (event == null) { event = eventInfo.createSystemEvent(source); } assert (event != null); if (event.isAppropriateListener(curListener)) { event.processListener(curListener); } } } } return event; }
public void processEvent(final SystemEvent event) throws AbortProcessingException { for (SystemEventListener l : getEventListeners()) { if (l.isListenerForSource(event.getSource())) { l.processEvent(event); } } }
private static SystemEvent _traverseListenerList(List<? extends SystemEventListener> listeners, Class<? extends SystemEvent> systemEventClass, Object source, SystemEvent event) { if (listeners != null && !listeners.isEmpty()) { for (SystemEventListener listener : listeners) { // Call SystemEventListener.isListenerForSource(java.lang.Object), passing the source argument. // If this returns false, take no action on the listener. if (listener.isListenerForSource(source)) { // Otherwise, if the event to be passed to the listener instances has not yet been constructed, // construct the event, passing source as the argument to the one-argument constructor that takes // an Object. This same event instance must be passed to all listener instances. event = _createEvent(systemEventClass, source, event); // Call SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing the listener // instance as the argument. If this returns false, take no action on the listener. if (event.isAppropriateListener(listener)) { // Call SystemEvent.processListener(javax.faces.event.FacesListener), passing the listener // instance. event.processListener(listener); } } } } return event; }
private static SystemEvent _traverseListenerList(List<? extends SystemEventListener> listeners, Class<? extends SystemEvent> systemEventClass, Object source, SystemEvent event) { if (listeners != null && !listeners.isEmpty()) { for (SystemEventListener listener : listeners) { // Call SystemEventListener.isListenerForSource(java.lang.Object), passing the source argument. // If this returns false, take no action on the listener. if (listener.isListenerForSource(source)) { // Otherwise, if the event to be passed to the listener instances has not yet been constructed, // construct the event, passing source as the argument to the one-argument constructor that takes // an Object. This same event instance must be passed to all listener instances. event = _createEvent(systemEventClass, source, event); // Call SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing the listener // instance as the argument. If this returns false, take no action on the listener. if (event.isAppropriateListener(listener)) { // Call SystemEvent.processListener(javax.faces.event.FacesListener), passing the listener // instance. event.processListener(listener); } } } } return event; }
private static SystemEvent _traverseListenerList( List<? extends SystemEventListener> listeners, Class<? extends SystemEvent> systemEventClass, Object source, SystemEvent event) { if (listeners != null && !listeners.isEmpty()) { for (SystemEventListener listener : listeners) { // Call SystemEventListener.isListenerForSource(java.lang.Object), passing the source argument. // If this returns false, take no action on the listener. if (listener.isListenerForSource(source)) { // Otherwise, if the event to be passed to the listener instances has not yet been constructed, // construct the event, passing source as the argument to the one-argument constructor that takes // an Object. This same event instance must be passed to all listener instances. event = _createEvent(systemEventClass, source, event); // Call SystemEvent.isAppropriateListener(javax.faces.event.FacesListener), passing the listener // instance as the argument. If this returns false, take no action on the listener. if (event.isAppropriateListener(listener)) { // Call SystemEvent.processListener(javax.faces.event.FacesListener), passing the listener // instance. event.processListener(listener); } } } } return event; }