On Wed, Apr 30, 2008 at 12:44 PM, <[EMAIL PROTECTED]> wrote:

> Hi Simon,
>
> I just created a Jira to keep track of this issue:
> https://issues.apache.org/jira/browse/TUSCANY-2281
>
> Besides using multiplicity="1..n", the interface Crawler is also
> Conversational.
> As mentioned in document "Java Common Annotations APIs", conversations
> are created when
> - a @Reference to a conversational service is injected
> - a call is made to CompositeContext.getServiceReference() and then a
> method of the service is called
>
> So the only way of having multiple conversations in parallel on the same
> Service from one client is to create multiple ServiceReferences. So if I
> use a injected reference, then I can not have multiple conversations on
> this reference. Or are there any other options to achieve this ?
>
> A workaround for my project could be
> - to use "Factory" classes for each Crawler. So in my client I could use
> a multiplicity reference to 1..n CrawlerFactories and in each
> CrawlerFactory a single 1..1 reference to a Crawler service. Then in the
> CrawlerFactory it would be possible to create ServiceReferences.
> - to simply don't use SCAs conversation mechanism but implement my own
> conversation handling.
>
> Any suggestions ?
>
> Bye,
> Daniel
>
>
> > Hi Daniel
> >
> > Good question. The OASIS TC has proposed a solution to this issue (
> > http://www.osoa.org/jira/browse/JAVA-9) but this isn't part
> > of the API we have implemented as we have taken the V1 API.
> > Can you raise a JIRA for this as I can't see one already and
> > at least in that way we can track it.
> >
> > Is it possible for you to inject the references you need. You
> > can specify a reference with multiplicity as a collection,
> > for example, from itest/references
> >
> >
> >     @Reference(name = "dServiceReferences")
> >     public List<ServiceReference<DComponent>> dServiceReferences;
> >
> > Which is populated by
> >
> >     <component name="AComponent">
> >          ...
> >         <reference name="dServiceReferences"
> > target="DComponent DComponent1"
> > />
> >     </component>
> >
> >     <component name="DComponent">
> >         <implementation.java
> > class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
> >     </component>
> >
> >     <component name="DComponent1">
> >         <implementation.java
> > class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
> >     </component>
> >
> > See the test for alternatives.
> >
> > Regards
> >
> > Simon
> >
>

Thanks Daniel for the JIRA.

"multiple conversations in parallel on the same Service from one client".
Can I just check that this is a requirement in you scenario. I'm imagining
that the effect you want is to have multiple ongoing crawl actions
associated with a particular type of crawler. Sound right?  Also what is the
scope of the crawler controller component. Is it composite scoped?

In the factory approach you suggest, would there be a factory for each type
of crawler. So you would have an injected reference to get the factory
reference from the multiplicity of factory references and then the factory
would be responsible for having multiple conversations with the crawler.
This would work I think but it doesn't sounds quite right. I probably don't
quite understand the scenario properly. Can you say a little more about the
the interactions between the crawler controller and the crawlers themselves.


(the real answer of course is for us to fix the JIRA;-)

Regards

Simon

Reply via email to