Class Singleton
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,None>
-
- net.officefloor.plugin.managedobject.singleton.Singleton
-
- All Implemented Interfaces:
ExtensionFactory<java.lang.Object>
,ManagedObject
,ManagedObjectSource<None,None>
@PrivateSource public class Singleton extends AbstractManagedObjectSource<None,None> implements ManagedObject, ExtensionFactory<java.lang.Object>
Provides a singleton object.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
-
-
Constructor Summary
Constructors Constructor Description Singleton(java.lang.Object object)
Initiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
createExtension(ManagedObject managedObject)
Creates the specific extension for theManagedObject
.protected ManagedObject
getManagedObject()
Synchronously obtains theManagedObject
.java.lang.Object
getObject()
Obtains the object being managed.static OfficeManagedObject
load(OfficeArchitect architect, java.lang.Object singleton, AutoWire... autoWires)
Convenience method to load singletonObject
.static OfficeManagedObject
load(OfficeArchitect architect, java.lang.String managedObjectName, java.lang.Object singleton, AutoWire... autoWires)
Convenience method to load singletonObject
.static OfficeFloorManagedObject
load(OfficeFloorDeployer deployer, java.lang.Object singleton, DeployedOffice managingOffice, AutoWire... autoWires)
Convenience method to load singletonObject
.static OfficeFloorManagedObject
load(OfficeFloorDeployer deployer, java.lang.String managedObjectName, java.lang.Object singleton, DeployedOffice managingOffice, AutoWire... autoWires)
Convenience method to load singletonObject
.static SectionManagedObject
load(SectionDesigner designer, java.lang.Object singleton)
Convenience method to load singletonObject
.static SectionManagedObject
load(SectionDesigner designer, java.lang.String managedObjectName, java.lang.Object singleton)
Convenience method to load singletonObject
.protected void
loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context)
Overridden to load meta-data.protected void
loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Overridden to load specifications.-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
-
-
-
Method Detail
-
load
public static OfficeFloorManagedObject load(OfficeFloorDeployer deployer, java.lang.Object singleton, DeployedOffice managingOffice, AutoWire... autoWires)
Convenience method to load singletonObject
.- Parameters:
deployer
-OfficeFloorDeployer
.singleton
- SingletonObject
.managingOffice
- ManagingDeployedOffice
.autoWires
- OptionalAutoWire
instances for the singleton.- Returns:
OfficeFloorManagedObject
for the singleton.
-
load
public static OfficeFloorManagedObject load(OfficeFloorDeployer deployer, java.lang.String managedObjectName, java.lang.Object singleton, DeployedOffice managingOffice, AutoWire... autoWires)
Convenience method to load singletonObject
.- Parameters:
deployer
-OfficeFloorDeployer
.managedObjectName
- Name ofOfficeManagedObject
.singleton
- SingletonObject
.managingOffice
- ManagingDeployedOffice
.autoWires
- OptionalAutoWire
instances for the singleton.- Returns:
OfficeFloorManagedObject
for the singleton.
-
load
public static OfficeManagedObject load(OfficeArchitect architect, java.lang.Object singleton, AutoWire... autoWires)
Convenience method to load singletonObject
.- Parameters:
architect
-OfficeArchitect
.singleton
- SingletonObject
.autoWires
- OptionalAutoWire
instances for the singleton.- Returns:
OfficeManagedObject
for the singleton.
-
load
public static OfficeManagedObject load(OfficeArchitect architect, java.lang.String managedObjectName, java.lang.Object singleton, AutoWire... autoWires)
Convenience method to load singletonObject
.- Parameters:
architect
-OfficeArchitect
.managedObjectName
- Name ofOfficeManagedObject
.singleton
- SingletonObject
.autoWires
- OptionalAutoWire
instances for the singleton.- Returns:
OfficeManagedObject
for the singleton.
-
load
public static SectionManagedObject load(SectionDesigner designer, java.lang.Object singleton)
Convenience method to load singletonObject
.- Parameters:
designer
-SectionDesigner
.singleton
- SingletonObject
.- Returns:
SectionManagedObject
.
-
load
public static SectionManagedObject load(SectionDesigner designer, java.lang.String managedObjectName, java.lang.Object singleton)
Convenience method to load singletonObject
.- Parameters:
designer
-SectionDesigner
.managedObjectName
- Name ofSectionManagedObject
.singleton
- SingletonObject
.- Returns:
SectionManagedObject
.
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context) throws java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
getManagedObject
protected ManagedObject getManagedObject()
Description copied from class:AbstractManagedObjectSource
Synchronously obtains theManagedObject
.- Specified by:
getManagedObject
in classAbstractManagedObjectSource<None,None>
- Returns:
ManagedObject
.
-
getObject
public java.lang.Object getObject()
Description copied from interface:ManagedObject
Obtains the object being managed.- Specified by:
getObject
in interfaceManagedObject
- Returns:
- Object being managed.
-
createExtension
public java.lang.Object createExtension(ManagedObject managedObject)
Description copied from interface:ExtensionFactory
Creates the specific extension for theManagedObject
.- Specified by:
createExtension
in interfaceExtensionFactory<java.lang.Object>
- Parameters:
managedObject
-ManagedObject
that is have the extension created for it.- Returns:
- Extension for the
ManagedObject
.
-
-