You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by James Strachan <ja...@gmail.com> on 2006/07/03 11:46:06 UTC

Re: [HeadsUp] changes to the ServiceMixClient API to support simpler access via URIs

On 6/30/06, Hossam Karim <hr...@gmail.com> wrote:
> Excellent, Thanks Guillaume and James.
> I have two comments:
> - James, does the client API intentionally allow invoking a service without
> specifying an operation?

So the URI could include the operation name via 'operation:..."

http://incubator.apache.org/servicemix/uris.html

Or maybe we could append an operation name on any URI as a query argument...

service:http://foo.com/bar/whatnot?operation=foo

there's also nothing stopping the user of the ServiceMixClient APIs to
configure the MessageExchange directly in any way. I personally prefer
hiding all those details in the URI so that a Destination is just some
endpoint in a JMS-like way hiding all the various details of the
routing.


> - Guillaume, would it be possible to inject a DeliveryChannel instance into
> the web application context?

The ServiceMixClient - if its dependency injected with a JBI container
instance - has a delivery channel it uses. So I guess the
ServiceMixClient could be dependency injected - say via Spring - or
put inside JNDI so that web apps can invoke arbitrary services in JBI
without itself being a JBI component.

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [HeadsUp] changes to the ServiceMixClient API to support simpler access via URIs

Posted by James Strachan <ja...@gmail.com>.
On 7/3/06, Renaud Bruyeron <br...@fullsix.com> wrote:
> James Strachan wrote:
> > The ServiceMixClient - if its dependency injected with a JBI container
> > instance -
>
> The doco does not explain how to do this: "inject the JBI container".
> Most of the time I want to use the client I am inside a service unit
> deployed to a component like lwcontainer or http - I do not know how to
> get the reference to the container in the xbean.xml. I can do something
> like ((ComponentContextImpl) getContext()).getContainer() but this is
> ugly and wrong.
>
> What's the best way to go about this?

If you are a component and have access to a component context then
just create a ServiceMixClientFacade which implements the
ServiceMixClient API.

ServiceMixClient client = new ServiceMixClientFacade(context);

I just added this snippet of code to the end of the web page...
http://servicemix.org/site/client-api.html
-- 

James
-------
http://radio.weblogs.com/0112098/

Re: [HeadsUp] changes to the ServiceMixClient API to support simpler access via URIs

Posted by Renaud Bruyeron <br...@fullsix.com>.
James Strachan wrote:
> The ServiceMixClient - if its dependency injected with a JBI container
> instance - 

The doco does not explain how to do this: "inject the JBI container".
Most of the time I want to use the client I am inside a service unit 
deployed to a component like lwcontainer or http - I do not know how to 
get the reference to the container in the xbean.xml. I can do something 
like ((ComponentContextImpl) getContext()).getContainer() but this is 
ugly and wrong.

What's the best way to go about this?

  - Renaud