Class SupplierNodeImpl
java.lang.Object
net.officefloor.compile.impl.structure.SupplierNodeImpl
- All Implemented Interfaces:
Node,SupplierNode,PropertyConfigurable,OfficeSupplier,OfficeFloorSupplier
SupplierNode implementation.- Author:
- Daniel Sagenschneider
-
Field Summary
Fields inherited from interface net.officefloor.compile.internal.structure.SupplierNode
TYPE -
Constructor Summary
ConstructorsConstructorDescriptionSupplierNodeImpl(String supplierName, OfficeNode officeNode, OfficeFloorNode officeFloorNode, NodeContext context) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(String name, String value) Adds aPropertyto configure the item.voidautoWireObjects(AutoWirer<LinkObjectNode> autoWirer, OfficeNode office, CompileContext compileContext) Auto-wires theSupplierThreadLocalNodeinstances that are unlinked.voidbuildSupplier(OfficeBuilder officeBuilder, CompileContext compileContext) Builds theSupplierThreadLocalinstances for theSupplierSource.booleanensureNoThreadLocals(CompileContext compileContext) Ensures there are noSupplierThreadLocalNodeandThreadSynchroniserFactoryinstances.Node[]Obtains the childNodeinstances.Obtains theInternalSupplierinstances.Obtains the location of theNode.<S> SgetManagedObjectSource(String qualifier, String type, Function<SuppliedManagedObjectSourceNode, S> factory) Obtains theOfficeFloorManagedObjectSource/OfficeManagedObjectSource.Obtains the name of theNode.Obtains theNodetype.getOfficeFloorManagedObjectSource(String managedObjectSourceName, String qualifier, String type) Obtains theOfficeFloorManagedObjectSource.Obtains the parentOfficeFloorNode.Obtains the name of thisOfficeFloorSupplier.getOfficeFloorSupplierThreadLocal(String qualifier, String type) Obtains theOfficeFloorSupplierThreadLocal.getOfficeManagedObjectSource(String managedObjectSourceName, String qualifier, String type) Obtains theOfficeManagedObjectSource.Obtains the parentOfficeNode.Obtains the name of thisOfficeSupplier.getOfficeSupplierThreadLocal(String qualifier, String type) Obtains theOfficeSupplierThreadLocal.voidinitialise(String supplierSourceClassName, SupplierSource supplierSource) Initialises theSupplierNode.booleanIndicates if theNodehas been initialised.voidloadAutoWireExtensions(AutoWirer<ManagedObjectExtensionNode> autoWirer, ManagedObjectSourceVisitor managedObjectSourceVisitor, CompileContext compileContext) Loads theSuppliedManagedObjectSourceNodeinstances asManagedObjectExtensionNodeinstances to theAutoWirer.voidloadAutoWireObjects(AutoWirer<LinkObjectNode> autoWirer, ManagedObjectSourceVisitor managedObjectSourceVisitor, CompileContext compileContext) Loads theSuppliedManagedObjectSourceNodeinstances asManagedObjectNodeinstances to theAutoWirer.loadInitialSupplierType(boolean isLoadingType) Loads theInitialSupplierType.loadSupplierType(CompileContext compileContext, boolean isLoadingType, AvailableType[] availableTypes) Loads theSupplierType.voidregisterAsPossibleMBean(CompileContext compileContext) Registers as a possible MBean.booleansourceComplete(CompileContext compileContext) Flags sourcing functionality complete.booleansourceSupplier(CompileContext compileContext) Sources theSupplierThreadLocalinstances.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
-
SupplierNodeImpl
public SupplierNodeImpl(String supplierName, OfficeNode officeNode, OfficeFloorNode officeFloorNode, NodeContext context) Instantiate.- Parameters:
supplierName- Name of theOfficeFloorSupplier.officeNode-OfficeNode.officeFloorNode-OfficeFloorNode.context-NodeContext.
-
-
Method Details
-
getManagedObjectSource
public <S> S getManagedObjectSource(String qualifier, String type, Function<SuppliedManagedObjectSourceNode, S> factory) Obtains theOfficeFloorManagedObjectSource/OfficeManagedObjectSource.- Type Parameters:
S-OfficeFloorManagedObjectSource/OfficeManagedObjectSourcetype.- Parameters:
qualifier- Qualifier. May benull.type- Type.factory- Factory to create theOfficeFloorManagedObjectSource/OfficeManagedObjectSource.- Returns:
OfficeFloorManagedObjectSource/OfficeManagedObjectSource.
-
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.
-
getChildNodes
Description copied from interface:NodeObtains the childNodeinstances.- Specified by:
getChildNodesin interfaceNode- Returns:
- Child
Nodeinstances.
-
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.
-
initialise
Description copied from interface:SupplierNodeInitialises theSupplierNode.- Specified by:
initialisein interfaceSupplierNode- Parameters:
supplierSourceClassName-Classname of theSupplierSource.supplierSource- Optional instantiatedSupplierSource. May benull.
-
getOfficeFloorSupplierName
Description copied from interface:OfficeFloorSupplierObtains the name of thisOfficeFloorSupplier.- Specified by:
getOfficeFloorSupplierNamein interfaceOfficeFloorSupplier- Returns:
- Name of this
OfficeFloorSupplier.
-
addProperty
Description copied from interface:PropertyConfigurableAdds aPropertyto configure the item.- Specified by:
addPropertyin interfacePropertyConfigurable- Parameters:
name- Name ofProperty.value- Value ofProperty.
-
getOfficeFloorSupplierThreadLocal
public OfficeFloorSupplierThreadLocal getOfficeFloorSupplierThreadLocal(String qualifier, String type) Description copied from interface:OfficeFloorSupplierObtains theOfficeFloorSupplierThreadLocal.- Specified by:
getOfficeFloorSupplierThreadLocalin interfaceOfficeFloorSupplier- Parameters:
qualifier- Qualifier of the requiredManagedObject. May benullto match only on type.type- Type of object required for theOfficeFloorSupplierThreadLocal.- Returns:
OfficeFloorSupplierThreadLocal.
-
getOfficeFloorManagedObjectSource
public OfficeFloorManagedObjectSource getOfficeFloorManagedObjectSource(String managedObjectSourceName, String qualifier, String type) Description copied from interface:OfficeFloorSupplierObtains theOfficeFloorManagedObjectSource.- Specified by:
getOfficeFloorManagedObjectSourcein interfaceOfficeFloorSupplier- Parameters:
managedObjectSourceName- Name of theOfficeFloorManagedObjectSource.qualifier- Qualifier on the object type. May benullto match only on type.type- Type of object required from theOfficeFloorSupplier.- Returns:
OfficeFloorManagedObjectSource.
-
getOfficeSupplierName
Description copied from interface:OfficeSupplierObtains the name of thisOfficeSupplier.- Specified by:
getOfficeSupplierNamein interfaceOfficeSupplier- Returns:
- Name of this
OfficeSupplier.
-
getOfficeSupplierThreadLocal
Description copied from interface:OfficeSupplierObtains theOfficeSupplierThreadLocal.- Specified by:
getOfficeSupplierThreadLocalin interfaceOfficeSupplier- Parameters:
qualifier- Qualifier of the requiredManagedObject. May benullto match only on type.type- Type of object required for theOfficeSupplierThreadLocal.- Returns:
OfficeSupplierThreadLocal.
-
getOfficeManagedObjectSource
public OfficeManagedObjectSource getOfficeManagedObjectSource(String managedObjectSourceName, String qualifier, String type) Description copied from interface:OfficeSupplierObtains theOfficeManagedObjectSource.- Specified by:
getOfficeManagedObjectSourcein interfaceOfficeSupplier- Parameters:
managedObjectSourceName- Name of theOfficeManagedObjectSource.qualifier- Qualifier on the object type. May benullto match only on type.type- Type of object required from theOfficeSupplier.- Returns:
OfficeManagedObjectSource.
-
getOfficeNode
Description copied from interface:SupplierNodeObtains the parentOfficeNode.- Specified by:
getOfficeNodein interfaceSupplierNode- Returns:
- Parent
OfficeNodeornullif configured at theOfficeFloorlevel.
-
getOfficeFloorNode
Description copied from interface:SupplierNodeObtains the parentOfficeFloorNode.- Specified by:
getOfficeFloorNodein interfaceSupplierNode- Returns:
- Parent
OfficeFloorNode.
-
loadInitialSupplierType
Description copied from interface:SupplierNodeLoads theInitialSupplierType.- Specified by:
loadInitialSupplierTypein interfaceSupplierNode- Parameters:
isLoadingType- Indicates if using to load type.- Returns:
InitialSupplierType.
-
loadSupplierType
public SupplierType loadSupplierType(CompileContext compileContext, boolean isLoadingType, AvailableType[] availableTypes) Description copied from interface:SupplierNodeLoads theSupplierType.- Specified by:
loadSupplierTypein interfaceSupplierNode- Parameters:
compileContext-CompileContext.isLoadingType- Indicates if using to load type.availableTypes-AvailableTypeinstances.- Returns:
SupplierType.
-
registerAsPossibleMBean
Description copied from interface:SupplierNodeRegisters as a possible MBean.- Specified by:
registerAsPossibleMBeanin interfaceSupplierNode- Parameters:
compileContext-CompileContext.
-
loadAutoWireObjects
public void loadAutoWireObjects(AutoWirer<LinkObjectNode> autoWirer, ManagedObjectSourceVisitor managedObjectSourceVisitor, CompileContext compileContext) Description copied from interface:SupplierNodeLoads theSuppliedManagedObjectSourceNodeinstances asManagedObjectNodeinstances to theAutoWirer.- Specified by:
loadAutoWireObjectsin interfaceSupplierNode- Parameters:
autoWirer-AutoWirer.managedObjectSourceVisitor-ManagedObjectSourceVisitor.compileContext-CompileContext.
-
loadAutoWireExtensions
public void loadAutoWireExtensions(AutoWirer<ManagedObjectExtensionNode> autoWirer, ManagedObjectSourceVisitor managedObjectSourceVisitor, CompileContext compileContext) Description copied from interface:SupplierNodeLoads theSuppliedManagedObjectSourceNodeinstances asManagedObjectExtensionNodeinstances to theAutoWirer.- Specified by:
loadAutoWireExtensionsin interfaceSupplierNode- Parameters:
autoWirer-AutoWirer.managedObjectSourceVisitor-ManagedObjectSourceVisitor.compileContext-CompileContext.
-
sourceSupplier
Description copied from interface:SupplierNodeSources theSupplierThreadLocalinstances.- Specified by:
sourceSupplierin interfaceSupplierNode- Parameters:
compileContext-CompileContext.- Returns:
trueif successfully sourced theSupplierSource.falseif failed to source, with issues reported to theCompilerIssues.
-
sourceComplete
Description copied from interface:SupplierNodeFlags sourcing functionality complete.- Specified by:
sourceCompletein interfaceSupplierNode- Parameters:
compileContext-CompileContext.- Returns:
trueif successfully handle completing sourcing.falseif failed to source, with issues reported to theCompilerIssues.
-
ensureNoThreadLocals
Description copied from interface:SupplierNodeEnsures there are no
SupplierThreadLocalNodeandThreadSynchroniserFactoryinstances.SupplierThreadLocalandThreadSynchroniserFactoryinstances are only applicable within theOffice(application). IfSupplierSourceis used at theOfficeFloor, then it can only supplyManagedObjectSourceinstances and not depend onSupplierThreadLocalnorThreadSynchroniserFactoryinstances.If
SupplierThreadLocalorThreadSynchroniserFactoryinstances then they are raised viaCompilerIssues.- Specified by:
ensureNoThreadLocalsin interfaceSupplierNode- Parameters:
compileContext-CompileContext.- Returns:
trueif noSupplierThreadLocalnorThreadSynchroniserFactoryinstances.
-
autoWireObjects
public void autoWireObjects(AutoWirer<LinkObjectNode> autoWirer, OfficeNode office, CompileContext compileContext) Description copied from interface:SupplierNodeAuto-wires theSupplierThreadLocalNodeinstances that are unlinked.- Specified by:
autoWireObjectsin interfaceSupplierNode- Parameters:
autoWirer-AutoWirer.office-OfficeNoderequiring the auto-wiring.compileContext-CompileContext.
-
buildSupplier
Description copied from interface:SupplierNodeBuilds theSupplierThreadLocalinstances for theSupplierSource.- Specified by:
buildSupplierin interfaceSupplierNode- Parameters:
officeBuilder-OfficeBuilderto build the required thread handling.compileContext-CompileContext.
-
getInternalSuppliers
Description copied from interface:SupplierNodeObtains theInternalSupplierinstances.- Specified by:
getInternalSuppliersin interfaceSupplierNode- Returns:
InternalSupplierinstances.
-