synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Horn" <kim.h...@icsglobal.net>
Subject RE: Class Mediator Exception after task schedule
Date Fri, 27 Mar 2009 05:01:20 GMT
Just looking over your code; what is the example of when headers is NOT
an instanceof Map.
When could this happen ?
If this is true then it's a problem for the system; should raise an
exception ?

Kim

-----Original Message-----
From: Asankha Perera [mailto:asankha.apache@gmail.com] On Behalf Of
Asankha C. Perera
Sent: Friday, 27 March 2009 2:40 PM
To: dev@synapse.apache.org
Subject: Re: Class Mediator Exception after task schedule

Hi Kim
> Are there any examples of code where I could do the send of the
message in the
> Java task code; create a new messageInjectorSenderMediator ? 
> So add the transport info then do the send.
>   
Hope this helps:

                Axis2MessageContext axis2smc = (Axis2MessageContext)
synCtx;
                org.apache.axis2.context.MessageContext axis2MessageCtx
=
                        axis2smc.getAxis2MessageContext();
                Object headers = axis2MessageCtx.getProperty(
                        
org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);

                if (headers != null && headers instanceof Map) {
                    Map headersMap = (HashMap) headers;
                    headersMap.put(name, resultValue); // <== adding a 
transport header
                }
                if (headers == null) {
                    Map headersMap = new HashMap();
                    headersMap.put(name, resultValue); // <== adding a 
transport header
                    axis2MessageCtx.setProperty(
                            
org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS,
                            headersMap);
                }
> If I send this to a Synapse Proxy then the real sequence is out of
Quartz scope.
>   
Yes.. but its like going out around and coming back in :)

cheers
asankha

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Mime
View raw message