|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tinkerpop.rexster.ShutdownManager
public class ShutdownManager
Manages the socket listening for incoming shutdown requests.
Adapted from http://code.google.com/p/shutdown-listener/
Nested Class Summary | |
---|---|
static interface |
ShutdownManager.ShutdownListener
|
Field Summary | |
---|---|
static String |
COMMAND_SHUTDOWN_NO_WAIT
|
static String |
COMMAND_SHUTDOWN_WAIT
|
static String |
COMMAND_STATUS
|
protected Collection<ShutdownManager.ShutdownListener> |
internalShutdownListeners
|
protected org.apache.log4j.Logger |
logger
|
protected Collection<ShutdownManager.ShutdownListener> |
shutdownListeners
|
Constructor Summary | |
---|---|
ShutdownManager(String host,
int port)
|
Method Summary | |
---|---|
protected void |
postShutdownListeners()
Called after the shutdown listeners, before threads waiting on waitForShutdown() are released |
protected void |
preShutdownListeners()
Called before the shutdown listeners |
void |
registerShutdownListener(ShutdownManager.ShutdownListener shutdownListener)
|
protected void |
runShutdownHandlers(Collection<ShutdownManager.ShutdownListener> shutdownListeners)
|
void |
shutdown()
Calls shutdown hooks and cleans up shutdown listener code, notifies all waiting threads on completion |
protected void |
sortShutdownListeners(List<ShutdownManager.ShutdownListener> shutdownListeners)
Sort a List of ShutdownManager.ShutdownSocketListener before runShutdownHandlers(Collection) iterates over them. |
void |
start()
|
void |
waitForShutdown()
If shutdown isn't complete will wait on the shutdown lock for shutdown to complete. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.log4j.Logger logger
protected final Collection<ShutdownManager.ShutdownListener> internalShutdownListeners
protected Collection<ShutdownManager.ShutdownListener> shutdownListeners
public static final String COMMAND_SHUTDOWN_WAIT
public static final String COMMAND_SHUTDOWN_NO_WAIT
public static final String COMMAND_STATUS
Constructor Detail |
---|
public ShutdownManager(String host, int port)
Method Detail |
---|
public void registerShutdownListener(ShutdownManager.ShutdownListener shutdownListener)
public final void start() throws Exception
Exception
public final void waitForShutdown()
public final void shutdown()
protected void preShutdownListeners()
protected void postShutdownListeners()
waitForShutdown()
are released
protected void sortShutdownListeners(List<ShutdownManager.ShutdownListener> shutdownListeners)
List
of ShutdownManager.ShutdownSocketListener
before runShutdownHandlers(Collection)
iterates over them.
Default implementation does nothing
protected final void runShutdownHandlers(Collection<ShutdownManager.ShutdownListener> shutdownListeners)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |