You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Thomas McKiernan <MC...@uk.ibm.com> on 2006/08/21 10:49:35 UTC

isServerSide flag

Hi everyone,
The following code in Sandesha has caused us some problems:

                                MessageContext requestMsgCtx = 
msgCtx.getOperationContext().getMessageContext(
 OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
                                if (requestMsgCtx != null) { // for the 
server side
                                        RMMsgContext reqRMMsgCtx = 
MsgInitializer.initializeMessage(requestMsgCtx);
                                        Sequence sequencePart = (Sequence) 
reqRMMsgCtx
 .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
                                        if (sequencePart != null)
                                                msgProcessor = new 
ApplicationMsgProcessor();// a rm
                                        // intended
                                        // message.
                                } else if (!msgCtx.isServerSide()) // if 
client side.
                                        msgProcessor = new 
ApplicationMsgProcessor();
                        } else {
                                msgProcessor = 
MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
                        }

We are finding that requestMsgCtx is non-null for a client side request. 
Therefore the code assumes it is a server side and tries to process 
accordingly, which causes problems.
A workaround seems to be to change the code to the following:

                                if (msgCtx.isServerSide()) { // for the 
server side
                                        RMMsgContext reqRMMsgCtx = 
MsgInitializer.initializeMessage(requestMsgCtx);
                                        Sequence sequencePart = (Sequence) 
reqRMMsgCtx
 .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
                                        if (sequencePart != null)
                                                msgProcessor = new 
ApplicationMsgProcessor();// a rm
                                        // intended
                                        // message.
                                } 
                                else // if client side.
                                        msgProcessor = new 
ApplicationMsgProcessor();

Are there any side effects of this change? Is this change still correct 
code?

Many thanks,
Tom



----------------------------------
Thomas McKiernan

WebSphere Messaging Development,
IBM United Kingdom Limited

Internal Phone: 248241 
External Phone: +44 (0)1962 818241
Mobile: +44 (0)789 1737497
Email: MCKIERNA@uk.ibm.com

Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21 
2JN


Caminante, no hay camino 
Se hace camino al andar.
("Walker, there is no path; the path is made by walking.")  Antonio 
Machado

Re: isServerSide flag

Posted by Chamikara Jayalath <ch...@gmail.com>.
Done :-)

On 8/21/06, Chamikara Jayalath <ch...@gmail.com> wrote:
>
>  Dont see any side affects. Let me correct this.
>
> Chamikara
>
>
>
> On 8/21/06, Thomas McKiernan <MCKIERNA@uk.ibm.com > wrote:
> >
> >
> > Hi everyone,
> > The following code in Sandesha has caused us some problems:
> >
> >                                 MessageContext requestMsgCtx =
> > msgCtx.getOperationContext().getMessageContext(
> >
> > OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
> >                                 *if* (requestMsgCtx != *null*) { // for
> > the server side
> >                                         RMMsgContext reqRMMsgCtx =
> > MsgInitializer.initializeMessage(requestMsgCtx);
> >                                         Sequence sequencePart =
> > (Sequence) reqRMMsgCtx
> >                                                         .getMessagePart(
> > Sandesha2Constants.MessageParts.SEQUENCE);
> >                                         *if* (sequencePart != *null*)
> >                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> > a rm
> >                                         // intended
> >                                         // message.
> >                                 } *else* *if* (!msgCtx.isServerSide()) //
> > if client side.
> >                                         msgProcessor = *new*ApplicationMsgProcessor();
> >                         } *else* {
> >                                 msgProcessor =
> > MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
> >                         }
> >
> > We are finding that requestMsgCtx is non-null for a client side request.
> > Therefore the code assumes it is a server side and tries to process
> > accordingly, which causes problems.
> > A workaround seems to be to change the code to the following:
> >
> >                                 *if* (msgCtx.isServerSide()) { // for
> > the server side
> >                                         RMMsgContext reqRMMsgCtx =
> > MsgInitializer.initializeMessage(requestMsgCtx);
> >                                         Sequence sequencePart =
> > (Sequence) reqRMMsgCtx
> >                                                         .getMessagePart(
> > Sandesha2Constants.MessageParts.SEQUENCE);
> >                                         *if* (sequencePart != *null*)
> >                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> > a rm
> >                                         // intended
> >                                         // message.
> >                                 }
> > *                                else* // if client side.
> >                                         msgProcessor = *new*ApplicationMsgProcessor();
> >
> > Are there any side effects of this change? Is this change still correct
> > code?
> >
> > Many thanks,
> > Tom
> >
> >
> >
> > ----------------------------------
> > Thomas McKiernan
> >
> > WebSphere Messaging Development,
> > IBM United Kingdom Limited
> >
> > Internal Phone: 248241
> > External Phone: +44 (0)1962 818241
> > Mobile: +44 (0)789 1737497
> > Email: MCKIERNA@uk.ibm.com
> >
> > Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21
> > 2JN
> >
> >
> > Caminante, no hay camino
> > Se hace camino al andar.
> > ("Walker, there is no path; the path is made by walking.")  Antonio
> > Machado
> >
>
>

