Here is a concrete scenario ...

Two composites A, B in the SCA Domain

A has single component a
B has single component b

a provides a.service
b provides b.service

a_impl.service must delegate to b_impl.service

A provides no defined reference to b.service so a_impl will dynamically find
and invoke b.service

Based on Raymond's earlier comment in this thread

AImpl implements A {

   service() {

       ComponentContext context = SCARuntime.getComponentContext("b")
       ServiceReference<b> service = context.createSelfReference(b.class)
       BService bService = service.getService()

       return bService.service

   }
}


Will SCARuntime continue to provide "getComponentContext" or is some
domain-related-interface needed?  Are there plans for the infrastructure
required to implement it?

Thanks,

--Kevin

On 5/1/07, Kevin Williams <[EMAIL PROTECTED]> wrote:

I am creating a test case for this and it seems that there is currently no
API for "adding deployable composites".  Is this work underway?  I may be
able to help out here.

Thanks,
--Kevin

On 4/23/07, Kevin Williams <[EMAIL PROTECTED]> wrote:
>
> Thanks Raymond.  That may work for me.  I'll try it out.
> --
> Kevin
>
> On 4/20/07, Raymond Feng <[EMAIL PROTECTED] > wrote:
> >
> > Hi, Kevin,
> >
> > When one ore more deployable composites from a contribution are added
> > to the
> > SCA domain, all the components in the composite will become direct
> > children
> > of the SCA domain composite (the include semantics).
> >
> > Then similar code as follows will fit your case. Am I right?
> >
> > ComponentContext context =
> > SCARuntime.getComponentContext("CalculatorServiceComponent");
> > ServiceReference<CalculatorService> service =
> > context.createSelfReference(CalculatorService.class);
> > CalculatorService calculatorService = service.getService();
> >
> > Thanks,
> > Raymond
> >
> > ----- Original Message -----
> > From: "Kevin Williams" < [EMAIL PROTECTED]>
> > To: < tuscany-dev@ws.apache.org>
> > Sent: Friday, April 20, 2007 2:03 PM
> > Subject: cross-composite locate service
> >
> >
> > >I am interested in a way to dynamically find and invoke a service
> > within
> > >the
> > > Domain without having access to a pre-defined reference.  This is
> > not
> > > called
> > > out in the 1.0 specification but it would be a very useful
> > capability.  It
> > > also seems that many of the pieces required to implement this may
> > soon be
> > > in
> > > place; especially with the work around runtime simplification and
> > Domain
> > > proposed by Raymond in this thread:
> > >
> > > http://www.mail-archive.com/tuscany-dev%40ws.apache.org/msg16792.html
> >
> > >
> > > This also seems related to Scott's recent query regarding default
> > bindings
> > > across top level composites:
> > >
> > > * http://tinyurl.com/2xslxp*
> > >
> > > Any thoughts on this?  I would appreciate any pointers.
> > >
> > > Thanks!
> > >
> > > --Kevin
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

Reply via email to