IMHO, your architectural design should be revisited. the short answer is that Yes you can do it and I'll explain how. The long answer is that OSGi is a system that treats its parts as a module and communicate with them through native busses, so it may wrap them and handle any state of their runtime. NodeJS in either way, it has its own Runtime environment and more important it's a different platform. So OSGi can operate with a different platforms and more especially if not OSGi modules are not wrapped by the same OSGi.
The solution to your case it's simple, as you may start your nodeJS with the process builder ( I've describe it in my previous post ), and build an OSGi module tha communicate with node though a message broker. From my experience I'd suggest you to use ActiveMQ as a broker and Apache-Camel to your OSGi module. NodeJS can implement the Stomp protocol which is supported by activeMQ and is simple enough to start your production soon enough. Without the OSGi implementation I have test a NodeJS<->ActiveMQ<->Apache Camel communication and reached 6k TPS. Cheers! On Mon, Dec 10, 2012 at 8:36 PM, prashant pandey <[email protected]>wrote: > Hi Alan, > > thanks for your time. > Let me tell bit more about the use-case. I want to run the nodeJs program > inside OSGi (equinox). For that matter I would need a plugin bundle of > NodeJs library to be loaded inside OSGi. Is there a way to that? > > Thanks, > Prashant > > On Sunday, December 9, 2012 2:31:30 AM UTC+5:30, Alan Gutierrez wrote: >> >> Excellent guidance from everyone. I wanted to add... >> >> Just run node as a child process of your JVM application. The node >> executable is small and easy to redistribute. Node now runs in as many >> places as the JVM. I find that the promise of write once, run everywhere >> is easier to realize with Node.js than with Java. >> >> -- >> Alan Gutierrez - @bigeasy >> >> On 12/7/12 7:14 PM, Rick Waldron wrote: >> > I believe Nashorn purports to be a Node compatible JS engine on the JVM >> > >> > https://oracleus.activeevents.**com/connect/sessionDetail.ww?** >> SESSION_ID=6661&tclass=popup<https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=6661&tclass=popup> >> > http://www.theregister.co.uk/**2012/11/27/project_nashorn_** >> server_javascript/<http://www.theregister.co.uk/2012/11/27/project_nashorn_server_javascript/> >> > http://www.oracle.com/javaone/**lad-en/session-presentations/** >> clientside/24821-enok-1439095.**pdf<http://www.oracle.com/javaone/lad-en/session-presentations/clientside/24821-enok-1439095.pdf> >> > (in case it's not obvious, this one is a pdf) >> > >> > Rick >> > >> > >> > >> > >> > On Fri, Dec 7, 2012 at 5:03 PM, Ilya Dmitrichenko >> > <[email protected] <mailto:errorde...@gmail.**com>> wrote: >> > >> > Yeah, you should also checkout vert.x (http://vertx.io/) >> > >> > >> > On 7 December 2012 21:57, Forrest L Norvell <[email protected] >> > <mailto:[email protected]>> wrote: >> > >> > On Fri, Dec 7, 2012 at 11:03 AM, prashant pandey >> > <[email protected] <mailto:prashan...@gmail.**com>> >> > wrote: >> > >> > I want to know has anyone tried to run NodeJs inside JVM? >> Or >> > is there any specific approach we need to employ to get >> this >> > done? >> > >> > >> > Since Node is only partly the JavaScript code of the standard >> > library and predominantly the compiled native code of V8 and >> > libuv, embedding Node in a JVM is likely to be quite a >> > challenge. Is there a reason you can't just use straight Node, >> > or alternately can't use something like Ringo with Nitro? >> >> -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