Re: isServerSide flag

Posted by Chamikara Jayalath <ch...@gmail.com>.
Done :-)

On 8/21/06, Chamikara Jayalath <ch...@gmail.com> wrote:
>
>  Dont see any side affects. Let me correct this.
>
> Chamikara
>
>
>
> On 8/21/06, Thomas McKiernan <MCKIERNA@uk.ibm.com > wrote:
> >
> >
> > Hi everyone,
> > The following code in Sandesha has caused us some problems:
> >
> >                                 MessageContext requestMsgCtx =
> > msgCtx.getOperationContext().getMessageContext(
> >
> > OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
> >                                 *if* (requestMsgCtx != *null*) { // for
> > the server side
> >                                         RMMsgContext reqRMMsgCtx =
> > MsgInitializer.initializeMessage(requestMsgCtx);
> >                                         Sequence sequencePart =
> > (Sequence) reqRMMsgCtx
> >                                                         .getMessagePart(
> > Sandesha2Constants.MessageParts.SEQUENCE);
> >                                         *if* (sequencePart != *null*)
> >                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> > a rm
> >                                         // intended
> >                                         // message.
> >                                 } *else* *if* (!msgCtx.isServerSide()) //
> > if client side.
> >                                         msgProcessor = *new*ApplicationMsgProcessor();
> >                         } *else* {
> >                                 msgProcessor =
> > MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
> >                         }
> >
> > We are finding that requestMsgCtx is non-null for a client side request.
> > Therefore the code assumes it is a server side and tries to process
> > accordingly, which causes problems.
> > A workaround seems to be to change the code to the following:
> >
> >                                 *if* (msgCtx.isServerSide()) { // for
> > the server side
> >                                         RMMsgContext reqRMMsgCtx =
> > MsgInitializer.initializeMessage(requestMsgCtx);
> >                                         Sequence sequencePart =
> > (Sequence) reqRMMsgCtx
> >                                                         .getMessagePart(
> > Sandesha2Constants.MessageParts.SEQUENCE);
> >                                         *if* (sequencePart != *null*)
> >                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> > a rm
> >                                         // intended
> >                                         // message.
> >                                 }
> > *                                else* // if client side.
> >                                         msgProcessor = *new*ApplicationMsgProcessor();
> >
> > Are there any side effects of this change? Is this change still correct
> > code?
> >
> > Many thanks,
> > Tom
> >
> >
> >
> > ----------------------------------
> > Thomas McKiernan
> >
> > WebSphere Messaging Development,
> > IBM United Kingdom Limited
> >
> > Internal Phone: 248241
> > External Phone: +44 (0)1962 818241
> > Mobile: +44 (0)789 1737497
> > Email: MCKIERNA@uk.ibm.com
> >
> > Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21
> > 2JN
> >
> >
> > Caminante, no hay camino
> > Se hace camino al andar.
> > ("Walker, there is no path; the path is made by walking.")  Antonio
> > Machado
> >
>
>

Re: isServerSide flag

Posted by Chamikara Jayalath <ch...@gmail.com>.
 Dont see any side affects. Let me correct this.

Chamikara


