Tuscany Core

org.apache.tuscany.core.extension
Class EntryPointContextFactory

java.lang.Object
  extended by org.apache.tuscany.core.extension.EntryPointContextFactory
All Implemented Interfaces:
ContextFactory<EntryPointContext>

public abstract class EntryPointContextFactory
extends java.lang.Object
implements ContextFactory<EntryPointContext>

Default factory for contexts that represent entry points.

Version:
$Rev$ $Date$

Constructor Summary
EntryPointContextFactory(java.lang.String name, MessageFactory msgFactory)
           
 
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> factories, boolean multiplicity)
          Adds a set of source-side wire factories for the given reference.
 void addSourceWireFactory(java.lang.String refName, 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.
 EntryPointContext createContext()
          Creates a Context based on configuration supplied by a logical model assembly
 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()
           
 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

EntryPointContextFactory

public EntryPointContextFactory(java.lang.String name,
                                MessageFactory msgFactory)
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>

prepare

public void prepare()

addTargetWireFactory

public void addTargetWireFactory(java.lang.String serviceName,
                                 TargetWireFactory factory)
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 refName,
                                 SourceWireFactory factory)
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>

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>

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>

addSourceWireFactories

public void addSourceWireFactories(java.lang.String referenceName,
                                   java.lang.Class referenceInterface,
                                   java.util.List<SourceWireFactory> factories,
                                   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>

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

Tuscany Core

-