Class ObjectUserImpl<O>
- java.lang.Object
-
- net.officefloor.frame.impl.execute.office.ObjectUserImpl<O>
-
- All Implemented Interfaces:
ObjectUser<O>
public class ObjectUserImpl<O> extends java.lang.Object implements ObjectUser<O>
ObjectUserimplementation.- 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 OgetObject(long timeoutInMilliseconds)Obtains the object.voiduse(O object, java.lang.Throwable failure)Provides the object for using.
-
-
-
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:ObjectUserProvides the object for using.- Specified by:
usein interfaceObjectUser<O>- Parameters:
object- Object for use.failure-Throwableif fails to load theObject.
-
-