On 8/21/06, Thomas McKiernan <MC...@uk.ibm.com> wrote:
>
>
> Hi everyone,
> The following code in Sandesha has caused us some problems:
>
>                                 MessageContext requestMsgCtx =
> msgCtx.getOperationContext().getMessageContext(
>
> OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
>                                 *if* (requestMsgCtx != *null*) { // for
> the server side
>                                         RMMsgContext reqRMMsgCtx =
> MsgInitializer.initializeMessage(requestMsgCtx);
>                                         Sequence sequencePart = (Sequence)
> reqRMMsgCtx
>                                                         .getMessagePart(
> Sandesha2Constants.MessageParts.SEQUENCE);
>                                         *if* (sequencePart != *null*)
>                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> a rm
>                                         // intended
>                                         // message.
>                                 } *else* *if* (!msgCtx.isServerSide()) //
> if client side.
>                                         msgProcessor = *new*ApplicationMsgProcessor();
>                         } *else* {
>                                 msgProcessor =
> MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
>                         }
>
> We are finding that requestMsgCtx is non-null for a client side request.
> Therefore the code assumes it is a server side and tries to process
> accordingly, which causes problems.
> A workaround seems to be to change the code to the following:
>
>                                 *if* (msgCtx.isServerSide()) { // for the
> server side
>                                         RMMsgContext reqRMMsgCtx =
> MsgInitializer.initializeMessage(requestMsgCtx);
>                                         Sequence sequencePart = (Sequence)
> reqRMMsgCtx
>                                                         .getMessagePart(
> Sandesha2Constants.MessageParts.SEQUENCE);
>                                         *if* (sequencePart != *null*)
>                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> a rm
>                                         // intended
>                                         // message.
>                                 }
> *                                else* // if client side.
>                                         msgProcessor = *new*ApplicationMsgProcessor();
>
> Are there any side effects of this change? Is this change still correct
> code?
>
> Many thanks,
> Tom
>
>
>
> ----------------------------------
> Thomas McKiernan
>
> WebSphere Messaging Development,
> IBM United Kingdom Limited
>
> Internal Phone: 248241
> External Phone: +44 (0)1962 818241
> Mobile: +44 (0)789 1737497
> Email: MCKIERNA@uk.ibm.com
>
> Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21
> 2JN
>
>
> Caminante, no hay camino
> Se hace camino al andar.
> ("Walker, there is no path; the path is made by walking.")  Antonio
> Machado
>

Re: isServerSide flag

Posted by Chamikara Jayalath <ch...@gmail.com>.
 Dont see any side affects. Let me correct this.

Chamikara


On 8/21/06, Thomas McKiernan <MC...@uk.ibm.com> wrote:
>
>
> Hi everyone,
> The following code in Sandesha has caused us some problems:
>
>                                 MessageContext requestMsgCtx =
> msgCtx.getOperationContext().getMessageContext(
>
> OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
>                                 *if* (requestMsgCtx != *null*) { // for
> the server side
>                                         RMMsgContext reqRMMsgCtx =
> MsgInitializer.initializeMessage(requestMsgCtx);
>                                         Sequence sequencePart = (Sequence)
> reqRMMsgCtx
>                                                         .getMessagePart(
> Sandesha2Constants.MessageParts.SEQUENCE);
>                                         *if* (sequencePart != *null*)
>                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> a rm
>                                         // intended
>                                         // message.
>                                 } *else* *if* (!msgCtx.isServerSide()) //
> if client side.
>                                         msgProcessor = *new*ApplicationMsgProcessor();
>                         } *else* {
>                                 msgProcessor =
> MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
>                         }
>
> We are finding that requestMsgCtx is non-null for a client side request.
> Therefore the code assumes it is a server side and tries to process
> accordingly, which causes problems.
> A workaround seems to be to change the code to the following:
>
>                                 *if* (msgCtx.isServerSide()) { // for the
> server side
>                                         RMMsgContext reqRMMsgCtx =
> MsgInitializer.initializeMessage(requestMsgCtx);
>                                         Sequence sequencePart = (Sequence)
> reqRMMsgCtx
>                                                         .getMessagePart(
> Sandesha2Constants.MessageParts.SEQUENCE);
>                                         *if* (sequencePart != *null*)
>                                                 msgProcessor = *new*ApplicationMsgProcessor();//
> a rm
>                                         // intended
>                                         // message.
>                                 }
> *                                else* // if client side.
>                                         msgProcessor = *new*ApplicationMsgProcessor();
>
> Are there any side effects of this change? Is this change still correct
> code?
>
> Many thanks,
> Tom
>
>
>
> ----------------------------------
> Thomas McKiernan
>
> WebSphere Messaging Development,
> IBM United Kingdom Limited
>
> Internal Phone: 248241
> External Phone: +44 (0)1962 818241
> Mobile: +44 (0)789 1737497
> Email: MCKIERNA@uk.ibm.com
>
> Mail Point 211, IBM, Hursley Park, Winchester, Hampshire, England, SO21
> 2JN
>
>
> Caminante, no hay camino
> Se hace camino al andar.
> ("Walker, there is no path; the path is made by walking.")  Antonio
> Machado
>