org.apache.tomcat.maven.common.run
Class EmbeddedRegistry

java.lang.Object
  extended by org.apache.tomcat.maven.common.run.EmbeddedRegistry

public final class EmbeddedRegistry
extends Object

Registry which collects all embedded Tomcat Servers so that they will be shutdown through a shutdown hook when the JVM terminates or you can ask the registry to shutdown all started servers.

Since:
1.1
Author:
Mark Michaelis

Method Summary
static EmbeddedRegistry getInstance()
          Retrieve the lazily initialized instance of the registry.
 boolean register(Object container)
          Adds the given container to the registry which automatically registers it for the shutdown hook.
 void shutdownAll(Log log)
          Shuts down all registered embedded tomcats.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static EmbeddedRegistry getInstance()
Retrieve the lazily initialized instance of the registry.

Returns:
singleton instance of the registry

register

public boolean register(Object container)
Adds the given container to the registry which automatically registers it for the shutdown hook.

Parameters:
container - the container to register
Returns:
true if it got added; false if not

shutdownAll

public void shutdownAll(Log log)
                 throws Exception
Shuts down all registered embedded tomcats. All tomcats which successfully shut down will be removed from the registry.

Parameters:
log - the log to write possible shutdown exceptions to
Throws:
Exception - the first exception which occurred will be rethrown


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.