public final class SessionAwareApplicationMonitor extends Object
SessionlessApplicationMonitor
is that
SessionlessApplicationMonitor
does 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, endpoint and session level.
For monitoring in Grizzly server an instance should be passed to the server in server properties.
serverProperties.put(ApplicationEventListener.APPLICATION_EVENT_LISTENER, new SessionAwareApplicationMonitor());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.SessionAwareApplicationMonitor</param-value>
</context-param>
ApplicationEventListener
APPLICATION_EVENT_LISTENER, NO_OP
Constructor and Description |
---|
SessionAwareApplicationMonitor()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
onApplicationDestroyed()
Called when the application has been destroyed.
|
void |
onApplicationInitialized(String applicationName)
Called when the application has been initialized.
|
void |
onBinaryMessageReceived(long length) |
void |
onBinaryMessageSent(long length) |
void |
onControlMessageReceived(long length) |
void |
onControlMessageSent(long length) |
EndpointEventListener |
onEndpointRegistered(String endpointPath,
Class<?> endpointClass)
Called when an endpoint has been registered.
|
void |
onEndpointUnregistered(String endpointPath)
Called when an endpoint has been unregistered.
|
void |
onTextMessageReceived(long length) |
void |
onTextMessageSent(long length) |
public SessionAwareApplicationMonitor()
public void onApplicationInitialized(String applicationName)
ApplicationEventListener
onApplicationInitialized
in interface ApplicationEventListener
applicationName
- name of the initialized application.public void onApplicationDestroyed()
ApplicationEventListener
onApplicationDestroyed
in interface ApplicationEventListener
public EndpointEventListener onEndpointRegistered(String endpointPath, Class<?> endpointClass)
ApplicationEventListener
onEndpointRegistered
in interface ApplicationEventListener
endpointPath
- the path the endpoint has been registered on.endpointClass
- class of the registered endpoint.public void onEndpointUnregistered(String endpointPath)
ApplicationEventListener
onEndpointUnregistered
in interface ApplicationEventListener
endpointPath
- the path the endpoint has been registered on.public void onTextMessageSent(long length)
public void onBinaryMessageSent(long length)
public void onControlMessageSent(long length)
public void onTextMessageReceived(long length)
public void onBinaryMessageReceived(long length)
public void onControlMessageReceived(long length)
Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.