diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-18 19:06:40 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-18 19:06:40 +0000 |
commit | bf06eae38c29f648bb1b443ea8ea525c61bb630b (patch) | |
tree | b648cd4ede1614b4ab8645380366ee0049d33dff /java/sca/modules/core-spi/src/main | |
parent | b22c95d7267170bfe00620be78302aa365cfdc8f (diff) |
Rename the methods on RuntimeEndpoint/RuntimeEndpointReference
Defer the unmarshalling of XML into endpoint/endpointReference
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@881883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/core-spi/src/main')
4 files changed, 24 insertions, 11 deletions
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java index a55de8f20e..6e3bedc205 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/context/CompositeContext.java @@ -34,6 +34,7 @@ import org.apache.tuscany.sca.runtime.RuntimeComponentContext; * @version $Rev$ $Date$ */ public class CompositeContext { + protected final static InheritableThreadLocal<CompositeContext> context = new InheritableThreadLocal<CompositeContext>(); protected ExtensionPointRegistry extensionPointRegistry; protected EndpointRegistry endpointRegistry; protected ComponentContextFactory componentContextFactory; @@ -73,8 +74,12 @@ public class CompositeContext { public static CompositeContext getCurrentCompositeContext() { RuntimeComponent component = getCurrentComponent(); if (component != null) { - RuntimeComponentContext context = component.getComponentContext(); - return context.getCompositeContext(); + RuntimeComponentContext componentContext = component.getComponentContext(); + return componentContext.getCompositeContext(); + } + CompositeContext compositeContext = context.get(); + if (compositeContext != null) { + return compositeContext; } return null; } @@ -111,5 +116,12 @@ public class CompositeContext { public Composite getDomainComposite() { return domainComposite; } - + + public static void setThreadCompositeContext(CompositeContext value) { + context.set(value); + } + + public static void removeCompositeContext() { + context.remove(); + } } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java index a16d8e14f7..981872fdfa 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointSerializer.java @@ -19,8 +19,6 @@ package org.apache.tuscany.sca.runtime; -import java.io.IOException; - import org.apache.tuscany.sca.assembly.Endpoint; import org.apache.tuscany.sca.assembly.EndpointReference; @@ -28,8 +26,11 @@ import org.apache.tuscany.sca.assembly.EndpointReference; * A utility to seralize/deserialize Endpoint/EndpointReference objects */ public interface EndpointSerializer { - EndpointReference readEndpointReference(String xml) throws IOException; - String write(EndpointReference endpointReference) throws IOException; - Endpoint readEndpoint(String xml) throws IOException; - String write(Endpoint endpoint) throws IOException; + EndpointReference readEndpointReference(String xml); + + String write(EndpointReference endpointReference); + + Endpoint readEndpoint(String xml); + + String write(Endpoint endpoint); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java index 2a4cf4fc84..178f184c1f 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpoint.java @@ -54,5 +54,5 @@ public interface RuntimeEndpoint extends Endpoint, Invocable, Serializable { * code can process. * @return The target component type service interface contract */ - InterfaceContract getServiceInterfaceContract(); + InterfaceContract getComponentTypeServiceInterfaceContract(); } diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java index d6f8431d48..58e453ed37 100644 --- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java +++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeEndpointReference.java @@ -53,7 +53,7 @@ public interface RuntimeEndpointReference extends EndpointReference, Invocable, * implementation code uses to make the outbound call. * @return The source component type reference interface contract */ - InterfaceContract getReferenceInterfaceContract(); + InterfaceContract getComponentTypeReferenceInterfaceContract(); boolean isOutOfDate(); void rebuild(); |