You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Judah Diament <jd...@gmail.com> on 2007/01/10 01:23:37 UTC

[C++] src & runtime questions

Hi,

I appologize for the newbie nature of these questions, but I am
starting to dive into the Tuscany C++ source code and wanted to know
the following:

1) in tuscany/sca/core, what is the difference between
TuscanyRuntime.h/cpp and SCARuntime.h/cpp - what role do each of these
play?

2) what is a default Component for a system?

3) Any general advice on what route to take through the source code to
get a good understanding of the guts of Tuscany C++?

thanks!!
Judah

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] src & runtime questions

Posted by Pete Robbins <ro...@googlemail.com>.
Hi Judah,

scagen is a tool that generates C++ code for service proxies and wrappers.
It's inputs are the component definitions from the scdl files and it looks
at the C++ service interface header files. These proxies/wrappers are
compiled in to the implementation dll.

Cheers,

On 10/01/07, Judah Diament <jd...@gmail.com> wrote:
>
> thanks JS - very useful!
>
> another question: what does scagen do in the tuscant C++ build?
>
> thanks,
> Judah
>
> On 1/9/07, Jean-Sebastien Delfino <js...@apache.org> wrote:
> > Judah Diament wrote:
> > > Hi,
> > >
> >
> > Welcome!
> >
> > > I appologize for the newbie nature of these questions, but I am
> > > starting to dive into the Tuscany C++ source code and wanted to know
> > > the following:
> > >
> > > 1) in tuscany/sca/core, what is the difference between
> > > TuscanyRuntime.h/cpp and SCARuntime.h/cpp - what role do each of these
> > > play?
> >
> > SCARuntime is internal to the SCA runtime and represents a particular
> > runtime instance, configured to work off a specific runtime install dir,
> > a specific path to look for SCA composites etc.
> >
> > TuscanyRuntime is a wrapper for SCARuntime, offering a public Tuscany
> > API that people who write SCA application components in C++ can use to
> > start/stop an SCA runtime. We are providing this start/stop capability
> > to C++ application developers as a Tuscany API in the tuscany::sca::cpp
> > namespace as the OSOA SCA spec does not define one in osoa::sca.
> > TuscanyRuntime is used in client environments where you need to start
> > the SCA runtime yourself from your main method for example. You do not
> > need to use it in a server environment, where our server integration
> > kicks in and boots an... SCARuntime for you.
> >
> > >
> > > 2) what is a default Component for a system?
> > >
> > The "default" component (a better term may be "main component") is the
> > (composite) component that the runtime puts you in when you start it,
> > allowing you to do things like
> > CompositeContext::getCurrent().locateService("...") within the context
> > of that composite component.
> >
> > For example, given a sample.calculator composite (assembling a bunch of
> > components to form a calculator):
> > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> >     name="sample.calculator">
> >
> >     <service name="CalculatorService">
> >         <interface.wsdl
> > interface="http://sample/calculator#wsdl.interface(Calculator)"/>
> >         <binding.ws/>
> >         <reference>CalculatorComponent</reference>
> >     </service>
> >
> >     <component name="CalculatorComponent">
> >         <implementation.ruby script="CalculatorImpl.rb"
> > class="CalculatorImpl"/>
> >         <reference name="divideService">DivideComponent</reference>
> >     </component>
> >
> >     <component name="DivideComponent">
> >         <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/>
> >         <property name="round">true</property>
> >     </component>
> >
> > </composite>
> >
> > And another sample.calculator.app composite, used to contribute to the
> > SCA system a component sample.calculator.CalculatorComponent, instance
> > of the sample.calculator composite.
> > <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> >     name="sample.calculator.app">
> >
> >         <component name="sample.calculator.CalculatorComponent">
> >             <implementation.composite name="sample.calculator" />
> >            </component>
> >
> > </composite>
> >
> > To execute the following code:
> >
> > require("tuscany_sca_ruby")
> > calculator = SCA::locateService("CalculatorComponent") <-- Ruby
> > equivalent of the C++ CompositeContext::getCurrent().locateService(...)
> > x = calculator.div(5, 2)
> > print x, "\n"
> >
> > ... the runtime needs to know in which composite component context it
> > executes, in other words what it's "main" or "default" component is, and
> > where to start from in the SCA composition hierarchy.
> >
> > > 3) Any general advice on what route to take through the source code to
> > > get a good understanding of the guts of Tuscany C++?
> >
> > Running the CppCalculator sample and in particular the client at
> >
> http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/CppCalculator/sample.calculator.client/
> > through a debugger will walk you through the init of the runtime, the
> > loading of SCDL, the assembly of the composites and the dispatching of a
> > service invocation through client -> client proxy -> service wrapper ->
> > target service.
> >
> > For an alternate component implementation type, check the RubyCalculator
> > or PythonCalculator samples under
> > http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples.
> >
> > To browse the code and understand its structure, you can use the Doxygen
> > docs at http://people.apache.org/~jsdelfino/doxygen-cpp/, they contain
> > class hierarchy and collaboration diagrams and a complete copy of the
> > code formatted for browsing.
> >
> > >
> > > thanks!!
> > > Judah
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> > >
> > >
> >
> > Hope this helps...
> >
> > --
> > Jean-Sebastien
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>


