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>
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.
-
-
-
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 interfaceObjectUser<O>
- Parameters:
object
- Object for use.failure
-Throwable
if fails to load theObject
.
-
-