org.apache.tuscany.core.system.context
Class SystemCompositeContextImpl
java.lang.Object
org.apache.tuscany.core.context.impl.AbstractLifecycle
org.apache.tuscany.core.context.impl.AbstractContext
org.apache.tuscany.core.context.impl.AbstractCompositeContext
org.apache.tuscany.core.system.context.SystemCompositeContextImpl
- All Implemented Interfaces:
- ContextFactoryBuilder, WireBuilder, AutowireContext, CompositeContext, ConfigurationContext, Context, EventPublisher, Lifecycle, ScopeAwareContext, SystemCompositeContext
public class SystemCompositeContextImpl
- extends AbstractCompositeContext
- implements SystemCompositeContext
Implements an composite context for system components. By default a system context uses the scopes specified by
SystemScopeStrategy
. In addition, it implements an autowire policy
where entry points configured with a SystemBinding
are matched
according to their exposed interface. A system context may contain child composite contexts but an entry point in a
child context will only be outwardly accessible if there is an entry point that exposes it configured in the
top-level system context.
- Version:
- $Rev: 408581 $ $Date: 2006-05-21 23:34:24 -0700 (Sun, 21 May 2006) $
Fields inherited from class org.apache.tuscany.core.context.impl.AbstractCompositeContext |
assemblyContext, configurationContext, configurations, DEFAULT_WAIT, eventContext, immutableScopeContexts, initialized, initializeLatch, lock, module, parentContext, scopeContexts, scopeIndex, scopeStrategy |
Methods inherited from class org.apache.tuscany.core.context.impl.AbstractCompositeContext |
build, buildTarget, checkInit, completeTargetChain, connect, fireEvent, getComposite, getContext, getInstance, getParent, getScopeContexts, getURI, initializeScopes, initializeWireFactories, publish, registerAutowireExternal, registerAutowireInternal, registerConfiguration, registerModelObject, registerModelObjects, removeContext, resolveExternalInstance, setAssemblyContext, setAutowireContext, setConfigurationContext, setEventContext, setModule, setParent, setURI, start, stop, wireSource |
SystemCompositeContextImpl
public SystemCompositeContextImpl()
SystemCompositeContextImpl
public SystemCompositeContextImpl(String name,
CompositeContext parent,
AutowireContext autowire,
ScopeStrategy strategy,
EventContext ctx,
ConfigurationContext configCtx)
registerJavaObject
public void registerJavaObject(String componentName,
Class<?> service,
Object instance)
throws ConfigurationException
- Description copied from interface:
SystemCompositeContext
- Register a simple Java Object as a system component.
This is primarily intended for use by bootstrap code to create the initial
configuration components.
- Specified by:
registerJavaObject
in interface SystemCompositeContext
- Parameters:
componentName
- the name of the resulting componentinstance
- the Object that will become the component's implementation
- Throws:
ConfigurationException
resolveInstance
public <T> T resolveInstance(Class<T> instanceInterface)
throws AutowireResolutionException
- Description copied from interface:
AutowireContext
- Invoked by child contexts to return an an autowire target. Resolved targets may be entry points or
components in the parent or its ancestors, or entry points in a sibling context
- Specified by:
resolveInstance
in interface AutowireContext
- Overrides:
resolveInstance
in class AbstractCompositeContext
- Parameters:
instanceInterface
- the type of service being requested
- Returns:
- a reference to the requested service or null if none can be found
- Throws:
AutowireResolutionException
- if an error occurs attempting to resolve an autowire
-