-- 
Pete

Re: [C++] src & runtime questions

Posted by Judah Diament <jd...@gmail.com>.
thanks JS - very useful!

another question: what does scagen do in the tuscant C++ build?

thanks,
Judah

On 1/9/07, Jean-Sebastien Delfino <js...@apache.org> wrote:
> Judah Diament wrote:
> > Hi,
> >
>
> Welcome!
>
> > I appologize for the newbie nature of these questions, but I am
> > starting to dive into the Tuscany C++ source code and wanted to know
> > the following:
> >
> > 1) in tuscany/sca/core, what is the difference between
> > TuscanyRuntime.h/cpp and SCARuntime.h/cpp - what role do each of these
> > play?
>
> SCARuntime is internal to the SCA runtime and represents a particular
> runtime instance, configured to work off a specific runtime install dir,
> a specific path to look for SCA composites etc.
>
> TuscanyRuntime is a wrapper for SCARuntime, offering a public Tuscany
> API that people who write SCA application components in C++ can use to
> start/stop an SCA runtime. We are providing this start/stop capability
> to C++ application developers as a Tuscany API in the tuscany::sca::cpp
> namespace as the OSOA SCA spec does not define one in osoa::sca.
> TuscanyRuntime is used in client environments where you need to start
> the SCA runtime yourself from your main method for example. You do not
> need to use it in a server environment, where our server integration
> kicks in and boots an... SCARuntime for you.
>
> >
> > 2) what is a default Component for a system?
> >
> The "default" component (a better term may be "main component") is the
> (composite) component that the runtime puts you in when you start it,
> allowing you to do things like
> CompositeContext::getCurrent().locateService("...") within the context
> of that composite component.
>
> For example, given a sample.calculator composite (assembling a bunch of
> components to form a calculator):
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>     name="sample.calculator">
>
>     <service name="CalculatorService">
>         <interface.wsdl
> interface="http://sample/calculator#wsdl.interface(Calculator)"/>
>         <binding.ws/>
>         <reference>CalculatorComponent</reference>
>     </service>
>
>     <component name="CalculatorComponent">
>         <implementation.ruby script="CalculatorImpl.rb"
> class="CalculatorImpl"/>
>         <reference name="divideService">DivideComponent</reference>
>     </component>
>
>     <component name="DivideComponent">
>         <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/>
>         <property name="round">true</property>
>     </component>
>
> </composite>
>
> And another sample.calculator.app composite, used to contribute to the
> SCA system a component sample.calculator.CalculatorComponent, instance
> of the sample.calculator composite.
> <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>     name="sample.calculator.app">
>
>         <component name="sample.calculator.CalculatorComponent">
>             <implementation.composite name="sample.calculator" />
>            </component>
>
> </composite>
>
> To execute the following code:
>
> require("tuscany_sca_ruby")
> calculator = SCA::locateService("CalculatorComponent") <-- Ruby
> equivalent of the C++ CompositeContext::getCurrent().locateService(...)
> x = calculator.div(5, 2)
> print x, "\n"
>
> ... the runtime needs to know in which composite component context it
> executes, in other words what it's "main" or "default" component is, and
> where to start from in the SCA composition hierarchy.
>
> > 3) Any general advice on what route to take through the source code to
> > get a good understanding of the guts of Tuscany C++?
>
> Running the CppCalculator sample and in particular the client at
> http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/CppCalculator/sample.calculator.client/
> through a debugger will walk you through the init of the runtime, the
> loading of SCDL, the assembly of the composites and the dispatching of a
> service invocation through client -> client proxy -> service wrapper ->
> target service.
>
> For an alternate component implementation type, check the RubyCalculator
> or PythonCalculator samples under
> http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples.
>
> To browse the code and understand its structure, you can use the Doxygen
> docs at http://people.apache.org/~jsdelfino/doxygen-cpp/, they contain
> class hierarchy and collaboration diagrams and a complete copy of the
> code formatted for browsing.
>
> >
> > thanks!!
> > Judah
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>
> Hope this helps...
>
> --
> Jean-Sebastien
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: [C++] src & runtime questions

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Judah Diament wrote:
> Hi,
>

