Class ReadyState

java.lang.Object
com.sun.jini.thread.ReadyState

public class ReadyState extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks if the service is ready to use, waiting if it is initializing, and throwing NoSuchObjectException if it is shutting down.
    boolean
     
    void
    Marks the service ready for use.
    void
    Marks the service as shutting down, waiting if it is initializing, and throwing NoSuchObjectException if it is already shutting down.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 throwing NoSuchObjectException if it is shutting down. Note that the NoSuchObjectException will be wrapped in a RemoteExceptionWrapper.
    • 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 throwing NoSuchObjectException if it is already shutting down. Note that the NoSuchObjectException will be wrapped in a RemoteExceptionWrapper.