From c8f58fe2afa3f2f3bdf86846a48cb5a6dd7d503b Mon Sep 17 00:00:00 2001 From: slaws Date: Sun, 30 Nov 2008 13:46:51 +0000 Subject: Tidy jms policy implementations to remove code from the binding and put it into binding wire interceptors. The implication is that the JMS runtime no longer depends on the JMS policy package. Also get rid of split packages in wire format and operation selector packages. Add a binding context to the Tuscany message so that you don't have to keep finding it in the message header. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@721811 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java | 5 ++--- .../org/apache/tuscany/sca/core/invocation/MessageImpl.java | 11 ++++++++++- .../tuscany/sca/core/invocation/NonBlockingInterceptor.java | 7 +++++++ 3 files changed, 19 insertions(+), 4 deletions(-) (limited to 'branches/sca-java-1.x/modules/core/src/main') diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java index b6f949f081..f03071ae88 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/RuntimeWireImpl.java @@ -238,7 +238,7 @@ public class RuntimeWireImpl implements RuntimeWire { if (p instanceof PolicyProviderRRB) { Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor(); if (interceptor != null) { - bindingInvocationChain.addInterceptor(p.getPhase(), interceptor); + bindingInvocationChain.addInterceptor(Phase.REFERENCE_BINDING_POLICY, interceptor); } } } @@ -263,13 +263,12 @@ public class RuntimeWireImpl implements RuntimeWire { if (p instanceof PolicyProviderRRB) { Interceptor interceptor = ((PolicyProviderRRB)p).createBindingInterceptor(); if (interceptor != null) { - bindingInvocationChain.addInterceptor(p.getPhase(), interceptor); + bindingInvocationChain.addInterceptor(Phase.SERVICE_BINDING_POLICY, interceptor); } } } } - // TODO - add something on the end of the wire to invoke the // invocation chain. Need to split out the runtime // wire invoker into conversation, callback interceptors etc diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java index a45362a92d..ca2bf051c8 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java @@ -32,6 +32,7 @@ import org.apache.tuscany.sca.runtime.EndpointReference; * @version $Rev $Date$ */ public class MessageImpl implements Message { + private Object bindingContext; private List headers = new ArrayList(); private Object body; private Object messageID; @@ -99,6 +100,14 @@ public class MessageImpl implements Message { public List getHeaders() { return headers; - } + } + + @SuppressWarnings("unchecked") + public T getBindingContext() { + return (T)bindingContext; + } + public void setBindingContext(T bindingContext) { + this.bindingContext = bindingContext; + } } diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java index 582d1ee141..d6911281c8 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java @@ -189,6 +189,13 @@ public class NonBlockingInterceptor implements Interceptor { public List getHeaders() { return null; + } + + public T getBindingContext() { + return null; + } + + public void setBindingContext(T bindingContext) { } } -- cgit v1.2.3