You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by ant elder <an...@gmail.com> on 2006/02/10 10:40:52 UTC
Should ModuleContext locateService find external services?
If an sca.module file defines an external service and I call ModuleContext
locateService with the external service name it throws a
ServiceNotFoundException. Page 15 of the "SCA Client and Implementation
model for Java" makes it sound like locateService should find external
services. If this is a bug I can raise a JIRA, just checking what is this
the expected behaviour?
...ant
Re: Should ModuleContext locateService find external services?
Posted by Jim Marino <jm...@myroma.net>.
That's a bug (the spec does allow locateService on external
services). One of the changes underway is to manage external services
as another instance context type (instance contexts manage a runtime
artifact such as a component). This will clear up the bug. I'll have
a further write-up on the changes ASAP.
Jim
On Feb 10, 2006, at 6:56 AM, Jeremy Boynes wrote:
> ant elder wrote:
>
>> Does there have to be a wire?
>>
>
> No, there doesn't - note to self, drink coffee before doing email.
>
>
>> An example is something like:
>>
>> sca.module:
>>
>> <module xmlns="http://www.osoa.org/xmlns/sca/0.9"
>> xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
>> name="sampleHelloworld">
>>
>> <externalService name="HelloWorldService">
>> <interface.wsdl interface="
>> http://
>> helloworldaxis.samples.tuscany.apache.org#HelloWorldServiceImpl"/>
>> <binding.ws port="
>> http://helloworldaxis.samples.tuscany.apache.org#helloworld"/>
>> </externalService>
>>
>> </module>
>>
>>
>
> That's the same as from one of the samples that used to work so there
> could be a bug there.
>
> OTOH, and I know it's early and the coffee has not kicked in, but are
> those URIs correct? Shouldn't they point to a valid location?
>
> --
> Jeremy
>
Re: Should ModuleContext locateService find external services?
Posted by Jeremy Boynes <jb...@apache.org>.
ant elder wrote:
> Does there have to be a wire?
No, there doesn't - note to self, drink coffee before doing email.
> An example is something like:
>
> sca.module:
>
> <module xmlns="http://www.osoa.org/xmlns/sca/0.9"
> xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
> name="sampleHelloworld">
>
> <externalService name="HelloWorldService">
> <interface.wsdl interface="
> http://helloworldaxis.samples.tuscany.apache.org#HelloWorldServiceImpl"/>
> <binding.ws port="
> http://helloworldaxis.samples.tuscany.apache.org#helloworld"/>
> </externalService>
>
> </module>
>
That's the same as from one of the samples that used to work so there
could be a bug there.
OTOH, and I know it's early and the coffee has not kicked in, but are
those URIs correct? Shouldn't they point to a valid location?
--
Jeremy
Re: Should ModuleContext locateService find external services?
Posted by ant elder <an...@gmail.com>.
Does there have to be a wire? An example is something like:
sca.module:
<module xmlns="http://www.osoa.org/xmlns/sca/0.9"
xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
name="sampleHelloworld">
<externalService name="HelloWorldService">
<interface.wsdl interface="
http://helloworldaxis.samples.tuscany.apache.org#HelloWorldServiceImpl"/>
<binding.ws port="
http://helloworldaxis.samples.tuscany.apache.org#helloworld"/>
</externalService>
</module>
Code:
TuscanyRuntime tuscany = new TuscanyRuntime("hello", null);
tuscany.start();
CurrentModuleContext.getContext().locateService("HelloWorldService");
which gets:
Exception in thread "main"
org.apache.tuscany.core.context.ServiceNotFoundException: HelloWorldService
at
org.apache.tuscany.core.context.impl.TuscanyModuleComponentContextImpl.getInstance
(TuscanyModuleComponentContextImpl.java:301)
at
org.apache.tuscany.core.context.impl.TuscanyModuleComponentContextImpl.locateService
(TuscanyModuleComponentContextImpl.java:315)
at HelloworldClient.main(HelloworldClient.java:18)
...ant
On 2/10/06, Jeremy Boynes <jb...@apache.org> wrote:
>
> ant elder wrote:
> > If an sca.module file defines an external service and I call
> ModuleContext
> > locateService with the external service name it throws a
> > ServiceNotFoundException. Page 15 of the "SCA Client and Implementation
> > model for Java" makes it sound like locateService should find external
> > services. If this is a bug I can raise a JIRA, just checking what is
> this
> > the expected behaviour?
> >
> > ...ant
> >
>
> It should find the service that the ExternalService is wired to - in the
> absense of a wire then the reference would be unconnected and you'd get
> an exception.
>
> So the question is, does the SCDL define a wire? If it does then, yep,
> it's a bug. Note the wire can be supplied by the source module, the
> target module, or by another module all together.
>
> --
> Jeremy
>
Re: Should ModuleContext locateService find external services?
Posted by Jeremy Boynes <jb...@apache.org>.
ant elder wrote:
> If an sca.module file defines an external service and I call ModuleContext
> locateService with the external service name it throws a
> ServiceNotFoundException. Page 15 of the "SCA Client and Implementation
> model for Java" makes it sound like locateService should find external
> services. If this is a bug I can raise a JIRA, just checking what is this
> the expected behaviour?
>
> ...ant
>
It should find the service that the ExternalService is wired to - in the
absense of a wire then the reference would be unconnected and you'd get
an exception.
So the question is, does the SCDL define a wire? If it does then, yep,
it's a bug. Note the wire can be supplied by the source module, the
target module, or by another module all together.
--
Jeremy