Class ObjectUserImpl<O>

  • All Implemented Interfaces:
    ObjectUser<O>

    public class ObjectUserImpl<O>
    extends java.lang.Object
    implements ObjectUser<O>
    ObjectUser implementation.
    Author:
    Daniel Sagenschneider
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectUserImpl​(java.lang.String boundObjectName, MonitorClock monitorClock)
      Instantiate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      O getObject​(long timeoutInMilliseconds)
      Obtains the object.
      void use​(O object, java.lang.Throwable failure)
      Provides the object for using.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectUserImpl

        public ObjectUserImpl​(java.lang.String boundObjectName,
                              MonitorClock monitorClock)
        Instantiate.
        Parameters:
        boundObjectName - Bound object name.
        monitorClock - MonitorClock.
    • Method Detail

      • getObject

        public O getObject​(long timeoutInMilliseconds)
                    throws java.lang.Throwable
        Obtains the object. This method will block until the object is available, a failure or time out waiting.
        Parameters:
        timeoutInMilliseconds - Time out in milliseconds to block waiting for object to become available.
        Returns:
        Object.
        Throws:
        java.lang.Throwable - If fails to obtain the object.
      • use

        public void use​(O object,
                        java.lang.Throwable failure)
        Description copied from interface: ObjectUser
        Provides the object for using.
        Specified by:
        use in interface ObjectUser<O>
        Parameters:
        object - Object for use.
        failure - Throwable if fails to load the Object.