Package com.sun.jini.thread
Class ReadyState
java.lang.Object
com.sun.jini.thread.ReadyState
Utility class used to prevent access to a service before it has completed its initialization or
after it starts to shutdown. Each public entry point to the service should call
check or shutdown, and initialization should call ready
when the service is ready to use.- Since:
- 2.1
- Author:
- Sun Microsystems, Inc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck()Checks if the service is ready to use, waiting if it is initializing, and throwingNoSuchObjectExceptionif it is shutting down.booleanisReady()voidready()Marks the service ready for use.voidshutdown()Marks the service as shutting down, waiting if it is initializing, and throwingNoSuchObjectExceptionif it is already shutting down.
-
Constructor Details
-
ReadyState
public ReadyState()
-
-
Method Details
-
isReady
public boolean isReady() -
check
public void check()Checks if the service is ready to use, waiting if it is initializing, and throwingNoSuchObjectExceptionif it is shutting down. Note that theNoSuchObjectExceptionwill be wrapped in aRemoteExceptionWrapper. -
ready
public void ready()Marks the service ready for use. This method should only be called from the code that performs the service initialization, and it should only be called once. -
shutdown
public void shutdown()Marks the service as shutting down, waiting if it is initializing, and throwingNoSuchObjectExceptionif it is already shutting down. Note that theNoSuchObjectExceptionwill be wrapped in aRemoteExceptionWrapper.
-