Interface ApplicationEventListener
-
@Beta public interface ApplicationEventListener
Listens to application-level events that are interesting for monitoring. Only one listener per application can be registered.- Author:
- Petr Janouch
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPPLICATION_EVENT_LISTENERA key used for registering a application event listener implementation.static ApplicationEventListenerNO_OPAn instance of @ApplicationEventListener that does not do anything.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidonApplicationDestroyed()Called when the application has been destroyed.voidonApplicationInitialized(java.lang.String applicationName)Called when the application has been initialized.EndpointEventListeneronEndpointRegistered(java.lang.String endpointPath, java.lang.Class<?> endpointClass)Called when an endpoint has been registered.voidonEndpointUnregistered(java.lang.String endpointPath)Called when an endpoint has been unregistered.
-
-
-
Field Detail
-
APPLICATION_EVENT_LISTENER
static final java.lang.String APPLICATION_EVENT_LISTENER
A key used for registering a application event listener implementation.For monitoring in Grizzly server an instance should be passed to the server in server properties:
serverProperties.put(ApplicationEventListener.APPLICATION_EVENT_LISTENER, new MyApplicationEventListener());For use in servlet container the class name should be passed as a context parameter in web.xml:<context-param> <param-name>org.glassfish.tyrus.core.monitoring.ApplicationEventListener</param-name> <param-value>com.acme.MyApplicationEventListener</param-value> </context-param>- See Also:
- Constant Field Values
-
NO_OP
static final ApplicationEventListener NO_OP
An instance of @ApplicationEventListener that does not do anything.
-
-
Method Detail
-
onApplicationInitialized
void onApplicationInitialized(java.lang.String applicationName)
Called when the application has been initialized.- Parameters:
applicationName- name of the initialized application.
-
onApplicationDestroyed
void onApplicationDestroyed()
Called when the application has been destroyed.
-
onEndpointRegistered
EndpointEventListener onEndpointRegistered(java.lang.String endpointPath, java.lang.Class<?> endpointClass)
Called when an endpoint has been registered.- Parameters:
endpointPath- the path the endpoint has been registered on.endpointClass- class of the registered endpoint.- Returns:
- endpoint event listener for registered endpoint.
-
onEndpointUnregistered
void onEndpointUnregistered(java.lang.String endpointPath)
Called when an endpoint has been unregistered.- Parameters:
endpointPath- the path the endpoint has been registered on.
-
-