Package net.officefloor.frame.test
Class TestManagedObject<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>
- java.lang.Object
-
- net.officefloor.frame.test.TestManagedObject<O,F>
-
- All Implemented Interfaces:
AsynchronousManagedObject,ContextAwareManagedObject,CoordinatingManagedObject<O>,ManagedObject
- Direct Known Subclasses:
TestObject
public class TestManagedObject<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>> extends java.lang.Object implements ContextAwareManagedObject, AsynchronousManagedObject, CoordinatingManagedObject<O>, ManagedObject
TestManagedObjectPool.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTestManagedObject.TestManagedObjectSourceTestManagedObjectSource.classTestManagedObject.TestRecycleRecycles theManagedObject.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TestManagedObject(java.lang.String managedObjectName, AbstractOfficeConstructTestCase testCase)Instantiate and setup.TestManagedObject(java.lang.String managedObjectName, AbstractOfficeConstructTestCase testCase, boolean isPool)Instantiate and setup.TestManagedObject(java.lang.String managedObjectName, ConstructTestSupport construct)Instantiate and setup.TestManagedObject(java.lang.String managedObjectName, ConstructTestSupport construct, boolean isPool)Instantiate and setup.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetObject()Obtains the object being managed.voidloadObjects(ObjectRegistry<O> registry)=================== CoordinatingManagedObject ==================voidsetAsynchronousContext(AsynchronousContext listener)================== AsynchronousManagedObject ==================voidsetManagedObjectContext(ManagedObjectContext context)Provides theManagedObjectContextto theManagedObject.
-
-
-
Field Detail
-
managedObjectBuilder
public final ManagedObjectBuilder<F extends java.lang.Enum<F>> managedObjectBuilder
-
managingOfficeBuilder
public final ManagingOfficeBuilder<F extends java.lang.Enum<F>> managingOfficeBuilder
-
isContextAwareManagedObject
public boolean isContextAwareManagedObject
Indicates ifContextAwareManagedObject.
-
isAsynchronousManagedObject
public boolean isAsynchronousManagedObject
Indicates ifAsynchronousManagedObject.
-
isCoordinatingManagedObject
public boolean isCoordinatingManagedObject
Indicates ifCoordinatingManagedObject.
-
enhanceMetaData
public java.util.function.Consumer<AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>> enhanceMetaData
OptionalConsumerto enhance theManagedObjectSourceMetaData.
-
sourcePropagateFailure
public java.lang.RuntimeException sourcePropagateFailure
Possible propagation failure in sourcing theManagedObject.
-
isDelaySource
public boolean isDelaySource
Indicates whether to delay sourcing theManagedObject.
-
sourceFailure
public java.lang.Throwable sourceFailure
Possible failure in sourcing theManagedObject.
-
contextAwareFailure
public java.lang.RuntimeException contextAwareFailure
Possible failure in loading theManagedObjectContext.
-
registerAsynchronousListenerFailure
public java.lang.RuntimeException registerAsynchronousListenerFailure
Possible failure in registering theAsynchronousContext.
-
loadObjectsFailure
public java.lang.RuntimeException loadObjectsFailure
Possible failure in loading theObjectRegistry.
-
isRecycleFunction
public boolean isRecycleFunction
Indicates whether to provide a recycleManagedFunction.
-
isRecycle
public boolean isRecycle
Flags whether to recycle theManagedObject.
-
recycleConsumer
public java.util.function.Consumer<RecycleManagedObjectParameter<?>> recycleConsumer
Consumerto be provided theRecycleManagedObjectParameteron recycling.
-
recycleFailure
public java.lang.Throwable recycleFailure
Possible failure in recycling theManagedObject.
-
managedObjectExecuteContext
public ManagedObjectExecuteContext<F extends java.lang.Enum<F>> managedObjectExecuteContext
-
managedObjectServiceContext
public ManagedObjectServiceContext<F extends java.lang.Enum<F>> managedObjectServiceContext
-
managedObjectUser
public volatile ManagedObjectUser managedObjectUser
-
managedObjectContext
public ManagedObjectContext managedObjectContext
-
asynchronousContext
public AsynchronousContext asynchronousContext
-
objectRegistry
public ObjectRegistry<O extends java.lang.Enum<O>> objectRegistry
-
recycledManagedObject
public ManagedObject recycledManagedObject
ManagedObjectprovided to the recycleManagedFunction.
-
pooledSourcedManagedObject
public ManagedObject pooledSourcedManagedObject
SourcedManagedObjectviaManagedObjectPool.
-
pooledSourceFailure
public java.lang.Throwable pooledSourceFailure
Failure in sourcingManagedObjectviaManagedObjectPool.
-
pooledReturnedManagedObject
public ManagedObject pooledReturnedManagedObject
ReturnedManagedObjectto theManagedObjectPool.
-
pooledLostManagedObject
public ManagedObject pooledLostManagedObject
LostManagedObjectto theManagedObjectPool.
-
pooledLostCause
public java.lang.Throwable pooledLostCause
Lost cause ofManagedObjectfor theManagedObjectPool.
-
poolEmptied
public boolean poolEmptied
Indicates if theManagedObjectPoolhas been emptied.
-
-
Constructor Detail
-
TestManagedObject
public TestManagedObject(java.lang.String managedObjectName, AbstractOfficeConstructTestCase testCase)Instantiate and setup.- Parameters:
managedObjectName- Name of theManagedObject.testCase-AbstractOfficeConstructTestCase.
-
TestManagedObject
public TestManagedObject(java.lang.String managedObjectName, AbstractOfficeConstructTestCase testCase, boolean isPool)Instantiate and setup.- Parameters:
managedObjectName- Name for theManagedObject.testCase-AbstractOfficeConstructTestCase.isPool- Indicates if pool theManagedObject.
-
TestManagedObject
public TestManagedObject(java.lang.String managedObjectName, ConstructTestSupport construct)Instantiate and setup.- Parameters:
managedObjectName- Name of theManagedObject.construct-ConstructTestSupport.
-
TestManagedObject
public TestManagedObject(java.lang.String managedObjectName, ConstructTestSupport construct, boolean isPool)Instantiate and setup.- Parameters:
managedObjectName- Name for theManagedObject.construct-ConstructTestSupport.isPool- Indicates if pool theManagedObject.
-
-
Method Detail
-
setManagedObjectContext
public void setManagedObjectContext(ManagedObjectContext context)
Description copied from interface:ContextAwareManagedObjectProvides theManagedObjectContextto theManagedObject.- Specified by:
setManagedObjectContextin interfaceContextAwareManagedObject- Parameters:
context-ManagedObjectContext.
-
setAsynchronousContext
public void setAsynchronousContext(AsynchronousContext listener)
================== AsynchronousManagedObject ==================- Specified by:
setAsynchronousContextin interfaceAsynchronousManagedObject- Parameters:
listener-AsynchronousContext.
-
loadObjects
public void loadObjects(ObjectRegistry<O> registry) throws java.lang.Throwable
=================== CoordinatingManagedObject ==================- Specified by:
loadObjectsin interfaceCoordinatingManagedObject<O extends java.lang.Enum<O>>- Parameters:
registry- Registry of the Objects for theManagedObjectinstances.- Throws:
java.lang.Throwable- Should thisCoordinatingManagedObjectfail to load theManagedObject.
-
getObject
public java.lang.Object getObject() throws java.lang.ThrowableDescription copied from interface:ManagedObjectObtains the object being managed.- Specified by:
getObjectin interfaceManagedObject- Returns:
- Object being managed.
- Throws:
java.lang.Throwable- Indicating failed to obtain the object for use.
-
-