Hi, i'm working with java and tuscany 1.4 and tuscany 1.5 i have a  2
question about accessing SCA services

1) if i want to access to sca component from non-sca client, in the Java
common annotations and Apis specification is specified:

"
Non-SCA client code can use the ComponentContext API to perform operations
against a component in an SCA domain. How client code obtains a reference to
a ComponentContext is runtime specific. The following example demonstrates
the use of the component Context API by non-SCA code:

ComponentContext context = // obtained through host environment-specific
means
HelloService helloService =
context.getService(HelloService.class,"HelloService");
String result = helloService.hello("Hello World!");
"

but i don't know how obtained the "context". Is there an api that i've not
seen or an example how to do it? thanks a lot.


2) I have this scenario: 3 Component A, B,C  C send is ServiceReference to B
(Cref=context.createSelfReference(..) and B.registerReference(Cref)), A is a
part of code non SCA for example ia have a library that when it's necessary
launch A compoentn (nodelauncher.CreateNode(...)) A receive a Cref from B,
if A use Cref  to access C service it's Ok, bui if i use Cref in other
library method (example:  ReceivedCref=A.getCref();
ReceiveCref.getService().somemethod()) i receive a
java.lang.NullPoinerException. How can i use a Cref without using A services
in other library method if is it  possible?

Thanks.

Reply via email to