|
Apache Tuscany SCA Kernel Sub-Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tuscany.spi.model.ModelObject
org.apache.tuscany.spi.model.ComponentDefinition<I>
public class ComponentDefinition<I extends Implementation<?>>
Represents a component.
A component is a configured instance of an implementation. The services provided and consumed and the available configuration properties are defined by the implementation (represented by its componentType).
Every component has a name which uniquely identifies it within the scope of the composite that contains it; the name must be different from the names of all other components, services and references immediately contained in the composite (directly or through an <include> element).
A component may define a PropertyValue
that overrides the default value of a Property
defined in the componentType.
It may also define a ReferenceTarget
for a ReferenceDefinition
defined in the componentType.
The ReferenceTarget must resolve to another component or a reference in the enclosing composite.
Components may specify an initialization level that will determine the order in which it will be eagerly initialized relative to other components from the enclosing composite that are in the same scope. This can be used to define a startup sequence for components that are otherwise independent. Any initialization required to resolve references between components will override this initialization order.
Constructor Summary | |
---|---|
ComponentDefinition(I implementation)
Constructor specifying the implementation of this component. |
|
ComponentDefinition(String name,
I implementation)
Constructor specifying the component's name and implementation. |
Method Summary | |
---|---|
void |
add(PropertyValue<?> value)
Add a property value configuration to this component. |
void |
add(ReferenceTarget target)
Add a reference target configuration to this component. |
I |
getImplementation()
Returns the Implementation of this component. |
Integer |
getInitLevel()
Returns the initialization level of this component. |
String |
getName()
Returns the name of this component. |
Map<String,PropertyValue<?>> |
getPropertyValues()
Returns a live Map of property values configured by this component definition. |
Map<String,ReferenceTarget> |
getReferenceTargets()
Returns a live Map of the targets configured by this component definition. |
void |
setInitLevel(Integer initLevel)
Sets the initialization level of this component. |
void |
setName(String name)
Sets the name of this component. |
Methods inherited from class org.apache.tuscany.spi.model.ModelObject |
---|
getExtensions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentDefinition(String name, I implementation)
name
- the name of this componentimplementation
- the implementation of this componentpublic ComponentDefinition(I implementation)
implementation
- the implementation of this componentMethod Detail |
---|
public I getImplementation()
Implementation
of this component.
public String getName()
public void setName(String name)
name
- the name of this componentpublic Integer getInitLevel()
public void setInitLevel(Integer initLevel)
initLevel
- the initialization level of this componentpublic Map<String,ReferenceTarget> getReferenceTargets()
targets
configured by this component definition.
public void add(ReferenceTarget target)
target
- the target to addpublic Map<String,PropertyValue<?>> getPropertyValues()
property values
configured by this component definition.
public void add(PropertyValue<?> value)
value
- the property value to add
|
Apache Tuscany SCA Kernel Sub-Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |