|
Tuscany Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tuscany.core.system.config.SystemContextFactory
public class SystemContextFactory
A ContextFactory
that handles system component implementation types, which may be either simple, leaf
types or an composites.
For composite types, this factory delegates to an ObjectFactory
to create an
instance of the composite implementation and perform injection of configuration and references. Once an composite
instance is created, the factory will register the composite's children. This process may be done recursively in a
lazy fashion, descending down an composite hierarchy as a child composite is instantiated.
Constructor Summary | |
---|---|
SystemContextFactory(java.lang.String name,
java.lang.reflect.Constructor ctr,
org.apache.tuscany.model.assembly.Scope scope)
Creates the runtime configuration |
|
SystemContextFactory(java.lang.String name,
org.apache.tuscany.model.assembly.Module module,
java.lang.reflect.Constructor ctr,
org.apache.tuscany.model.assembly.Scope scope)
Creates the runtime configuration |
Method Summary | |
---|---|
void |
addProperty(java.lang.String propertyName,
java.lang.Object value)
Adds a property to the context |
void |
addSourceWireFactories(java.lang.String referenceName,
java.lang.Class referenceInterface,
java.util.List<SourceWireFactory> factory,
boolean multiplicity)
Adds a set of source-side wire factories for the given reference. |
void |
addSourceWireFactory(java.lang.String referenceName,
SourceWireFactory factory)
Adds a source-side wire factory for the given reference. |
void |
addTargetWireFactory(java.lang.String serviceName,
TargetWireFactory factory)
Adds a target-side wire factory for the given service name. |
Context |
createContext()
Creates a Context based on configuration supplied by a logical model assembly |
CompositeContext |
getCurrentContext()
Returns the current composite context |
java.lang.String |
getName()
Returns the name of the Context produced by the current factory |
org.apache.tuscany.model.assembly.Scope |
getScope()
Returns the scope identifier associated with the type of contexts produced by the current factory |
java.util.List<SourceWireFactory> |
getSourceWireFactories()
Returns a collection of source-side wire factories for references. |
java.util.Map<java.lang.String,TargetWireFactory> |
getTargetWireFactories()
Returns a collection of target-side wire factories keyed by service name |
TargetWireFactory |
getTargetWireFactory(java.lang.String serviceName)
Returns the target-side wire factory associated with the given service name |
void |
prepare(CompositeContext parent)
Called to signal to the configuration that its parent context has been activated and that it shoud perform any required initialization steps |
void |
setDestroyInvoker(EventInvoker invoker)
|
void |
setEagerInit(boolean val)
|
void |
setInitInvoker(EventInvoker invoker)
|
void |
setSetters(java.util.List<Injector> setters)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemContextFactory(java.lang.String name, java.lang.reflect.Constructor ctr, org.apache.tuscany.model.assembly.Scope scope)
name
- the SCDL name of the component the context refers toctr
- the implementation type constructorscope
- the scope of the component implementation typepublic SystemContextFactory(java.lang.String name, org.apache.tuscany.model.assembly.Module module, java.lang.reflect.Constructor ctr, org.apache.tuscany.model.assembly.Scope scope)
name
- the SCDL name of the component the context refers tomodule
- if this factory produces aggregagtes, the logical model associated with its children; otherwise
nullctr
- the implementation type constructorscope
- the scope of the component implementation typeMethod Detail |
---|
public java.lang.String getName()
ContextFactory
Context
produced by the current factory
getName
in interface ContextFactory<Context>
public void addProperty(java.lang.String propertyName, java.lang.Object value)
ContextFactory
addProperty
in interface ContextFactory<Context>
public org.apache.tuscany.model.assembly.Scope getScope()
ContextFactory
getScope
in interface ContextFactory<Context>
public Context createContext() throws ContextCreationException
ContextFactory
Context
based on configuration supplied by a logical model assembly
createContext
in interface ContextFactory<Context>
ContextCreationException
- if an error occurs creating the contextpublic void addTargetWireFactory(java.lang.String serviceName, TargetWireFactory factory)
ContextFactory
addTargetWireFactory
in interface ContextFactory<Context>
public TargetWireFactory getTargetWireFactory(java.lang.String serviceName)
ContextFactory
getTargetWireFactory
in interface ContextFactory<Context>
public java.util.Map<java.lang.String,TargetWireFactory> getTargetWireFactories()
ContextFactory
getTargetWireFactories
in interface ContextFactory<Context>
public void addSourceWireFactory(java.lang.String referenceName, SourceWireFactory factory)
ContextFactory
addSourceWireFactory
in interface ContextFactory<Context>
public void addSourceWireFactories(java.lang.String referenceName, java.lang.Class referenceInterface, java.util.List<SourceWireFactory> factory, boolean multiplicity)
ContextFactory
addSourceWireFactories
in interface ContextFactory<Context>
public java.util.List<SourceWireFactory> getSourceWireFactories()
ContextFactory
getSourceWireFactories
in interface ContextFactory<Context>
public void setSetters(java.util.List<Injector> setters)
public void setEagerInit(boolean val)
public void setInitInvoker(EventInvoker invoker)
public void setDestroyInvoker(EventInvoker invoker)
public void prepare(CompositeContext parent)
ContextFactory
prepare
in interface ContextFactory<Context>
parent
- the parent contextpublic CompositeContext getCurrentContext()
ContextResolver
getCurrentContext
in interface ContextResolver
|
Tuscany Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |