summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/tags/java-stable-20060304/sca/core/src/main/java/org/apache/tuscany/core/builder/RuntimeConfiguration.java
blob: 79396e60526b97270f1200ff06c0dd670ed72715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package org.apache.tuscany.core.builder;

import java.util.Map;

import org.apache.tuscany.core.context.Context;
import org.apache.tuscany.core.invocation.spi.ProxyFactory;
import org.apache.tuscany.model.assembly.Scope;

/**
 * Implementations create instances of {@link org.apache.tuscany.core.context.Context} based on a compiled
 * configuration, such as a logical assembly model. For example, implementations of
 * {@link org.apache.tuscany.core.builder.RuntimeConfigurationBuilder} analyze an
 * {@link org.apache.tuscany.model.assembly.AssemblyModelObject} to create implementations of
 * <tt>RuntimeConfiguration</tt>.
 * 
 * @version $Rev$ $Date$
 */
public interface RuntimeConfiguration<T extends Context> {

    /**
     * Creates an instance context based on the current runtime configuration
     * 
     * @return a new instance context
     * @throws ContextCreationException if an error occurs creating the context
     */
    public T createInstanceContext() throws ContextCreationException;

    /**
     * Returns the scope identifier associated with the type of contexts produced by the current configuration
     */
    public Scope getScope();

    /**
     * Returns the name of the contexts produced by the current configuration
     */
    public String getName();

    public void prepare();

    /**
     * Adds a target-side proxy factory for the given service name to the configuration. Target-side proxy factories
     * contain the invocation chains associated with the destination service of a wire and are responsible for
     * generating proxies
     */
    public void addTargetProxyFactory(String serviceName, ProxyFactory factory);

    /**
     * Returns the target-side proxy factory associated with the given service name
     */
    public ProxyFactory getTargetProxyFactory(String serviceName);

    /**
     * Returns a collection of target-side proxy factories for the configuration keyed by service name
     */
    public Map<String, ProxyFactory> getTargetProxyFactories();

    /**
     * Adds a source-side proxy factory for the given reference. Source-side proxy factories contain the invocation
     * chains for a reference in the component implementation associated with the instance context created by this
     * configuration. Source-side proxy factories also produce proxies that are injected on a reference in a component
     * implementation.
     */
    public void addSourceProxyFactory(String referenceName, ProxyFactory factory);

    public ProxyFactory getSourceProxyFactory(String referenceName);

    public Map<String, ProxyFactory> getSourceProxyFactories();

}