You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Yee-Kang Chang <ye...@ca.ibm.com> on 2008/04/04 17:42:23 UTC
ComponentContext.createSelfReference() with and without serviceName
Hi Everyone,
V1 of the Java Annotations & APIs Spec described these two methods as
follows:
createSelfReference(Class<B> businessInterface) ? Returns a
ServiceReference that can be used to invoke this component over the
designated service.
createSelfReference(Class<B> businessInterface, String serviceName) ?
Returns a ServiceReference that can be used to invoke this component over
the designated service. Service name explicitly declares the service name
to invoke.
Tuscany's JavaDoc described them as such:
createSelfReference(java.lang.Class<B> businessInterface) Returns a
ServiceReference that can be used to invoke this component over the
default service.
createSelfReference(java.lang.Class<B> businessInterface, java.lang.String
serviceName) Returns a ServiceReference that can be used to invoke this
component over the designated service.
The behaviour I observed was that createSelfReference(java.lang.Class<B>
businessInterface) would return an Exception when I invoked it from a
component with more than one services defined.
Can someone please confirm that this is the expected behaviour and that
createSelfReference(java.lang.Class<B> businessInterface) is meant for
component with one service while createSelfReference(java.lang.Class<B>
businessInterface, java.lang.String serviceName) is meant for component
with multiple services? And so, the "default service" mentioned in
Tuscany's JavaDoc is a typo?
Thank you!
Re: ComponentContext.createSelfReference() with and without serviceName
Posted by Yee-Kang Chang <ye...@ca.ibm.com>.
Thank you, Kevin! That explains it and confirms we have the correct
behaviour.
Perhaps we should update the JavaDoc (for
createSelfReference(java.lang.Class<B> businessInterface)) to NOT say
"default service" for that may mis-lead folks to think that we can define
a default service somehow ..
---
I meant to say:
... an exception is expected if you use the first version of the
createSelfReference API to create a ServiceReference to a component
offering multiple services.
--
Kevin
On Fri, Apr 4, 2008 at 10:24 AM, Kevin Williams <kj...@gmail.com>
wrote:
> Hi Yee-Kang,
>
> Further down in the specification is:
>
> 435 The second variant, which takes an additional serviceName
> parameter, *must* be used if the component
> 436 implements multiple services.
>
> So, an exception is expected if you employ the first version of the
> createSelfReference API.
>
> --Kevin
>
> On Fri, Apr 4, 2008 at 9:42 AM, Yee-Kang Chang <ye...@ca.ibm.com>
wrote:
> > Hi Everyone,
> >
> > V1 of the Java Annotations & APIs Spec described these two methods
as
> > follows:
> >
> > createSelfReference(Class<B> businessInterface) ? Returns a
> > ServiceReference that can be used to invoke this component over the
> > designated service.
> > createSelfReference(Class<B> businessInterface, String serviceName)
?
> > Returns a ServiceReference that can be used to invoke this component
over
> > the designated service. Service name explicitly declares the service
name
> > to invoke.
> >
> > Tuscany's JavaDoc described them as such:
> >
> > createSelfReference(java.lang.Class<B> businessInterface) Returns a
> > ServiceReference that can be used to invoke this component over the
> > default service.
> > createSelfReference(java.lang.Class<B> businessInterface,
java.lang.String
> > serviceName) Returns a ServiceReference that can be used to
invoke this
> > component over the designated service.
> >
> > The behaviour I observed was that
createSelfReference(java.lang.Class<B>
> > businessInterface) would return an Exception when I invoked it from
a
> > component with more than one services defined.
> >
> > Can someone please confirm that this is the expected behaviour and
that
> > createSelfReference(java.lang.Class<B> businessInterface) is meant
for
> > component with one service while
createSelfReference(java.lang.Class<B>
> > businessInterface, java.lang.String serviceName) is meant for
component
> > with multiple services? And so, the "default service" mentioned in
> > Tuscany's JavaDoc is a typo?
> >
> > Thank you!
Re: ComponentContext.createSelfReference() with and without serviceName
Posted by Kevin Williams <kj...@gmail.com>.
I meant to say:
... an exception is expected if you use the first version of the
createSelfReference API to create a ServiceReference to a component
offering multiple services.
--
Kevin
On Fri, Apr 4, 2008 at 10:24 AM, Kevin Williams <kj...@gmail.com> wrote:
> Hi Yee-Kang,
>
> Further down in the specification is:
>
> 435 The second variant, which takes an additional serviceName
> parameter, *must* be used if the component
> 436 implements multiple services.
>
> So, an exception is expected if you employ the first version of the
> createSelfReference API.
>
> --Kevin
>
>
>
> On Fri, Apr 4, 2008 at 9:42 AM, Yee-Kang Chang <ye...@ca.ibm.com> wrote:
>
>
> > Hi Everyone,
> >
> > V1 of the Java Annotations & APIs Spec described these two methods as
> > follows:
> >
> > createSelfReference(Class<B> businessInterface) ? Returns a
> > ServiceReference that can be used to invoke this component over the
> > designated service.
> > createSelfReference(Class<B> businessInterface, String serviceName) ?
> > Returns a ServiceReference that can be used to invoke this component over
> > the designated service. Service name explicitly declares the service name
> > to invoke.
> >
> > Tuscany's JavaDoc described them as such:
> >
> > createSelfReference(java.lang.Class<B> businessInterface) Returns a
> > ServiceReference that can be used to invoke this component over the
> > default service.
> > createSelfReference(java.lang.Class<B> businessInterface, java.lang.String
> > serviceName) Returns a ServiceReference that can be used to invoke this
> > component over the designated service.
> >
> > The behaviour I observed was that createSelfReference(java.lang.Class<B>
> > businessInterface) would return an Exception when I invoked it from a
> > component with more than one services defined.
> >
> > Can someone please confirm that this is the expected behaviour and that
> > createSelfReference(java.lang.Class<B> businessInterface) is meant for
> > component with one service while createSelfReference(java.lang.Class<B>
> > businessInterface, java.lang.String serviceName) is meant for component
> > with multiple services? And so, the "default service" mentioned in
> > Tuscany's JavaDoc is a typo?
> >
> > Thank you!
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: ComponentContext.createSelfReference() with and without serviceName
Posted by Kevin Williams <kj...@gmail.com>.
Hi Yee-Kang,
Further down in the specification is:
435 The second variant, which takes an additional serviceName
parameter, *must* be used if the component
436 implements multiple services.
So, an exception is expected if you employ the first version of the
createSelfReference API.
--Kevin
On Fri, Apr 4, 2008 at 9:42 AM, Yee-Kang Chang <ye...@ca.ibm.com> wrote:
> Hi Everyone,
>
> V1 of the Java Annotations & APIs Spec described these two methods as
> follows:
>
> createSelfReference(Class<B> businessInterface) ? Returns a
> ServiceReference that can be used to invoke this component over the
> designated service.
> createSelfReference(Class<B> businessInterface, String serviceName) ?
> Returns a ServiceReference that can be used to invoke this component over
> the designated service. Service name explicitly declares the service name
> to invoke.
>
> Tuscany's JavaDoc described them as such:
>
> createSelfReference(java.lang.Class<B> businessInterface) Returns a
> ServiceReference that can be used to invoke this component over the
> default service.
> createSelfReference(java.lang.Class<B> businessInterface, java.lang.String
> serviceName) Returns a ServiceReference that can be used to invoke this
> component over the designated service.
>
> The behaviour I observed was that createSelfReference(java.lang.Class<B>
> businessInterface) would return an Exception when I invoked it from a
> component with more than one services defined.
>
> Can someone please confirm that this is the expected behaviour and that
> createSelfReference(java.lang.Class<B> businessInterface) is meant for
> component with one service while createSelfReference(java.lang.Class<B>
> businessInterface, java.lang.String serviceName) is meant for component
> with multiple services? And so, the "default service" mentioned in
> Tuscany's JavaDoc is a typo?
>
> Thank you!
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org