Class ClassManagedObjectSource
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<Indexed,Indexed>
-
- net.officefloor.plugin.managedobject.clazz.ClassManagedObjectSource
-
- All Implemented Interfaces:
ManagedObjectSourceService<Indexed,Indexed,ClassManagedObjectSource>
,ManagedObjectSourceServiceFactory
,ManagedObjectSource<Indexed,Indexed>
,ServiceFactory<ManagedObjectSourceService<?,?,?>>
public class ClassManagedObjectSource extends AbstractManagedObjectSource<Indexed,Indexed> implements ManagedObjectSourceService<Indexed,Indexed,ClassManagedObjectSource>, ManagedObjectSourceServiceFactory
ManagedObjectSource
that manages anObject
via reflection.- 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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CLASS_NAME_PROPERTY_NAME
Property name providing theClass
name.
-
Constructor Summary
Constructors Constructor Description ClassManagedObjectSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedObjectSourceService<?,?,?>
createService(ServiceContext context)
Creates the service.protected ManagedObject
getManagedObject()
Synchronously obtains theManagedObject
.java.lang.String
getManagedObjectSourceAlias()
Obtains the alias for theManagedObjectSource
Class
.java.lang.Class<ClassManagedObjectSource>
getManagedObjectSourceClass()
Obtains theManagedObjectSource
Class
.protected void
loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<Indexed,Indexed> context)
Overridden to load meta-data.protected void
loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Overridden to load specifications.void
start(ManagedObjectExecuteContext<Indexed> context)
Called once afterManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.-
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, stop
-
-
-
-
Field Detail
-
CLASS_NAME_PROPERTY_NAME
public static final java.lang.String CLASS_NAME_PROPERTY_NAME
Property name providing theClass
name.- See Also:
- Constant Field Values
-
-
Method Detail
-
createService
public ManagedObjectSourceService<?,?,?> createService(ServiceContext context) throws java.lang.Throwable
Description copied from interface:ServiceFactory
Creates the service.- Specified by:
createService
in interfaceServiceFactory<ManagedObjectSourceService<?,?,?>>
- Parameters:
context
-ServiceContext
.- Returns:
- Service.
- Throws:
java.lang.Throwable
- If fails to create the service.
-
getManagedObjectSourceAlias
public java.lang.String getManagedObjectSourceAlias()
Description copied from interface:ManagedObjectSourceService
Obtains the alias for theManagedObjectSource
Class
.- Specified by:
getManagedObjectSourceAlias
in interfaceManagedObjectSourceService<Indexed,Indexed,ClassManagedObjectSource>
- Returns:
- Alias for the
ManagedObjectSource
Class
.
-
getManagedObjectSourceClass
public java.lang.Class<ClassManagedObjectSource> getManagedObjectSourceClass()
Description copied from interface:ManagedObjectSourceService
Obtains theManagedObjectSource
Class
.- Specified by:
getManagedObjectSourceClass
in interfaceManagedObjectSourceService<Indexed,Indexed,ClassManagedObjectSource>
- Returns:
ManagedObjectSource
Class
.
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractAsyncManagedObjectSource<Indexed,Indexed>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<Indexed,Indexed> context) throws java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractAsyncManagedObjectSource<Indexed,Indexed>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
start
public void start(ManagedObjectExecuteContext<Indexed> context) throws java.lang.Exception
Description copied from interface:ManagedObjectSource
Called once after
ManagedObjectSource.init(ManagedObjectSourceContext)
to indicate thisManagedObjectSource
should start execution.On invocation of this method,
ProcessState
instances may be invoked via theManagedObjectExecuteContext
.- Specified by:
start
in interfaceManagedObjectSource<Indexed,Indexed>
- Overrides:
start
in classAbstractAsyncManagedObjectSource<Indexed,Indexed>
- Parameters:
context
-ManagedObjectExecuteContext
to use in starting thisManagedObjectSource
.- Throws:
java.lang.Exception
- Should theManagedObjectSource
fail to start execution.
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSource
Synchronously obtains theManagedObject
.- Specified by:
getManagedObject
in classAbstractManagedObjectSource<Indexed,Indexed>
- Returns:
ManagedObject
.- Throws:
java.lang.Throwable
- If fails to obtain theManagedObject
.
-
-