You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jean-Sébastien Ricard (JIRA)" <ji...@apache.org> on 2006/02/23 13:22:40 UTC

[jira] Created: (AXIS2-462) AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong parameter for engine.send(...)

AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong parameter for engine.send(...)
-------------------------------------------------------------------------------------------------------

         Key: AXIS2-462
         URL: http://issues.apache.org/jira/browse/AXIS2-462
     Project: Apache Axis 2.0 (Axis2)
        Type: Bug
  Components: core  
    Versions: 0.93, 0.94    
 Environment: All operating systems/plateforms
    Reporter: Jean-Sébastien Ricard
    Priority: Blocker


In the invokeBusinessLogic method, and particulary in the handleResult() method, when calling the engine.send(..) method, the incoming MessageContext is send (messageCtx) rather than result one (result).

Here after the fixed source code  :

public abstract class AbstractInOutAsyncMessageReceiver extends AbstractMessageReceiver {
    protected Log log = LogFactory.getLog(getClass());

    public abstract void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage,
                                             ServerCallback callback)
            throws AxisFault;

    public final void receive(final MessageContext messageCtx) throws AxisFault {
        final ServerCallback callback = new ServerCallback() {
            public void handleResult(MessageContext result) throws AxisFault {
                AxisEngine engine =
                        new AxisEngine(messageCtx.getOperationContext().getServiceContext()
                                .getConfigurationContext());
                
                // BUG
                //engine.send(messageCtx);

                // FIXED
                engine.send(result);
                
            }

            public void handleFault(AxisFault fault) throws AxisFault {
                AxisEngine engine =
                        new AxisEngine(messageCtx.getOperationContext().getServiceContext()
                                .getConfigurationContext());
                MessageContext faultContext = engine.createFaultMessageContext(messageCtx, fault);

                engine.sendFault(faultContext);
            }
        };
        Runnable theadedTask = new Runnable() {
            public void run() {
                try {
                    MessageContext newmsgCtx = Utils.createOutMessageContext(messageCtx);
                    newmsgCtx.getOperationContext().addMessageContext(newmsgCtx);

                    invokeBusinessLogic(messageCtx, newmsgCtx, callback);
                } catch (AxisFault e) {
                    log.error(e);
                }
            }
        };

        messageCtx.getConfigurationContext().getThreadPool().execute(theadedTask);
    }
}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (AXIS2-462) AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong parameter for engine.send(...)

Posted by "Eran Chinthaka (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS2-462?page=all ]
     
Eran Chinthaka resolved AXIS2-462:
----------------------------------

    Fix Version: 0.95
     Resolution: Fixed

Fixed. Thanks for reporting this.

> AbstractInOutAsyncMessageReceiver : in method invokeBusinessLogic, wrong parameter for engine.send(...)
> -------------------------------------------------------------------------------------------------------
>
>          Key: AXIS2-462
>          URL: http://issues.apache.org/jira/browse/AXIS2-462
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug
>   Components: core
>     Versions: 0.94, 0.93
>  Environment: All operating systems/plateforms
>     Reporter: Jean-Sébastien Ricard
>     Priority: Blocker
>      Fix For: 0.95

>
> In the invokeBusinessLogic method, and particulary in the handleResult() method, when calling the engine.send(..) method, the incoming MessageContext is send (messageCtx) rather than result one (result).
> Here after the fixed source code  :
> public abstract class AbstractInOutAsyncMessageReceiver extends AbstractMessageReceiver {
>     protected Log log = LogFactory.getLog(getClass());
>     public abstract void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage,
>                                              ServerCallback callback)
>             throws AxisFault;
>     public final void receive(final MessageContext messageCtx) throws AxisFault {
>         final ServerCallback callback = new ServerCallback() {
>             public void handleResult(MessageContext result) throws AxisFault {
>                 AxisEngine engine =
>                         new AxisEngine(messageCtx.getOperationContext().getServiceContext()
>                                 .getConfigurationContext());
>                 
>                 // BUG
>                 //engine.send(messageCtx);
>                 // FIXED
>                 engine.send(result);
>                 
>             }
>             public void handleFault(AxisFault fault) throws AxisFault {
>                 AxisEngine engine =
>                         new AxisEngine(messageCtx.getOperationContext().getServiceContext()
>                                 .getConfigurationContext());
>                 MessageContext faultContext = engine.createFaultMessageContext(messageCtx, fault);
>                 engine.sendFault(faultContext);
>             }
>         };
>         Runnable theadedTask = new Runnable() {
>             public void run() {
>                 try {
>                     MessageContext newmsgCtx = Utils.createOutMessageContext(messageCtx);
>                     newmsgCtx.getOperationContext().addMessageContext(newmsgCtx);
>                     invokeBusinessLogic(messageCtx, newmsgCtx, callback);
>                 } catch (AxisFault e) {
>                     log.error(e);
>                 }
>             }
>         };
>         messageCtx.getConfigurationContext().getThreadPool().execute(theadedTask);
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira