public class AutoWireOfficeSource extends AbstractOfficeSource
OfficeSource
implementation that auto-wires the configuration based
on type.AbstractOfficeSource.SpecificationContext
Constructor and Description |
---|
AutoWireOfficeSource()
Default constructor.
|
AutoWireOfficeSource(OfficeFloorCompiler compiler)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
addAvailableOfficeObject(AutoWire autoWire,
Class<?>... extensionInterfaces)
Adds that the
OfficeObject has the ability to be used with the
specified extension interfaces. |
void |
addAvailableOfficeTeam(AutoWire autoWire)
Adds an available
OfficeTeam for executing Task instances
that has an object dependency of the input type. |
AutoWireGovernance |
addGovernance(String governanceName,
String governanceSourceClassName)
Adds
Governance to this Office . |
<S extends SectionSource> |
addSection(String sectionName,
String sectionSourceClassName,
String sectionLocation)
Adds an
OfficeSection allowing to override the
AutoWireSection . |
<S extends SectionSource,A extends AutoWireSection> |
addSection(String sectionName,
String sectionSourceClassName,
String sectionLocation,
AutoWireSectionFactory<A> sectionFactory)
Adds an
OfficeSection . |
void |
addSectionTransformer(AutoWireSectionTransformer transformer)
Adds a
AutoWireSectionTransformer to enable transforming all
AutoWireSection instances before configuring them for compiling. |
void |
addStartupFlow(AutoWireSection section,
String inputName)
Adds a flow to be triggered on start-up.
|
AutoWireSection |
getSection(String sectionName)
Obtains the
AutoWireSection by its name. |
boolean |
isLinked(AutoWireSection section,
String sectionOutputName)
Determines if the
AutoWireSection output is configured for
linking. |
void |
link(AutoWireSection sourceSection,
String sourceOutputName,
AutoWireSection targetSection,
String targetInputName)
Links the source
SectionOutput to a target SectionInput . |
void |
linkEscalation(Class<? extends Throwable> escalationType,
AutoWireSection section,
String sectionInputName)
Links the handling of the
Escalation to the
AutoWireSection . |
protected void |
loadSpecification(AbstractOfficeSource.SpecificationContext context)
Loads the
OfficeSourceSpecification . |
void |
sourceOffice(OfficeArchitect architect,
OfficeSourceContext context)
Sources the
OfficeType by constructing it via the input
OfficeArchitect . |
getSpecification
public AutoWireOfficeSource(OfficeFloorCompiler compiler)
compiler
- OfficeFloorCompiler
.public AutoWireOfficeSource()
public <S extends SectionSource,A extends AutoWireSection> A addSection(String sectionName, String sectionSourceClassName, String sectionLocation, AutoWireSectionFactory<A> sectionFactory)
OfficeSection
.S
- SectionSource
type.A
- AutoWireSection
type.sectionName
- Name of the OfficeSection
.sectionSourceClassName
- SectionSource
class name.sectionLocation
- OfficeSection
location.sectionFactory
- AutoWireSectionFactory
.AutoWireSection
to configure properties and link flows.public <S extends SectionSource> AutoWireSection addSection(String sectionName, String sectionSourceClassName, String sectionLocation)
OfficeSection
allowing to override the
AutoWireSection
.S
- SectionSource
type.sectionName
- Name of the OfficeSection
.sectionSourceClassName
- SectionSource
class name.sectionLocation
- OfficeSection
location.AutoWireSection
to configure properties and link flows.public AutoWireSection getSection(String sectionName)
AutoWireSection
by its name.sectionName
- Name of the AutoWireSection
.AutoWireSection
or null
if no
AutoWireSection
by the name.public void addSectionTransformer(AutoWireSectionTransformer transformer)
AutoWireSectionTransformer
to enable transforming all
AutoWireSection
instances before configuring them for compiling.transformer
- AutoWireSectionTransformer
.public void link(AutoWireSection sourceSection, String sourceOutputName, AutoWireSection targetSection, String targetInputName)
SectionOutput
to a target SectionInput
.sourceSection
- Source section.sourceOutputName
- Name of the source SectionOutput
.targetSection
- Target section.targetInputName
- Name of the target SectionInput
.public boolean isLinked(AutoWireSection section, String sectionOutputName)
Determines if the AutoWireSection
output is configured for
linking.
This aids configuration by allowing to know if SectionOutput
flows have been configured (linked).
section
- AutoWireSection
.sectionOutputName
- SectionOutput
name.true
if configured for linking, otherwise
false
.public void linkEscalation(Class<? extends Throwable> escalationType, AutoWireSection section, String sectionInputName)
Escalation
to the
AutoWireSection
.escalationType
- TYpe of Escalation
.section
- AutoWireSection
.sectionInputName
- Name of the OfficeSectionInput
.public void addStartupFlow(AutoWireSection section, String inputName)
section
- AutoWireSection
.inputName
- Name of the AutoWireSection
input to trigger on
start-up.public AutoWireGovernance addGovernance(String governanceName, String governanceSourceClassName)
Adds Governance
to this Office
.
The Governance
is auto-wired to ManagedObject
instances
with the matching extension interface.
governanceName
- Name of the Governance
.governanceSourceClassName
- Class
name of the GovernanceSource
. May be an
alias.AutoWireGovernance
.ManagedObjectSourceMetaData.getExtensionInterfacesMetaData()
public void addAvailableOfficeObject(AutoWire autoWire, Class<?>... extensionInterfaces)
Adds that the OfficeObject
has the ability to be used with the
specified extension interfaces.
This aids both auto-wiring use and Governance
for the
OfficeObject
.
autoWire
- OfficeObject
AutoWire
.extensionInterfaces
- Extension interfaces available for the OfficeObject
.public void addAvailableOfficeTeam(AutoWire autoWire)
OfficeTeam
for executing Task
instances
that has an object dependency of the input type.protected void loadSpecification(AbstractOfficeSource.SpecificationContext context)
AbstractOfficeSource
OfficeSourceSpecification
.loadSpecification
in class AbstractOfficeSource
context
- AbstractOfficeSource.SpecificationContext
.public void sourceOffice(OfficeArchitect architect, OfficeSourceContext context) throws Exception
OfficeSource
OfficeType
by constructing it via the input
OfficeArchitect
.architect
- OfficeArchitect
to structure the Office
.context
- OfficeSourceContext
to source details to structure the
Office
.Exception
- If fails to construct the Office
.Copyright © 2005–2016. All rights reserved.