You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Simon Laws <si...@googlemail.com> on 2008/03/17 09:05:01 UTC
Checking the TUSCANY-2077 test in? Re: svn commit: r637621 - in /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/ invocation/
Hi Simon
Do you have Daniel's test in a position where you could check it in?
Simon
On Sun, Mar 16, 2008 at 5:59 PM, <na...@apache.org> wrote:
> Author: nash
> Date: Sun Mar 16 10:59:45 2008
> New Revision: 637621
>
> URL: http://svn.apache.org/viewvc?rev=637621&view=rev
> Log:
> Fix for TUSCANY-2077
>
> Modified:
>
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointReferenceImpl.java
>
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java
>
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
>
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
>
> Modified:
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointReferenceImpl.java
> URL:
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointReferenceImpl.java?rev=637621&r1=637620&r2=637621&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointReferenceImpl.java
> (original)
> +++
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointReferenceImpl.java
> Sun Mar 16 10:59:45 2008
> @@ -149,9 +149,11 @@
> @Override
> public Object clone() throws CloneNotSupportedException {
> EndpointReferenceImpl copy = (EndpointReferenceImpl)super.clone();
> + /* [nash] no need to copy callback endpoint
> if (callbackEndpoint != null) {
> copy.callbackEndpoint =
> (EndpointReference)callbackEndpoint.clone();
> }
> + */
> if (parameters != null) {
> copy.parameters = (ReferenceParameters)parameters.clone();
> }
>
> Modified:
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java
> URL:
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java?rev=637621&r1=637620&r2=637621&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java
> (original)
> +++
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java
> Sun Mar 16 10:59:45 2008
> @@ -98,7 +98,7 @@
> }
>
> try {
> - return invoke(chain, args, wire);
> + return invoke(chain, args, wire, wire.getSource());
> } catch (InvocationTargetException e) {
> Throwable t = e.getCause();
> if (t instanceof NoRegisteredCallbackException) {
>
> Modified:
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
> URL:
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java?rev=637621&r1=637620&r2=637621&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
> (original)
> +++
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java
> Sun Mar 16 10:59:45 2008
> @@ -67,6 +67,7 @@
> protected boolean conversational;
> protected ExtendedConversation conversation;
> protected MessageFactory messageFactory;
> + protected EndpointReference source;
> protected EndpointReference target;
> protected RuntimeWire wire;
> protected CallableReference<?> callableReference;
> @@ -98,14 +99,12 @@
>
> protected void init(RuntimeWire wire) {
> if (wire != null) {
> - /* [scn] no need to clone because the wire doesn't get
> modified
> try {
> - // Clone the wire so that reference parameters can be
> changed
> - this.wire = (RuntimeWire)wire.clone();
> + // Clone the endpoint reference so that reference
> parameters can be changed
> + source = (EndpointReference)wire.getSource().clone();
> } catch (CloneNotSupportedException e) {
> throw new ServiceRuntimeException(e);
> }
> - [scn] */
> initConversational(wire);
> }
> }
> @@ -152,7 +151,7 @@
> }
>
> // send the invocation down the wire
> - Object result = invoke(chain, args, wire);
> + Object result = invoke(chain, args, wire, source);
>
> return result;
> }
> @@ -262,10 +261,10 @@
> this.target = endpoint;
> }
>
> - protected Object invoke(InvocationChain chain, Object[] args,
> RuntimeWire wire) throws Throwable {
> -
> + protected Object invoke(InvocationChain chain, Object[] args,
> RuntimeWire wire, EndpointReference source)
> + throws Throwable {
> Message msg = messageFactory.createMessage();
> - msg.setFrom(wire.getSource());
> + msg.setFrom(source);
> if (target != null) {
> msg.setTo(target);
> } else {
> @@ -306,11 +305,11 @@
> throws TargetResolutionException {
> ReferenceParameters parameters = msg.getFrom
> ().getReferenceParameters();
> parameters.setCallbackID(getCallbackID());
> - if (wire.getSource() == null || wire.getSource().getCallbackEndpoint()
> == null) {
> + if (msg.getFrom() == null || msg.getFrom().getCallbackEndpoint()
> == null) {
> return;
> }
>
> - parameters.setCallbackReference(wire.getSource
> ().getCallbackEndpoint());
> + parameters.setCallbackReference(msg.getFrom
> ().getCallbackEndpoint());
>
> // If we are passing out a callback target
> // register the calling component instance against this
>
> Modified:
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
> URL:
> http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java?rev=637621&r1=637620&r2=637621&view=diff
>
> ==============================================================================
> ---
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
> (original)
> +++
> incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/RuntimeWireInvoker.java
> Sun Mar 16 10:59:45 2008
> @@ -141,56 +141,6 @@
> }
>
> /**
> - * This method has bugs in it and is not needed by this class. It is
> no
> - * longer called and will be removed completely when I finish my
> cleanup
> - * of this class.
> - */
> - @SuppressWarnings("unchecked")
> - private void handleCallback(Message msg, Object
> currentConversationID) throws TargetResolutionException {
> - EndpointReference from = msg.getFrom();
> - ReferenceParameters parameters = from.getReferenceParameters();
> - parameters.setCallbackID(callbackID);
> - if (from == null || from.getCallbackEndpoint() == null) {
> - return;
> - }
> - // If we are passing out a callback target
> - // register the calling component instance against this
> - // new conversation id so that stateful callbacks will be
> - // able to find it
> - if (conversational && callbackObject == null) {
> - // the component instance is already registered
> - // so add another registration
> - ScopeContainer scopeContainer =
> getConversationalScopeContainer(msg);
> -
> - if (scopeContainer != null) {
> - scopeContainer.addWrapperReference(currentConversationID,
> parameters.getConversationID());
> - }
> - }
> -
> - Interface interfaze = msg.getOperation().getInterface();
> - if (callbackObject != null) {
> - if (callbackObject instanceof ServiceReference) {
> - EndpointReference callbackRef =
> ((CallableReferenceImpl)callbackObject).getEndpointReference();
> - parameters.setCallbackReference(callbackRef);
> - } else {
> - if (interfaze != null) {
> - if (!interfaze.isConversational()) {
> - throw new IllegalArgumentException(
> - "Callback
> object for stateless callback is not a ServiceReference");
> - } else {
> - ScopeContainer scopeContainer =
> getConversationalScopeContainer(msg);
> - if (scopeContainer != null) {
> - InstanceWrapper wrapper = new
> CallbackObjectWrapper(callbackObject);
> - scopeContainer.registerWrapper(wrapper,
> conversation.getConversationID());
> - }
> - parameters.setCallbackObjectID(callbackObject);
> - }
> - }
> - }
> - }
> - }
> -
> - /**
> * Pre-invoke for the conversation handling
> * @param msg
> * @throws TargetResolutionException
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-commits-help@ws.apache.org
>
>
Re: Checking the TUSCANY-2077 test in? Re: svn commit: r637621 - in /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/ invocation/
Posted by Vamsavardhana Reddy <c1...@gmail.com>.
I have created a TUSCANY-2090 to add a testcase for this issue so that we
don't regress.
++Vamsi
On Mon, Mar 17, 2008 at 6:56 PM, Simon Laws <si...@googlemail.com>
wrote:
> On Mon, Mar 17, 2008 at 1:16 PM, Simon Nash <na...@apache.org> wrote:
>
> > Simon Laws wrote:
> > > Hi Simon
> > >
> > > Do you have Daniel's test in a position where you could check it in?
> > >
> > I do have his test running, but for some reason it never failed
> > for me, even when the printlns showed the incorrect conversation ID
> > was being used. So I just used the printlns to debug the problem
> > and verify my fix.
> >
> > Simon
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>
> Ah, I see. Fair enough.
>
> Simon
>
Re: Checking the TUSCANY-2077 test in? Re: svn commit: r637621 - in /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core: assembly/ invocation/
Posted by Simon Laws <si...@googlemail.com>.
On Mon, Mar 17, 2008 at 1:16 PM, Simon Nash <na...@apache.org> wrote:
> Simon Laws wrote:
> > Hi Simon
> >
> > Do you have Daniel's test in a position where you could check it in?
> >
> I do have his test running, but for some reason it never failed
> for me, even when the printlns showed the incorrect conversation ID
> was being used. So I just used the printlns to debug the problem
> and verify my fix.
>
> Simon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>
Ah, I see. Fair enough.
Simon
Re: Checking the TUSCANY-2077 test in? Re: svn commit: r637621 -
in /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core:
assembly/ invocation/
Posted by Simon Nash <na...@apache.org>.
Simon Laws wrote:
> Hi Simon
>
> Do you have Daniel's test in a position where you could check it in?
>
I do have his test running, but for some reason it never failed
for me, even when the printlns showed the incorrect conversation ID
was being used. So I just used the printlns to debug the problem
and verify my fix.
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org