Class SessionlessApplicationMonitor
- java.lang.Object
-
- org.glassfish.tyrus.ext.monitoring.jmx.SessionlessApplicationMonitor
-
- All Implemented Interfaces:
ApplicationEventListener
public final class SessionlessApplicationMonitor extends java.lang.ObjectApplication events listener and statistics collector. The statistics are collected by aggregating statistics from application endpoints. The only difference formSessionAwareApplicationMonitoris thatSessionAwareApplicationMonitordoes not collect statistics on session level.It also creates and registers MXBeans that can be used to access these collected statistics. The created MXBeans will allow accessing monitored properties and statistics on application and endpoint level.
For monitoring in Grizzly server an instance should be passed to the server in server properties.
serverProperties.put(ApplicationEventListener.APPLICATION_EVENT_LISTENER, new SessionlessApplicationMonitor());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>org.glassfish.tyrus.ext.monitoring.jmx.SessionlessApplicationMonitor</param-value> </context-param>- Author:
- Petr Janouch
- See Also:
ApplicationEventListener
-
-
Field Summary
-
Fields inherited from interface org.glassfish.tyrus.core.monitoring.ApplicationEventListener
APPLICATION_EVENT_LISTENER, NO_OP
-
-
Constructor Summary
Constructors Constructor Description SessionlessApplicationMonitor()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonApplicationDestroyed()voidonApplicationInitialized(java.lang.String applicationName)voidonBinaryMessageReceived(long length)voidonBinaryMessageSent(long length)voidonControlMessageReceived(long length)voidonControlMessageSent(long length)EndpointEventListeneronEndpointRegistered(java.lang.String endpointPath, java.lang.Class<?> endpointClass)voidonEndpointUnregistered(java.lang.String endpointPath)voidonTextMessageReceived(long length)voidonTextMessageSent(long length)
-
-
-
Method Detail
-
onApplicationInitialized
public void onApplicationInitialized(java.lang.String applicationName)
- Specified by:
onApplicationInitializedin interfaceApplicationEventListener
-
onApplicationDestroyed
public void onApplicationDestroyed()
- Specified by:
onApplicationDestroyedin interfaceApplicationEventListener
-
onEndpointRegistered
public EndpointEventListener onEndpointRegistered(java.lang.String endpointPath, java.lang.Class<?> endpointClass)
- Specified by:
onEndpointRegisteredin interfaceApplicationEventListener
-
onEndpointUnregistered
public void onEndpointUnregistered(java.lang.String endpointPath)
- Specified by:
onEndpointUnregisteredin interfaceApplicationEventListener
-
onTextMessageSent
public void onTextMessageSent(long length)
-
onBinaryMessageSent
public void onBinaryMessageSent(long length)
-
onControlMessageSent
public void onControlMessageSent(long length)
-
onTextMessageReceived
public void onTextMessageReceived(long length)
-
onBinaryMessageReceived
public void onBinaryMessageReceived(long length)
-
onControlMessageReceived
public void onControlMessageReceived(long length)
-
-