diff options
author | rsivaram <rsivaram@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-12 13:16:06 +0000 |
---|---|---|
committer | rsivaram <rsivaram@13f79535-47bb-0310-9956-ffa450edef68> | 2008-11-12 13:16:06 +0000 |
commit | af0cfc49958afa2ef6c44384cb5d5d8ca4c516da (patch) | |
tree | d6d049845ae04a9f21d67513bde2ee5edf4cf363 /sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java | |
parent | 29f3940a57d823817db96b41ccd1e9c7a88c4adc (diff) |
Event prototype: event binding with JMS-based default binding
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@713362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java')
-rw-r--r-- | sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java b/sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java index 481f3b2b0a..2c36acbf94 100644 --- a/sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java +++ b/sandbox/event/modules/binding-event/src/main/java/org/apache/tuscany/sca/binding/event/impl/EventBindingInvoker.java @@ -19,54 +19,50 @@ package org.apache.tuscany.sca.binding.event.impl; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.InvocationChain; +import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.invocation.Message; import org.apache.tuscany.sca.invocation.DataExchangeSemantics; +import org.apache.tuscany.sca.provider.ReferenceBindingProvider; /** - * TODO: Implement event binding invoker + * Event binding invoker * @version $$ */ -public class EventBindingInvoker implements Interceptor, DataExchangeSemantics { - private InvocationChain chain; +public class EventBindingInvoker implements Invoker, DataExchangeSemantics { + + private Invoker baseInvoker; /** - * Construct a EventBindingInvoker that delegates to the service invocaiton chain + * Construct a EventBindingInvoker that delegates to the service invocation chain * @param chain */ - public EventBindingInvoker(InvocationChain chain) { + public EventBindingInvoker(ReferenceBindingProvider baseBindingProvider, Operation operation) { super(); - this.chain = chain; - } - - /** - * @see org.apache.tuscany.sca.invocation.Interceptor#getNext() - */ - public Invoker getNext() { - return chain.getHeadInvoker(); + + // TODO: Should we match producer event types with the event types of the operation? + baseInvoker = baseBindingProvider.createInvoker(operation); } - /** - * @see org.apache.tuscany.sca.invocation.Interceptor#setNext(org.apache.tuscany.sca.invocation.Invoker) - */ - public void setNext(Invoker next) { - // NOOP - } /** * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message) */ public Message invoke(Message msg) { - return getNext().invoke(msg); + if (baseInvoker != null) { + return baseInvoker.invoke(msg); + } + else { + msg.setBody(null); + return msg; + } } /** * @see org.apache.tuscany.sca.invocation.DataExchangeSemantics#allowsPassByReference() */ public boolean allowsPassByReference() { - return chain.allowsPassByReference(); + return true; } } |