Class CompositeApplicationEventListener
- java.lang.Object
-
- org.glassfish.jersey.server.internal.monitoring.CompositeApplicationEventListener
-
- All Implemented Interfaces:
ApplicationEventListener
public class CompositeApplicationEventListener extends Object implements ApplicationEventListener
application event listenerthat aggregates more event listeners into one. Calling listener methods on this listener will cause calling methods on all aggregated listeners.- Author:
- Miroslav Fuksa
-
-
Constructor Summary
Constructors Constructor Description CompositeApplicationEventListener(Iterable<ApplicationEventListener> applicationEventListeners)Creates a new instance of composite event listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonEvent(ApplicationEvent event)Process the applicationevent.RequestEventListeneronRequest(RequestEvent requestEvent)Process a new request and return arequest event listenerif listening torequest eventsis required.
-
-
-
Constructor Detail
-
CompositeApplicationEventListener
public CompositeApplicationEventListener(Iterable<ApplicationEventListener> applicationEventListeners)
Creates a new instance of composite event listener.- Parameters:
applicationEventListeners- List of application event listener that should be aggregated.
-
-
Method Detail
-
onEvent
public void onEvent(ApplicationEvent event)
Description copied from interface:ApplicationEventListenerProcess the applicationevent. This method is called when new event occurs.- Specified by:
onEventin interfaceApplicationEventListener- Parameters:
event- Application event.
-
onRequest
public RequestEventListener onRequest(RequestEvent requestEvent)
Description copied from interface:ApplicationEventListenerProcess a new request and return arequest event listenerif listening torequest eventsis required. The method is called once for each new incoming request. If listening to the request is required then request event must be returned from the method. Such a request event listener will receive all request events that one request. If listening to request event for the request is not required thennullmust be returned from the method (do not return empty mock listener in these cases as it will have negative performance impact).- Specified by:
onRequestin interfaceApplicationEventListener- Parameters:
requestEvent- Event of typeRequestEvent.Type.START.- Returns:
- Request event listener that will monitor the events of the request
connected with
requestEvent; null otherwise.
-
-