com.sun.slamd.client
Class ClientShutdownHook

java.lang.Object
  extended by java.lang.Thread
      extended by com.sun.slamd.client.ClientShutdownHook
All Implemented Interfaces:
java.lang.Runnable

public class ClientShutdownHook
extends java.lang.Thread

This class defines a shutdown hook that will be registered with the SLAMD client once it has been successfully created. This shutdown hook will be invoked whenever the client is shutting down in an attempt to notify the server of the shutdown and close the connection gracefully. Note that the use of shutdown hooks requires a Java version of at least 1.3.

Author:
Neil A. Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientShutdownHook(Client client)
          Creates a client shutdown hook that is associated with the provided SLAMD client.
 
Method Summary
 void run()
          Sends a status response message to the server that indicates the SLAMD client is shutting down.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientShutdownHook

public ClientShutdownHook(Client client)
Creates a client shutdown hook that is associated with the provided SLAMD client.

Parameters:
client - The SLAMD client with which this shutdown hook is associated.
Method Detail

run

public void run()
Sends a status response message to the server that indicates the SLAMD client is shutting down. If an instance of this class is registered as a shutdown hook for the client, then this method will be invoked as part of the shutdown process, in which case it will attempt to notify the server of the shutdown and close the connection.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread