Class SessionAwareApplicationMonitor

  • All Implemented Interfaces:
    org.glassfish.tyrus.core.monitoring.ApplicationEventListener

    public final class SessionAwareApplicationMonitor
    extends java.lang.Object
    Application events listener and statistics collector. The statistics are collected by aggregating statistics from application endpoints and endpoint sessions. The only difference form 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>
    Author:
    Petr Janouch
    See Also:
    ApplicationEventListener
    • Constructor Detail

      • SessionAwareApplicationMonitor

        public SessionAwareApplicationMonitor()
        Constructor.
    • Method Detail

      • onApplicationInitialized

        public void onApplicationInitialized​(java.lang.String applicationName)
        Specified by:
        onApplicationInitialized in interface org.glassfish.tyrus.core.monitoring.ApplicationEventListener
      • onApplicationDestroyed

        public void onApplicationDestroyed()
        Specified by:
        onApplicationDestroyed in interface org.glassfish.tyrus.core.monitoring.ApplicationEventListener
      • onEndpointRegistered

        public org.glassfish.tyrus.core.monitoring.EndpointEventListener onEndpointRegistered​(java.lang.String endpointPath,
                                                                                              java.lang.Class<?> endpointClass)
        Specified by:
        onEndpointRegistered in interface org.glassfish.tyrus.core.monitoring.ApplicationEventListener
      • onEndpointUnregistered

        public void onEndpointUnregistered​(java.lang.String endpointPath)
        Specified by:
        onEndpointUnregistered in interface org.glassfish.tyrus.core.monitoring.ApplicationEventListener
      • 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)