You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by muhwas <mu...@yahoo.com> on 2007/06/01 22:51:57 UTC
Re: using service name to call a service
by the way i used this
CompositeContext compositeContext =
CurrentCompositeContext.getContext();
// get service reference using service component name
in client side default.scdl
return
compositeContext.locateService(java.lang.Object.class,serviceName);
and then i casted it to what ever interface type i
want to. so i think passing in interface doesn't
nessasary.
--- scabooz <sc...@gmail.com> wrote:
> Muhwas,
>
> Your objection to the locateService API seems to be
> the need to pass the business interface class. As
> Simon
> noted, this doesn't go away with the new v1.0 API.
>
> If the business interface were not passed as a
> parameter,
> what interface would you expect the returned proxy
> to implement?
>
> Dave
>
>
> ----- Original Message -----
> From: "Simon Laws" <si...@googlemail.com>
> To: <tu...@ws.apache.org>
> Sent: Thursday, April 19, 2007 7:35 AM
> Subject: Re: using service name to call a service
>
>
> > On 4/13/07, muhwas <mu...@yahoo.com> wrote:
> >>
> >> Hi guys,
> >>
> >> I was wondering if there is any way to get a
> reference
> >> to web service interface using service name (in
> SCDL
> >> file) only instead of doing
> >>
> >>
>
compositeContext.locateService(ClassName.class,"composite")
> >>
> >> thank you,
> >> muhwas
> >>
> >>
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> tuscany-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail:
> tuscany-dev-help@ws.apache.org
> >>
> >> Hi Muhwas
> >
> > I'm not sure what the options were on M2. In the
> latest software (in the
> > trunk of our svn respository) we are moving to
> implement V1.0 of the SCA
> > specifications. The emphasis here is on component
> context although how a
> > component context is obtained is not specified. In
> the trunk
> > implementation
> > we currently have an embedded host container that
> allows a component
> > context
> > to be returned in the following way.
> >
> > SCARuntime.start("my.composite");
> > ComponentContext context =
> SCARuntime.getComponentContext
> > ("MyComponentName");
> >
> > From there the spec says that you should be able
> to do (not sure it quite
> > works like this yet)
> >
> > MyService service =
> context.getService(MyService.class,
> "MyServiceName");
> >
> > I know this doesn't answer your question re. M2
> but hopefully gives you an
> > idea of where we are going.
> >
> > Regards
> >
> > Simon
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> tuscany-dev-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: using service name to call a service
Posted by Mike Edwards <mi...@gmail.com>.
Muhwas,
I dont understand what you are saying here.
Surely, the actual service has a specific interface - it isn't simply
"anything", so you can only cast to the actual business interface it
actually implements.
Or did you envisage your client code introspecting the returned service
proxy and dealing with whatever it found? The latter case is possible
but it is not a pattern I would encourage people to use - the code is
likely to get very complex. I can see a possible use for it in writing
test clients, where the parameters are actually presented in a GUI for a
user to fill dynamically. However, this is not typical of real business
code.
Yours, Mike.
muhwas wrote:
> by the way i used this
>
> CompositeContext compositeContext =
> CurrentCompositeContext.getContext();
> // get service reference using service component name
> in client side default.scdl
> return
> compositeContext.locateService(java.lang.Object.class,serviceName);
>
> and then i casted it to what ever interface type i
> want to. so i think passing in interface doesn't
> nessasary.
>
> --- scabooz <sc...@gmail.com> wrote:
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org