You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Richard Yao <Ri...@teranet.ca> on 2011/03/03 16:57:41 UTC

Lookup SCA reference from POJO

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

RE: Lookup SCA reference from POJO

Posted by Richard Yao <Ri...@teranet.ca>.
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 [simonslaws@googlemail.com]
Sent: Thursday, March 03, 2011 11:18 AM
To: user@tuscany.apache.org
Subject: Re: Lookup SCA reference from POJO

On Thu, Mar 3, 2011 at 3:57 PM, Richard Yao <Ri...@teranet.ca> 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


Re: Lookup SCA reference from POJO

Posted by Simon Laws <si...@googlemail.com>.
On Thu, Mar 3, 2011 at 3:57 PM, Richard Yao <Ri...@teranet.ca> 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