Class AutoWireStateManagerImpl
java.lang.Object
net.officefloor.compile.impl.state.autowire.AutoWireStateManagerImpl
- All Implemented Interfaces:
AutoCloseable,Node,AutoWireStateManager
AutoWireStateManager implementation.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionAutoWireStateManagerImpl(Office office, StateManager stateManager, OfficeNode officeNode, AutoWirer<LinkObjectNode> autoWirer, InternalSupplier[] internalSuppliers, MonitorClock monitorClock) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Node[]Obtains the childNodeinstances.Obtains the location of theNode.Obtains the name of theNode.Obtains theNodetype.<O> OObtains the object for theManagedObjectsynchronously.booleanIndicates if theNodehas been initialised.booleanisObjectAvailable(String qualifier, Class<?> objectType) Indicates if the object by auto-wiring is available.<O> voidload(String qualifier, Class<? extends O> objectType, ObjectUser<O> user) Loads the object from theManagedObjectasynchronously.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.compile.internal.structure.Node
getQualifiedName, getQualifiedName
-
Constructor Details
-
AutoWireStateManagerImpl
public AutoWireStateManagerImpl(Office office, StateManager stateManager, OfficeNode officeNode, AutoWirer<LinkObjectNode> autoWirer, InternalSupplier[] internalSuppliers, MonitorClock monitorClock) Instantiate.- Parameters:
office-Office.stateManager-StateManager.officeNode-OfficeNode.autoWirer-AutoWirer.internalSuppliers-InternalSupplierinstances.monitorClock-MonitorClock.
-
-
Method Details
-
isObjectAvailable
Description copied from interface:AutoWireStateManagerIndicates if the object by auto-wiring is available.- Specified by:
isObjectAvailablein interfaceAutoWireStateManager- Parameters:
qualifier- Qualifier. May benull.objectType- Required object type.- Returns:
trueif the object is available.
-
load
public <O> void load(String qualifier, Class<? extends O> objectType, ObjectUser<O> user) throws UnknownObjectException Description copied from interface:AutoWireStateManagerLoads the object from theManagedObjectasynchronously.- Specified by:
loadin interfaceAutoWireStateManager- Type Parameters:
O- Object type.- Parameters:
qualifier- Qualifier. May benull.objectType- Required object type.user-ObjectUserto receive the loaded object (or possible failure).- Throws:
UnknownObjectException- If unknown bound object name.
-
getObject
public <O> O getObject(String qualifier, Class<? extends O> objectType, long timeoutInMilliseconds) throws UnknownObjectException, Throwable Description copied from interface:AutoWireStateManagerObtains the object for theManagedObjectsynchronously.- Specified by:
getObjectin interfaceAutoWireStateManager- Type Parameters:
O- Object type.- Parameters:
qualifier- Qualifier. May benull.objectType- Required object type.timeoutInMilliseconds- Time out in milliseconds to wait for theManagedObjectcreation.- Returns:
- Object.
- Throws:
UnknownObjectException- If unknown bound object name.Throwable- If failure in obtaining the bound object.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getNodeName
Description copied from interface:NodeObtains the name of theNode.- Specified by:
getNodeNamein interfaceNode- Returns:
- Name of the
Node.
-
getNodeType
Description copied from interface:NodeObtains theNodetype.- Specified by:
getNodeTypein interfaceNode- Returns:
Nodetype.
-
getLocation
Description copied from interface:NodeObtains the location of theNode.- Specified by:
getLocationin interfaceNode- Returns:
- Location of the
Node. May benullifNodedoes not support a location.
-
getParentNode
Description copied from interface:Node- Specified by:
getParentNodein interfaceNode- Returns:
Nodecontaining thisNode.
-
isInitialised
public boolean isInitialised()Description copied from interface:NodeIndicates if theNodehas been initialised.Nodeinstances should only be initialised once. Initialising theNodetwice is an issue.- Specified by:
isInitialisedin interfaceNode- Returns:
trueif initialised.
-
getChildNodes
Description copied from interface:NodeObtains the childNodeinstances.- Specified by:
getChildNodesin interfaceNode- Returns:
- Child
Nodeinstances.
-