Welcome!

> I appologize for the newbie nature of these questions, but I am
> starting to dive into the Tuscany C++ source code and wanted to know
> the following:
>
> 1) in tuscany/sca/core, what is the difference between
> TuscanyRuntime.h/cpp and SCARuntime.h/cpp - what role do each of these
> play?

SCARuntime is internal to the SCA runtime and represents a particular 
runtime instance, configured to work off a specific runtime install dir, 
a specific path to look for SCA composites etc.

TuscanyRuntime is a wrapper for SCARuntime, offering a public Tuscany 
API that people who write SCA application components in C++ can use to 
start/stop an SCA runtime. We are providing this start/stop capability 
to C++ application developers as a Tuscany API in the tuscany::sca::cpp 
namespace as the OSOA SCA spec does not define one in osoa::sca. 
TuscanyRuntime is used in client environments where you need to start 
the SCA runtime yourself from your main method for example. You do not 
need to use it in a server environment, where our server integration 
kicks in and boots an... SCARuntime for you.

>
> 2) what is a default Component for a system?
>
The "default" component (a better term may be "main component") is the 
(composite) component that the runtime puts you in when you start it, 
allowing you to do things like 
CompositeContext::getCurrent().locateService("...") within the context 
of that composite component.
 
For example, given a sample.calculator composite (assembling a bunch of 
components to form a calculator):
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
    name="sample.calculator">
 
    <service name="CalculatorService">
        <interface.wsdl 
interface="http://sample/calculator#wsdl.interface(Calculator)"/>
        <binding.ws/>
        <reference>CalculatorComponent</reference>
    </service>
 
    <component name="CalculatorComponent">
        <implementation.ruby script="CalculatorImpl.rb" 
class="CalculatorImpl"/>
        <reference name="divideService">DivideComponent</reference>
    </component>
        
    <component name="DivideComponent">
        <implementation.ruby script="DivideImpl.rb" class="DivideImpl"/>
        <property name="round">true</property>
    </component>
 
</composite>
 
And another sample.calculator.app composite, used to contribute to the 
SCA system a component sample.calculator.CalculatorComponent, instance 
of the sample.calculator composite.
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
    name="sample.calculator.app">
     
        <component name="sample.calculator.CalculatorComponent">
            <implementation.composite name="sample.calculator" />
           </component>
 
</composite>
 
To execute the following code:
 
require("tuscany_sca_ruby")
calculator = SCA::locateService("CalculatorComponent") <-- Ruby 
equivalent of the C++ CompositeContext::getCurrent().locateService(...)
x = calculator.div(5, 2)
print x, "\n"
 
... the runtime needs to know in which composite component context it 
executes, in other words what it's "main" or "default" component is, and 
where to start from in the SCA composition hierarchy.

> 3) Any general advice on what route to take through the source code to
> get a good understanding of the guts of Tuscany C++?

Running the CppCalculator sample and in particular the client at 
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/CppCalculator/sample.calculator.client/ 
through a debugger will walk you through the init of the runtime, the 
loading of SCDL, the assembly of the composites and the dispatching of a 
service invocation through client -> client proxy -> service wrapper -> 
target service.

For an alternate component implementation type, check the RubyCalculator 
or PythonCalculator samples under 
http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples.

To browse the code and understand its structure, you can use the Doxygen 
docs at http://people.apache.org/~jsdelfino/doxygen-cpp/, they contain 
class hierarchy and collaboration diagrams and a complete copy of the 
code formatted for browsing.

>
> thanks!!
> Judah
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Hope this helps...

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org