Hi Antonio

..snip
> 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.
>

There are two ways to access SCA component from non-SCA applications.

Firstly you could put a remote binding, like web services or RMI, on
the SCA service and then access the service remotely from you client.
I'm assuming in this case that you've started a Tuscany node from the
command line to run the application

Secondly, if you're starting a node programmatically, then we provide
a client API for retrieving proxies to local SCA services.
Communication between the proxy and the service will use the SCA
binding in this case. You can see an example of how to get a proxy
using the Client API here
(http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/samples/calculator/src/test/java/calculator/CalculatorTestCase.java).
This example also shows the node being created programmatically using
the node factory.

>
> 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?
>

I think it should be possible assuming that the other library has
access to the Tuscany libraries. Where is the null pointer happening?

Regards

Simon

Reply via email to