Hi Luciano,
Thanks for your help! Indeed, if I use <component_name>/$promoted
$.<service_name> it actually works (in my case "InnerWeatherComponent/
$promoted$.InnerWeatherService").
However as you mention in your older post, we should definitely be
able to just look up the <service_name> directly. The current
workaround means that the client must know the actual component
promoting the service and if the composite writer decides to wire the
service differently (to another component exposing the same
interface), the client must know about it. Therefore, in the current
situation, the composites do not "hide" their internal structure
properly and in my view this is not completely aligned with the SCA
"philosophy".
regards,
Adrian.
---------------
Adrian Mos
ObjectWeb Project
SOA Technical Lead
[EMAIL PROTECTED]
+33 4 76 61 54 02
INRIA Rhone-Alpes
655 avenue de l'Europe - Montbonnot
38 334 Saint Ismier Cedex France
On Nov 18, 2007, at 6:53 PM, Luciano Resende wrote:
I had a similar issue before, although I guess this is not the best
answer, you should be able to prefix $promoted$ before the promoted
service name, and then get a reference to it.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg22555.html
On Nov 17, 2007 8:08 AM, Adrian Mos <[EMAIL PROTECTED]> wrote:
Hi guys,
Apologies if this issue has already been addressed, I did a quick
check in JIRA and on the mailing lists and could not find it. It's a
rather fundamental issue so it's possible that I misunderstand
something in the way composite services should be obtained.
Basically I have a composite file that contains a component and that
also exposes a service (which promotes the component's implicit
service). My standalone Java client can obtain the component's
implicit service using SCADomain.getService(SERVICE_CLASS,
"COMPONENT_NAME") but cannot obtain the same service by just using
the composite's service name.
Here's the composite:
<?xml version="1.0" encoding="UTF-8"?>
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://www.inria.fr"
xmlns:reservation="http://www.inria.fr"
name="WeatherComposite">
<service name="InnerWeatherService"
promote="InnerWeatherComponent">
<interface.java
interface="services.WeatherService" />
</service>
<component name="InnerWeatherComponent">
<implementation.java
class="implementations.WeatherImplementation" />
</component>
</composite>
And the client code:
SCADomain domain = SCADomain.newInstance("weather.composite");
WeatherService service = domain.getService(WeatherService.class,
"InnerWeatherComponent");
WeatherService service2 = domain.getService(WeatherService.class,
"InnerWeatherService");
System.out.println("The weather is: " + service.getForecast());
System.out.println("Again, the weather is: " + service2.getForecast
());
The last line generates an org.osoa.sca.ServiceUnavailableException
exception with the message No service invoker is available for
reference default (bindingURI=InnerWeatherService
operation=getForecast)
Please let me know if this is the expected behaviour and if so why
(i.e. is this a bug or a feature? :) ).
Thanks,
Adrian.
--
Luciano Resende
Apache Tuscany Committer
http://people.apache.org/~lresende
http://lresende.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]