|
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.ComponentType<S,R,P>
public class ComponentType<S extends ServiceDefinition,R extends ReferenceDefinition,P extends Property<?>>
The definition of the configurable aspects of an implementation in terms of the services it exposes, the services it references, and properties that can be used to configure it.
A service represents an addressable interface provided by the implementation. Such a service may be the target of a wire from another component.
A reference represents a requirement that an implementation has on a service provided by another component or by a resource outside the SCA system. Such a reference may be the source of a wire to another component.
A property allows the behaviour of the implementation to be configured through externally set values.
A component type may also declare that it wishes to be initialized upon activation of the scope that contains it and may specify an order relative to other eagerly initializing components. For example, an implementation that pre-loads some form of cache could declare that it should be eagerly initialized at the start of the scope so that the cache load occured on startup rather than first use.
Constructor Summary | |
---|---|
ComponentType()
|
Method Summary | |
---|---|
void |
add(P property)
Add a property that can be used to configure the implementation. |
void |
add(R reference)
Add a reference to a service consumed by the implementation. |
void |
add(S service)
Add a service to those provided by the implementation. |
int |
getInitLevel()
Returns the default initialization level for components of this type. |
Map<String,P> |
getProperties()
Returns a live Map of properties that can be used to configure the implementation. |
Map<String,R> |
getReferences()
Returns a live Map of references to services consumed by the implementation. |
Map<String,S> |
getServices()
Returns a live Map of the services provided by the implementation. |
boolean |
isEagerInit()
Returns true if this component should be eagerly initialized. |
void |
setEagerInit(boolean eagerInit)
Deprecated. |
void |
setInitLevel(int initLevel)
Sets the default initialization level for components of this type. |
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 ComponentType()
Method Detail |
---|
public int getInitLevel()
public void setInitLevel(int initLevel)
initLevel
- default initialization level for components of this typepublic boolean isEagerInit()
@Deprecated public void setEagerInit(boolean eagerInit)
eagerInit
- flag indicating that this component should be eagerly initializedpublic Map<String,S> getServices()
public void add(S service)
service
- a service provided by the implementationpublic Map<String,R> getReferences()
public void add(R reference)
reference
- a reference to a service consumed by the implementationpublic Map<String,P> getProperties()
public void add(P property)
property
- a property that can be used to configure the implementation
|
Apache Tuscany SCA Kernel Sub-Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |