ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no no <yoos_developpem...@hotmail.fr>
Subject RE: ODE extensionActivity and ServiceMix
Date Fri, 31 Oct 2008 17:43:08 GMT

Thx for the answer.



I was trying to find a way to bypass this problem.

I ended up discovering that it was the class OdeContext which could provide me the information
i needed.
(ComponentContext )

But this class is not visible by default.

So i made a public class in my bundle in the same package as OdeContext :




package org.apache.ode.jbi;



import javax.jbi.component.ComponentContext;



public class OdeContextWrapper {

    public ComponentContext ctx;

    

    public OdeContextWrapper(){

        OdeContext odeCtx=OdeContext.getInstance();

        

        ctx=odeCtx.getContext();

    }

    

    public ComponentContext getContext(){

        return ctx;

    }



}
___________________________________________

And then in the code i use to send the emssage into the JBI bus :

// Contacting the JSR
        ServiceMixClient client = new ServiceMixClientFacade(
                new OdeContextWrapper().getContext());

        // HardCoded service right now.
        QName service = new QName(namespace, endPoint);

        EndpointResolver resolver = client.createResolverForService(service);

        // Sending a request to JSR service Dispatcher
        try {
            Node payload = message.getSOAPBody().getFirstChild();
            String msg = UtilityBox.nodeToString(payload);
            __log.info("Sending this message to the bus at this service "
                            + namespace + ":" + endPoint);
            System.out.println(msg);
            Source data = (Source) client.request(resolver, null, null, msg);
            result = (new SourceTransformer()).toString(data);
            __log.info("Receive a message from JBI:" + result);
        } catch (Exception e) {
            throw new SendException(e.getMessage());
        }
_____________________________________________

And the call succeeds.
If in next release of ODE the ComponentContext could be accessible this way, it should be
useful for others.

Thx again !

Youssouf Mhoma


> Date: Fri, 31 Oct 2008 09:16:21 -0700
> From: boisvert@intalio.com
> To: user@ode.apache.org
> Subject: Re: ODE extensionActivity and ServiceMix
> 
> On Fri, Oct 31, 2008 at 7:02 AM, no no <yoos_developpement@hotmail.fr>wrote:
> 
> > The problem is that i need the access to "context"(
> > javax.jbi.component.ComponentContext),
> > this "context" belonging to the ODE-JBI Component holding the reference to
> > my dynamic invocation bundle.
> >
> > Is there a way for my bundle to access to this context ?
> 
> 
> Not at the moment.   We could introduce a way to retrieve this context with
> the JBI IL.   Do you want to propose something?
> 
> 
> > Is there perhaps in ServiceMix the possibility to get the context of any
> > component by passing some sort of
> > unique identifier ? (this one i should post on servicemix user list i think
> > :) ).
> 
> 
> I don't know.  Yes, I suggest you ask on the servicemix mailing list.
> 
> alex

_________________________________________________________________
Inédit ! Des Emoticônes Déjantées! Installez les dans votre Messenger ! 
http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message