Class AutoWireStateManagerImpl
- java.lang.Object
-
- net.officefloor.compile.impl.state.autowire.AutoWireStateManagerImpl
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Node,AutoWireStateManager
public class AutoWireStateManagerImpl extends java.lang.Object implements AutoWireStateManager, Node
AutoWireStateManagerimplementation.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description AutoWireStateManagerImpl(Office office, StateManager stateManager, OfficeNode officeNode, AutoWirer<LinkObjectNode> autoWirer, InternalSupplier[] internalSuppliers, MonitorClock monitorClock)Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Node[]getChildNodes()Obtains the childNodeinstances.java.lang.StringgetLocation()Obtains the location of theNode.java.lang.StringgetNodeName()Obtains the name of theNode.java.lang.StringgetNodeType()Obtains theNodetype.<O> OgetObject(java.lang.String qualifier, java.lang.Class<? extends O> objectType, long timeoutInMilliseconds)Obtains the object for theManagedObjectsynchronously.NodegetParentNode()booleanisInitialised()Indicates if theNodehas been initialised.booleanisObjectAvailable(java.lang.String qualifier, java.lang.Class<?> objectType)Indicates if the object by auto-wiring is available.<O> voidload(java.lang.String qualifier, java.lang.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, wait
-
Methods inherited from interface net.officefloor.compile.internal.structure.Node
getQualifiedName, getQualifiedName
-
-
-
-
Constructor Detail
-
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 Detail
-
isObjectAvailable
public boolean isObjectAvailable(java.lang.String qualifier, java.lang.Class<?> objectType)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(java.lang.String qualifier, java.lang.Class<? extends O> objectType, ObjectUser<O> user) throws UnknownObjectExceptionDescription copied from interface:AutoWireStateManagerLoads the object from theManagedObjectasynchronously.- Specified by:
loadin interfaceAutoWireStateManager- 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(java.lang.String qualifier, java.lang.Class<? extends O> objectType, long timeoutInMilliseconds) throws UnknownObjectException, java.lang.ThrowableDescription copied from interface:AutoWireStateManagerObtains the object for theManagedObjectsynchronously.- Specified by:
getObjectin interfaceAutoWireStateManager- 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.java.lang.Throwable- If failure in obtaining the bound object.
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
getNodeName
public java.lang.String getNodeName()
Description copied from interface:NodeObtains the name of theNode.- Specified by:
getNodeNamein interfaceNode- Returns:
- Name of the
Node.
-
getNodeType
public java.lang.String getNodeType()
Description copied from interface:NodeObtains theNodetype.- Specified by:
getNodeTypein interfaceNode- Returns:
Nodetype.
-
getLocation
public java.lang.String 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
public Node 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.
-
-