Script components using untyped properties, references etc (was: Re: Ruby extension, was Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
The C++ containers allow script components to use things like properties which are untyped, I'd really like to also support this for the Java runtime as fits in well with the untyped dynamic nature of scripting languages. I'd looked at this before but it didn't seem so easy to do with the old M1 runtime, any objections to getting it to work with the new code? ...ant On 9/12/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: ant elder wrote: [snip] So the services, references and properties are untyped right? ...ant Yes -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Venkat, on IRC we were talking about how to introspect JRuby components, after playing about with this i think you can call getMetaClass().getMethods() on the IRubyObject rubyInstance. That gives a map of the methods and it looks like that includeds a method name ending in = for the attr_writer ones. For example if in your script you have attr_writer :foo then the method map will contain a method with key foo=. ...ant On 9/11/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi, This time around I am stuck with passing java object instances to ruby. I need this to enable service reference calls from Ruby. I want to be able to pass to ruby an instance of a Java proxy to an external service (say StockQuote). Then from ruby I want to make service method calls over this proxy. I have tried setting the java object to a ruby global variable, after converting the java object to a ruby object ofcourse. But this does not work as it seems like I must instantiate the object from within the ruby context. Is there any other way to do this? - Thanks - Venkat On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi Simon, Jean-Sebastien and Ant, Thanks. I see it working now :-). The leads that each of you gave is all that is to it. Ant, I will put in a patch with this update soon. Thanks for taking the pains and trying it yourself. - Venkat On 9/8/06, ant elder [EMAIL PROTECTED] wrote: After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript (getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript (getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
With the change in r442461 you say ComponentType files are now optional and the Ruby implementation now automatically creates a default serviceType and referenceTypes as needed. Could you say a bit about how that works so we can try and do the same for the Java runtime? ...ant On 9/11/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi, This time around I am stuck with passing java object instances to ruby. I need this to enable service reference calls from Ruby. I want to be able to pass to ruby an instance of a Java proxy to an external service (say StockQuote). Then from ruby I want to make service method calls over this proxy. I have tried setting the java object to a ruby global variable, after converting the java object to a ruby object ofcourse. But this does not work as it seems like I must instantiate the object from within the ruby context. Is there any other way to do this? - Thanks - Venkat On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi Simon, Jean-Sebastien and Ant, Thanks. I see it working now :-). The leads that each of you gave is all that is to it. Ant, I will put in a patch with this update soon. Thanks for taking the pains and trying it yourself. - Venkat On 9/8/06, ant elder [EMAIL PROTECTED] wrote: After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript (getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript(getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do
Ruby extension, was Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
ant elder wrote: [snip] With the change in r442461 you say ComponentType files are now optional and the Ruby implementation now automatically creates a default serviceType and referenceTypes as needed. Could you say a bit about how that works so we can try and do the same for the Java runtime? ...ant The RubyCalculator sample under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/sample.calculator/ shows the programming model for Ruby, as implemented in the Tuscany/C++ Ruby extension: - A client can get a proxy to a service with: require(libtuscany_sca_ruby) and calculator = SCA::locateService(CalculatorComponent/CalculatorService) - You then simply call a business method on calculator, like this: x = calculator.add(1, 2) - A Ruby component is implemented by either functions in a Ruby module or a Ruby class, like this: component name=CalculatorComponent implementation.ruby script=CalculatorImpl.rb class=CalculatorImpl/ /component - Public attributes of a Ruby component implementation class can be wired to target services, like this: class CalculatorImpl attr_writer :divideService def div(arg1, arg2) print Ruby - CalculatorImpl.div\n @divideService.divide(arg1, arg2) end end and in your composite file: component name=CalculatorComponent implementation.ruby script=CalculatorImpl.rb class=CalculatorImpl/ reference name=divideServiceDivideComponent/DivideService/reference /component - Public attributes of a Ruby component implementation class can be configured as component properties, like this: class DivideImpl attr_writer :round def divide(arg1, arg2) res = arg1.to_f / arg2.to_f if @round then res = res.round end res end and in your composite file: component name=DivideComponent implementation.ruby script=DivideImpl.rb class=DivideImpl/ property name=roundtrue/property /component Lastly, you can write a componentType file for your Ruby component, but you don't have to, the Ruby extension introspects Ruby component implementation classes for you and binds public attributes to references and properties. The runtime extension uses the Ruby C API. The Ruby interpreter is written in C with a nice API so it's a pretty good fit. I'm not sure how much of the design you can transpose to JRuby, but here's a summary: - The Tuscany C++ Ruby extension embeds the Ruby interpreter. This allows the runtime to run a Ruby component from any other SCA component, the Axis2 HTTP server or the Axis2 Apache mod when running behind the HTTP server. - The extension also acts as a Ruby extension library, to allow standalone Ruby scripts to invoke SCA services. - SCA::locateService is declared to Ruby as a module function in module SCA. Again I am using the Ruby C API to declare the module and the function. - I am also using the Ruby C API to introspect each Ruby component implementation class, find public setter methods, and the Ruby attributes to SCA references and properties. - SCA references are handled by a Ruby proxy class, defined by the extension (written in C), which exposes a Ruby interface and dispatches all calls to the C++ runtime to handle the SCA invocation. - The extension currently handles the conversion of simple types between Ruby and C types. I'll probably map DataObjects to Ruby strings for now unless somebody is interested in implementing an SDO Ruby language binding. The code of the Tuscany/C++ Ruby extension is there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ Hope this helps... -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby extension, was Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
So the services, references and properties are untyped right? ...ant On 9/12/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: ant elder wrote: [snip] With the change in r442461 you say ComponentType files are now optional and the Ruby implementation now automatically creates a default serviceType and referenceTypes as needed. Could you say a bit about how that works so we can try and do the same for the Java runtime? ...ant The RubyCalculator sample under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/sample.calculator/ shows the programming model for Ruby, as implemented in the Tuscany/C++ Ruby extension: - A client can get a proxy to a service with: require(libtuscany_sca_ruby) and calculator = SCA::locateService(CalculatorComponent/CalculatorService) - You then simply call a business method on calculator, like this: x = calculator.add(1, 2) - A Ruby component is implemented by either functions in a Ruby module or a Ruby class, like this: component name=CalculatorComponent implementation.ruby script=CalculatorImpl.rb class=CalculatorImpl/ /component - Public attributes of a Ruby component implementation class can be wired to target services, like this: class CalculatorImpl attr_writer :divideService def div(arg1, arg2) print Ruby - CalculatorImpl.div\n @divideService.divide(arg1, arg2) end end and in your composite file: component name=CalculatorComponent implementation.ruby script=CalculatorImpl.rb class=CalculatorImpl/ reference name=divideServiceDivideComponent/DivideService/reference /component - Public attributes of a Ruby component implementation class can be configured as component properties, like this: class DivideImpl attr_writer :round def divide(arg1, arg2) res = arg1.to_f / arg2.to_f if @round then res = res.round end res end and in your composite file: component name=DivideComponent implementation.ruby script=DivideImpl.rb class=DivideImpl/ property name=roundtrue/property /component Lastly, you can write a componentType file for your Ruby component, but you don't have to, the Ruby extension introspects Ruby component implementation classes for you and binds public attributes to references and properties. The runtime extension uses the Ruby C API. The Ruby interpreter is written in C with a nice API so it's a pretty good fit. I'm not sure how much of the design you can transpose to JRuby, but here's a summary: - The Tuscany C++ Ruby extension embeds the Ruby interpreter. This allows the runtime to run a Ruby component from any other SCA component, the Axis2 HTTP server or the Axis2 Apache mod when running behind the HTTP server. - The extension also acts as a Ruby extension library, to allow standalone Ruby scripts to invoke SCA services. - SCA::locateService is declared to Ruby as a module function in module SCA. Again I am using the Ruby C API to declare the module and the function. - I am also using the Ruby C API to introspect each Ruby component implementation class, find public setter methods, and the Ruby attributes to SCA references and properties. - SCA references are handled by a Ruby proxy class, defined by the extension (written in C), which exposes a Ruby interface and dispatches all calls to the C++ runtime to handle the SCA invocation. - The extension currently handles the conversion of simple types between Ruby and C types. I'll probably map DataObjects to Ruby strings for now unless somebody is interested in implementing an SDO Ruby language binding. The code of the Tuscany/C++ Ruby extension is there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ Hope this helps... -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby extension, was Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
ant elder wrote: [snip] So the services, references and properties are untyped right? ...ant Yes -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Hi, This time around I am stuck with passing java object instances to ruby. I need this to enable service reference calls from Ruby. I want to be able to pass to ruby an instance of a Java proxy to an external service (say StockQuote). Then from ruby I want to make service method calls over this proxy. I have tried setting the java object to a ruby global variable, after converting the java object to a ruby object ofcourse. But this does not work as it seems like I must instantiate the object from within the ruby context. Is there any other way to do this? - Thanks - Venkat On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi Simon, Jean-Sebastien and Ant, Thanks. I see it working now :-). The leads that each of you gave is all that is to it. Ant, I will put in a patch with this update soon. Thanks for taking the pains and trying it yourself. - Venkat On 9/8/06, ant elder [EMAIL PROTECTED] wrote: After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript (getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript(getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes( company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Venkata Krishnan wrote: Hi, This time around I am stuck with passing java object instances to ruby. I need this to enable service reference calls from Ruby. I want to be able to pass to ruby an instance of a Java proxy to an external service (say StockQuote). Then from ruby I want to make service method calls over this proxy. I have tried setting the java object to a ruby global variable, after converting the java object to a ruby object ofcourse. But this does not work as it seems like I must instantiate the object from within the ruby context. Is there any other way to do this? - Thanks - Venkat On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi Simon, Jean-Sebastien and Ant, Thanks. I see it working now :-). The leads that each of you gave is all that is to it. Ant, I will put in a patch with this update soon. Thanks for taking the pains and trying it yourself. - Venkat On 9/8/06, ant elder [EMAIL PROTECTED] wrote: After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript (getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript(getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes( company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles.
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Thanks Jean-Sebastien. Will watch for that. On 9/12/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi, This time around I am stuck with passing java object instances to ruby. I need this to enable service reference calls from Ruby. I want to be able to pass to ruby an instance of a Java proxy to an external service (say StockQuote). Then from ruby I want to make service method calls over this proxy. I have tried setting the java object to a ruby global variable, after converting the java object to a ruby object ofcourse. But this does not work as it seems like I must instantiate the object from within the ruby context. Is there any other way to do this? - Thanks - Venkat On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi Simon, Jean-Sebastien and Ant, Thanks. I see it working now :-). The leads that each of you gave is all that is to it. Ant, I will put in a patch with this update soon. Thanks for taking the pains and trying it yourself. - Venkat On 9/8/06, ant elder [EMAIL PROTECTED] wrote: After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript (getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript(getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes( company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes(company.xsd); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the relational DAS is quite different from the current java implementation. Regards Simon
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes(company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the relational DAS is quite different from the current java implementation. Regards Simon
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
On 9/8/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes(company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the relational DAS is quite different from the current java implementation. Regards Simon Hi Venkat I'm not sure that this helps at all but I just took a look at what Sebastien did in C++ string expr = impl-getClass() + .new; VALUE instance = rb_eval_string(expr.c_str()); // Get the ID of the specified method ID method = rb_intern(operation.getName().c_str()); When it comes time to actually call the method // Invoke the specified method VALUE value; if (n == 0) { value = rb_funcall(instance, method, 0); } else { value = rb_funcall2(instance, method, n, args); } So he seems to be able to deal with the class instance in C++. This is the script he used to test with in the C++ Calculator sample. class DivideImpl def initialize() print Ruby - DivideImpl.initialize\n end def divide(arg1, arg2) print Ruby - DivideImpl.divide\n arg1 / arg2 end end Sebastien is the man to ask really as he build the Ruby extension. He will be able to give you the gory details no doubt when he comes on line. S
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes(company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the relational DAS is quite different from the current java implementation. Regards Simon Venkat, I'm not sure how you do with thiw JRuby, but you should call the target method on an instance of the Ruby component implementation class, not on the class itself. So do something like: 1. invoke Calculator.new and get an object representing your Ruby object 2. get an object representing the add method 3. invoke that method on the Ruby instance -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
After playing around with this I think what Simon and Jean-Sebastien have already said is correct, its the .new that does it. Right now the createInstance method is: public RubyScriptInstance createScriptInstance() { return new RubyScriptInstance(rubyEngine.evalScript(getScript()), responseClasses); } Assuming you add a class attribute to the scdl and store that value in a className field in RubyScript then I think the following should work: public RubyScriptInstance createScriptInstance() { IRubyObject rubyInstance = rubyEngine.evalScript(getScript()); if (className != null) { rubyInstance = rubyEngine.evalScript (className + .new); } return new RubyScriptInstance(rubyInstance , responseClasses); } ...ant On 9/8/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Venkata Krishnan wrote: Hi The current implementation of Ruby in Java works only for scripts that have global methods. I am interested getting this work for methods inside classes.. But then I am not able to figure out a way of doing this. Can somebody help me with clues on the following... maybe even if the C++ guys are able to provide me some hints conceptually I can map it to the JRuby stuff. Here is what I do... 1) I load the script into the Ruby engine and get a RubyObject out of it 2) call the invoke method on the Ruby object to invoke the Ruby functions - in this invoke method there is no way I am able to specify the RubyClass whos method I should invoke. All that it takes is the method name as a string. I tried using ruby classname.ruby methodname for the method argument but failed. So how do I specify the class? Thanks - Venkat On 9/8/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/8/06, ant elder [EMAIL PROTECTED] wrote: Yes we should be able to do the same type of thing with Java. Is the PHP SDO API the same as the C++ API or is it simplified? I think for most if not all the Java based scripting languages we can just expose the Java SDO API to the scripting language (at one point we had a JavaScript version of the Big Bank sample account module that did this), but there are probably ways to use the dynamic nature of the script languages to come up with a simplify SDO API. ...ant On 9/7/06, Simon Laws [EMAIL PROTECTED] wrote: In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S The SDO API in PHP is fairly similar to the C++ SDO but is simplified and in particular it tries to take avantage of the features of PHP so that it is comfortable to use for the PHP programmer. For example, a typical user of the XML DAS might do $xmldas-addTypes(company.xsd ); $document = $xmldas-loadFile(company.xml); $company = $document-getRootDataObject(); $company_name = $company-name; // property access style $company_name = $company['name']; // associative array access style $company_name = $company[0];// index array access style The trick is make the experience as natural for the script developer as possible so we have, for example, provided all the normal PHP object access styles. Also our user space implementation of the relational DAS is quite different from the current java implementation. Regards Simon Venkat, I'm not sure how you do with thiw JRuby, but you should call the target method on an instance of the Ruby component implementation class, not on the class itself. So do something like: 1. invoke Calculator.new and get an object representing your Ruby object 2. get an object representing the add method 3. invoke that method on the Ruby instance -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Hi.. I have posted an initial slim implementation for this. Ant, could you please take a look and let me know if this is ok. Further enhancements to this can go in iteratively. Thanks http://issues.apache.org/jira/browse/TUSCANY-704 - Venkat On 9/6/06, Robbie Minshall [EMAIL PROTECTED] wrote: Sounds great. When Venkat is done with his port I would be interested in helping. Perhaps a sample demonstrating interopt between services with different language implementations. If we are using SDO for our data model how will SDO support be provided in these container extensions ? Robbie On 9/6/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi... I am interested in taking a look at this. I hope to get a feel of implementing container extensions through this. I shall get started with this rightaway. Ant, I might need your help for this after I do some ground work. Thanks. - Venkat On 9/6/06, ant elder [EMAIL PROTECTED] wrote: Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- * * * Charlie * * * Check out some pics of little Charlie at http://www.flickr.com/photos/[EMAIL PROTECTED]/sets/ * * * Addresss * * * 1914 Overland Drive Chapel Hill NC 27517 * * * Number * * * 919-225-1553
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Robbie, your help would be much appreciated so please feel free to jump in. Do you have specific samples or interop things you'd like to look at? Want me to suggest some things, or bounce some ideas around on IRC/mailing list? ...ant On 9/6/06, Robbie Minshall [EMAIL PROTECTED] wrote: Sounds great. When Venkat is done with his port I would be interested in helping. Perhaps a sample demonstrating interopt between services with different language implementations. If we are using SDO for our data model how will SDO support be provided in these container extensions ? Robbie On 9/6/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi... I am interested in taking a look at this. I hope to get a feel of implementing container extensions through this. I shall get started with this rightaway. Ant, I might need your help for this after I do some ground work. Thanks. - Venkat On 9/6/06, ant elder [EMAIL PROTECTED] wrote: Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- * * * Charlie * * * Check out some pics of little Charlie at http://www.flickr.com/photos/[EMAIL PROTECTED]/sets/ * * * Addresss * * * 1914 Overland Drive Chapel Hill NC 27517 * * * Number * * * 919-225-1553
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
On 9/7/06, ant elder [EMAIL PROTECTED] wrote: Robbie, your help would be much appreciated so please feel free to jump in. Do you have specific samples or interop things you'd like to look at? Want me to suggest some things, or bounce some ideas around on IRC/mailing list? ...ant On 9/6/06, Robbie Minshall [EMAIL PROTECTED] wrote: Sounds great. When Venkat is done with his port I would be interested in helping. Perhaps a sample demonstrating interopt between services with different language implementations. If we are using SDO for our data model how will SDO support be provided in these container extensions ? Robbie On 9/6/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi... I am interested in taking a look at this. I hope to get a feel of implementing container extensions through this. I shall get started with this rightaway. Ant, I might need your help for this after I do some ground work. Thanks. - Venkat On 9/6/06, ant elder [EMAIL PROTECTED] wrote: Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- * * * Charlie * * * Check out some pics of little Charlie at http://www.flickr.com/photos/[EMAIL PROTECTED]/sets/ * * * Addresss * * * 1914 Overland Drive Chapel Hill NC 27517 * * * Number * * * 919-225-1553 In PHP we have an implementation of SDO that is fully based on the C++ SDO implementation. I'm not sure if it will be instructive in the java space but we have pretty much just wrapped the C++ SDO interfaces and exposed them as native PHP objects. I guess you would have to do a similar thing in Ruby or any other extension for that matter. The solution will depend on how you construct extensions to your scripting language. In PHP it just so happens you have to do it in C/C++ but I would hope you can do it in Java for JVM based environments. S
Re: [C++] Beginning of a Ruby extension available
On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Wow, extensions galore:-)
Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Hi... I am interested in taking a look at this. I hope to get a feel of implementing container extensions through this. I shall get started with this rightaway. Ant, I might need your help for this after I do some ground work. Thanks. - Venkat On 9/6/06, ant elder [EMAIL PROTECTED] wrote: Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [C++] Beginning of a Ruby extension available
On 9/6/06, Simon Laws [EMAIL PROTECTED] wrote: On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Wow, extensions galore:-) The extension enabling work that Pete and Sebastien did seems to be working well :-)
Re: Ruby for the Java runtime? (was: Re: [C++] Beginning of a Ruby extension available)
Sounds great. When Venkat is done with his port I would be interested in helping. Perhaps a sample demonstrating interopt between services with different language implementations. If we are using SDO for our data model how will SDO support be provided in these container extensions ? Robbie On 9/6/06, Venkata Krishnan [EMAIL PROTECTED] wrote: Hi... I am interested in taking a look at this. I hope to get a feel of implementing container extensions through this. I shall get started with this rightaway. Ant, I might need your help for this after I do some ground work. Thanks. - Venkat On 9/6/06, ant elder [EMAIL PROTECTED] wrote: Quite a while back we had a Ruby container contributed for the Java runtime, see TUSCANY-365. Is anyone interested in looking at porting that to the new Java runtime and getting it to match what the C++ guys are doing? ...ant On 9/6/06, Jean-Sebastien Delfino [EMAIL PROTECTED] wrote: Hi all, I just checked in the beginning of a Ruby extension under http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/runtime/extensions/ruby/ . It is not complete but it allows you to declare an SCA component implemented by a Ruby class with for example: component implementation.ruby script=DivideImpl.rb class=DivideImpl/ /component Support for references, properties and scopes is not there yet but the basic mechanism for invoking a component implemented in Ruby is there. A version of the Calculator sample implementing the Divide component in Ruby is available there: http://svn.apache.org/repos/asf/incubator/tuscany/cpp/sca/samples/RubyCalculator/ . I have tested this on Linux, and can help test on Windows as well as soon as we get a good build of SDO and the SCA runtime with Visual Studio Express 2005. -- Jean-Sebastien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- * * * Charlie * * * Check out some pics of little Charlie at http://www.flickr.com/photos/[EMAIL PROTECTED]/sets/ * * * Addresss * * * 1914 Overland Drive Chapel Hill NC 27517 * * * Number * * * 919-225-1553