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 class
TestManagedObject.TestManagedObjectSource
TestManagedObjectSource
.class
TestManagedObject.TestRecycle
Recycles 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.Object
getObject()
Obtains the object being managed.void
loadObjects(ObjectRegistry<O> registry)
=================== CoordinatingManagedObject ==================void
setAsynchronousContext(AsynchronousContext listener)
================== AsynchronousManagedObject ==================void
setManagedObjectContext(ManagedObjectContext context)
Provides theManagedObjectContext
to 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
OptionalConsumer
to 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
Consumer
to be provided theRecycleManagedObjectParameter
on 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
ManagedObject
provided to the recycleManagedFunction
.
-
pooledSourcedManagedObject
public ManagedObject pooledSourcedManagedObject
SourcedManagedObject
viaManagedObjectPool
.
-
pooledSourceFailure
public java.lang.Throwable pooledSourceFailure
Failure in sourcingManagedObject
viaManagedObjectPool
.
-
pooledReturnedManagedObject
public ManagedObject pooledReturnedManagedObject
ReturnedManagedObject
to theManagedObjectPool
.
-
pooledLostManagedObject
public ManagedObject pooledLostManagedObject
LostManagedObject
to theManagedObjectPool
.
-
pooledLostCause
public java.lang.Throwable pooledLostCause
Lost cause ofManagedObject
for theManagedObjectPool
.
-
poolEmptied
public boolean poolEmptied
Indicates if theManagedObjectPool
has 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:ContextAwareManagedObject
Provides theManagedObjectContext
to theManagedObject
.- Specified by:
setManagedObjectContext
in interfaceContextAwareManagedObject
- Parameters:
context
-ManagedObjectContext
.
-
setAsynchronousContext
public void setAsynchronousContext(AsynchronousContext listener)
================== AsynchronousManagedObject ==================- Specified by:
setAsynchronousContext
in interfaceAsynchronousManagedObject
- Parameters:
listener
-AsynchronousContext
.
-
loadObjects
public void loadObjects(ObjectRegistry<O> registry) throws java.lang.Throwable
=================== CoordinatingManagedObject ==================- Specified by:
loadObjects
in interfaceCoordinatingManagedObject<O extends java.lang.Enum<O>>
- Parameters:
registry
- Registry of the Objects for theManagedObject
instances.- Throws:
java.lang.Throwable
- Should thisCoordinatingManagedObject
fail to load theManagedObject
.
-
getObject
public java.lang.Object getObject() throws java.lang.Throwable
Description copied from interface:ManagedObject
Obtains the object being managed.- Specified by:
getObject
in interfaceManagedObject
- Returns:
- Object being managed.
- Throws:
java.lang.Throwable
- Indicating failed to obtain the object for use.
-
-