What Tuscany Object do you have as the starting point? 

If you bootstrap Tuscany using SCANodeFactory, you can look into 
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.5.1/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java.

There are two methods related:
getServiceReference()
getComposite()

If you use Tuscany web application, take a look at 
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.5.1/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java.
 There is an attribute set into the ServeletContext for the SCADomain object.

Thanks,
Raymond


From: Malujo Rev 
Sent: Friday, September 25, 2009 8:53 AM
To: [email protected] 
Subject: Re: Please give advice: query current composite info


I have been struggling this diffculty for many days. Hope any expert can help 
me out please.
Malujo


On Thu, Sep 24, 2009 at 4:16 PM, Malujo Rev <[email protected]> wrote:

  Thanks Raymond. I am using 1.4. What I want to do is that use a servlet or 
jsp to automatically list all components in that composite and then allow user 
to invoke some service through web. I don't know what is the best way to do it? 
I checked all the class provided, just cannot find some classes serving this 
kind of functions. please help.
  Thanks,
  Malujo 



  On Thu, Sep 24, 2009 at 2:57 PM, Raymond Feng <[email protected]> wrote:

    Which level of Tuscany are you using? 1.x (branches/sca-java-1.x) or 2.x 
(java/sca)?

    If you are using 2.x, how do you bootstrap Tuscany? Are you using 
NodeFactory.newInstance().createNode(...)? 
org.apache.tuscany.sca.node.impl.NodeImpl.getDomainComposite() can give you the 
information. But this method is not available on 
org.apache.tuscany.sca.node.Node interface. Node.getService() or 
org.oasisopen.sca.client.SCAClient.getService() allows you to get service 
proxies using <componentName>/<serviceName>, but you cannot list all the 
services.

    If you can give us more details about your scenario, we can probably work 
out a solution without hacking the current code.

    Thanks,
    Raymond


    From: Malujo Rev 
    Sent: Thursday, September 24, 2009 2:09 PM
    To: dev-tuscany 
    Subject: Please give advice: query current composite info


    Hi, 
    I am trying to build this little component which will automatically 
discover all components inside the current composite and then dynamic invoke 
whatever service available. I checked some doc, it seems 
CurrentCompositeContect class should serve this function. but it seems not 
exist any more. Do you know what java classes I can use for this purpose?
    Many Thanks ,
    Malujo



Reply via email to