Thanks Simon, so SCAClientFactory is the answer for "Accessing Services from 
non-SCA Component Implementations".

In my case, B could be a pure POJO or a POJO in Spring env. I think both of the 
cases can use SCAClientFactory to get a reference of C.

Thanks,
Richard

________________________________________
From: Simon Laws [[email protected]]
Sent: Thursday, March 03, 2011 11:18 AM
To: [email protected]
Subject: Re: Lookup SCA reference from POJO

On Thu, Mar 3, 2011 at 3:57 PM, Richard Yao <[email protected]> wrote:
> Hi,
>
> The question I am going to ask is a generic SCA question, I already posted it 
> in Fabric3 forum. I would like to ask help here as well.
>
> ---------------------------------------------------------------
>
> Let's say I have a test case is A calls B and B calls C.
>
> A is SCA component, A has a Spring POJO reference to B.
> B is POJO, B needs to call SCA component C.
> C is SCA component.
>
> My question is how B can "lookup" a SCA component C? My understanding is B is 
> POJO - not defined in composite file - I can not use SCA to inject a 
> reference of C into B.
>
> Thanks,
> Richard

Hi Richard

The OASIS version of SCA (what Tuscany 2.x code is based on) defines a
Java client that hides the look up for you. Talking generically you
can read about it in Section 5 of the Java Common Annotations and SPIs
specification [1].

From your scenario though what context is B running in? As A has a
Spring POJO reference to B does this mean B is a Java object in the
Spring environment?

[1] http://docs.oasis-open.org/opencsa/sca-j/sca-javacaa-1.1-spec.pdf

Regards

Simon

--
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to