org.glassfish.jersey.server.internal.monitoring
Class MonitoringContainerListener

java.lang.Object
  extended by org.glassfish.jersey.server.internal.monitoring.MonitoringContainerListener
All Implemented Interfaces:
ContainerLifecycleListener

public class MonitoringContainerListener
extends Object
implements ContainerLifecycleListener

Container listener that listens to container events and trigger the application events and call them on supplied RequestEventListener.

This listener must be registered as a standard provider in Jersey runtime.

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)

Nested Class Summary
static class MonitoringContainerListener.Binder
          A binder that binds the MonitoringContainerListener.
 
Constructor Summary
MonitoringContainerListener()
           
 
Method Summary
 void init(ApplicationEventListener listener, ApplicationEvent initFinishedEvent)
          Initializes the instance with listener that must be called and initialization event.
 void onReload(Container container)
          Invoked when the container has been reloaded.
 void onShutdown(Container container)
          Invoke at the container shut-down.
 void onStartup(Container container)
          Invoked at the container start-up.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonitoringContainerListener

public MonitoringContainerListener()
Method Detail

init

public void init(ApplicationEventListener listener,
                 ApplicationEvent initFinishedEvent)
Initializes the instance with listener that must be called and initialization event. If this method is not called then events cannot not be triggered which might be needed when no ApplicationEventListener is registered in Jersey runtime.

Parameters:
listener - Listener that should be called.
initFinishedEvent - Event of type ApplicationEvent.Type#INITIALIZATION_START.

onStartup

public void onStartup(Container container)
Description copied from interface: ContainerLifecycleListener
Invoked at the container start-up. This method is invoked even when application is reloaded and new instance of application has started.

Specified by:
onStartup in interface ContainerLifecycleListener
Parameters:
container - container that has been started.

onReload

public void onReload(Container container)
Description copied from interface: ContainerLifecycleListener
Invoked when the container has been reloaded.

Specified by:
onReload in interface ContainerLifecycleListener
Parameters:
container - container that has been reloaded.

onShutdown

public void onShutdown(Container container)
Description copied from interface: ContainerLifecycleListener
Invoke at the container shut-down. This method is invoked even before the application is being stopped as a part of reload.

Specified by:
onShutdown in interface ContainerLifecycleListener
Parameters:
container - container that has been shut down.


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.