Tuscany Core

org.apache.tuscany.core.system.config
Class SystemEntryPointContextFactory

java.lang.Object
  extended by org.apache.tuscany.core.system.config.SystemEntryPointContextFactory
All Implemented Interfaces:
ContextFactory<EntryPointContext>, ContextResolver

public class SystemEntryPointContextFactory
extends java.lang.Object
implements ContextFactory<EntryPointContext>, ContextResolver

Creates SystemEntryPointContext instances based on an entry point configuration in an assembly model

Version:
$Rev: 397183 $ $Date: 2006-04-26 07:38:42 -0400 (Wed, 26 Apr 2006) $

Constructor Summary
SystemEntryPointContextFactory(java.lang.String name, java.lang.String targetName, java.lang.Class serviceInterface)
           
 
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 pFactory)
          Adds a source-side wire factory for the given reference.
 void addTargetWireFactory(java.lang.String serviceName, TargetWireFactory pFactory)
          Adds a target-side wire factory for the given service name.
 EntryPointContext 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemEntryPointContextFactory

public SystemEntryPointContextFactory(java.lang.String name,
                                      java.lang.String targetName,
                                      java.lang.Class serviceInterface)
Method Detail

createContext

public EntryPointContext createContext()
                                throws ContextCreationException
Description copied from interface: ContextFactory
Creates a Context based on configuration supplied by a logical model assembly

Specified by:
createContext in interface ContextFactory<EntryPointContext>
Returns:
a new instance context
Throws:
ContextCreationException - if an error occurs creating the context

getScope

public org.apache.tuscany.model.assembly.Scope getScope()
Description copied from interface: ContextFactory
Returns the scope identifier associated with the type of contexts produced by the current factory

Specified by:
getScope in interface ContextFactory<EntryPointContext>

getName

public java.lang.String getName()
Description copied from interface: ContextFactory
Returns the name of the Context produced by the current factory

Specified by:
getName in interface ContextFactory<EntryPointContext>

addTargetWireFactory

public void addTargetWireFactory(java.lang.String serviceName,
                                 TargetWireFactory pFactory)
Description copied from interface: ContextFactory
Adds a target-side wire factory for the given service name. Target-side wire factories contain the invocation chains associated with the destination service of a wire and are responsible for generating proxies

Specified by:
addTargetWireFactory in interface ContextFactory<EntryPointContext>

getTargetWireFactory

public TargetWireFactory getTargetWireFactory(java.lang.String serviceName)
Description copied from interface: ContextFactory
Returns the target-side wire factory associated with the given service name

Specified by:
getTargetWireFactory in interface ContextFactory<EntryPointContext>

getTargetWireFactories

public java.util.Map<java.lang.String,TargetWireFactory> getTargetWireFactories()
Description copied from interface: ContextFactory
Returns a collection of target-side wire factories keyed by service name

Specified by:
getTargetWireFactories in interface ContextFactory<EntryPointContext>

addSourceWireFactory

public void addSourceWireFactory(java.lang.String referenceName,
                                 SourceWireFactory pFactory)
Description copied from interface: ContextFactory
Adds a source-side wire factory for the given reference. Source-side wire factories contain the invocation chains for a reference in the implementation associated with the instance context created by this configuration. Source-side wire factories also produce proxies that are injected on a reference in a component implementation.

Specified by:
addSourceWireFactory in interface ContextFactory<EntryPointContext>

addSourceWireFactories

public void addSourceWireFactories(java.lang.String referenceName,
                                   java.lang.Class referenceInterface,
                                   java.util.List<SourceWireFactory> factory,
                                   boolean multiplicity)
Description copied from interface: ContextFactory
Adds a set of source-side wire factories for the given reference. Source-side wire factories contain the invocation chains for a reference in the implementation associated with the instance context created by this configuration. Source-side wire factories also produce proxies that are injected on a reference in a component implementation.

Specified by:
addSourceWireFactories in interface ContextFactory<EntryPointContext>

addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.Object value)
Description copied from interface: ContextFactory
Adds a property to the context

Specified by:
addProperty in interface ContextFactory<EntryPointContext>

getSourceWireFactories

public java.util.List<SourceWireFactory> getSourceWireFactories()
Description copied from interface: ContextFactory
Returns a collection of source-side wire factories for references. There may 1..n wire factories per reference.

Specified by:
getSourceWireFactories in interface ContextFactory<EntryPointContext>

prepare

public void prepare(CompositeContext parent)
Description copied from interface: ContextFactory
Called to signal to the configuration that its parent context has been activated and that it shoud perform any required initialization steps

Specified by:
prepare in interface ContextFactory<EntryPointContext>
Parameters:
parent - the parent context

getCurrentContext

public CompositeContext getCurrentContext()
Description copied from interface: ContextResolver
Returns the current composite context

Specified by:
getCurrentContext in interface ContextResolver

Tuscany Core

-