Nanoko looks interesting, but inspecting the website it looks as if its modeled on OSGI, but doesn¹t support OSGI Java service injection into JS afaiks.
On 7/27/15, 6:00 PM, "osgi-dev-requ...@mail.osgi.org" <osgi-dev-requ...@mail.osgi.org> wrote: >Send osgi-dev mailing list submissions to > osgi-dev@mail.osgi.org > >To subscribe or unsubscribe via the World Wide Web, visit > https://mail.osgi.org/mailman/listinfo/osgi-dev >or, via email, send a message with subject or body 'help' to > osgi-dev-requ...@mail.osgi.org > >You can reach the person managing the list at > osgi-dev-ow...@mail.osgi.org > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of osgi-dev digest..." > > >Today's Topics: > > 1. Calling/Injecting OSGI Services in JavaScript (Frank Langel) > 2. Re: Calling/Injecting OSGI Services in JavaScript (Peter Kriens) > 3. Re: Calling/Injecting OSGI Services in JavaScript (Erg?der Bekrek) > > >---------------------------------------------------------------------- > >Message: 1 >Date: Mon, 27 Jul 2015 10:51:40 +0200 >From: Frank Langel <fr...@frankjlangel.com> >To: <osgi-dev@mail.osgi.org>, "us...@lists.amdatu.org" > <us...@lists.amdatu.org> >Subject: [osgi-dev] Calling/Injecting OSGI Services in JavaScript >Message-ID: <d1dbbdbc.2b9c5%fr...@frankjlangel.com> >Content-Type: text/plain; charset="us-ascii" > >Hello, > >I never was a big fan of Javascript due to lack of type support. With >TypeScript, things change a bit. In the future, I see two trends >* Javascript (TypeScript) is moving downwards from the web client into the >server and will be responsible for server based endpoint services (REST, >calling application objects, glueing) >* In 1-2 years, Java will move upwards taking the desktop with the help of >WebAssembly >For the current future, I was wondering if anyone has a sample how to >nicely >and elegantly inject OSGI service in/use from Javascript. > >Thanks in advance >Frank > > > >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: ><http://mail.osgi.org/pipermail/osgi-dev/attachments/20150727/e267e7bf/att >achment-0001.html> > >------------------------------ > >Message: 2 >Date: Mon, 27 Jul 2015 11:12:35 +0200 >From: Peter Kriens <peter.kri...@aqute.biz> >To: OSGi Developer Mail List <osgi-dev@mail.osgi.org> >Cc: "us...@lists.amdatu.org" <us...@lists.amdatu.org> >Subject: Re: [osgi-dev] Calling/Injecting OSGI Services in JavaScript >Message-ID: <bf72e158-a06e-42d8-8a7f-152f302cb...@aqute.biz> >Content-Type: text/plain; charset="utf-8" > >In OSGi enRoute there is JSON RPC support and uses the Angular service >model. So in that model you can create a service in OSGi: > > > @Component > public class MyComp implements JSONRPC { > public Object getDescriptor() { > // Allows you to provide meta info to your JS code > return ?; > } > > public Person getPerson(int id) { > security.read_people(id); > return db.select(Person.class,?select * from table > Person where >id=%s?, id); > } > } > >In JS > > function myController( $scope, fn$MyComp ) { > fn$MyComp.getPerson( $scope.id ).then( function(person) { > $scope.person = person; > }); > } > >In JS, there is a bit of setup necessary because you need to make a >roundtrip to the server to get the methods of the MyComp class. It will >then add those methods to the proxy object. Since Javascript is not >multithreaded you need to delay initialization and usage of the service >object in Java script until this roundtrip is done. This is very well >supported in angular with promises. That said, it is a bit convoluted and >could be improved. > >One comment I often get is: Why the marker interface? Well, > >This is an example of the Java code: >https://github.com/osgi/osgi.enroute.examples/blob/5a19fce4526dd96aae558a9 >7ac9bccf8f369036c/osgi.enroute.examples.cm.application/src/osgi/enroute/ex >amples/cm/application/CmFacade.java ><https://github.com/osgi/osgi.enroute.examples/blob/5a19fce4526dd96aae558a >97ac9bccf8f369036c/osgi.enroute.examples.cm.application/src/osgi/enroute/e >xamples/cm/application/CmFacade.java> > >And the corresponding Javascript code: > >https://github.com/osgi/osgi.enroute.examples/blob/5a19fce4526dd96aae558a9 >7ac9bccf8f369036c/osgi.enroute.examples.cm.application/web/main.js ><https://github.com/osgi/osgi.enroute.examples/blob/5a19fce4526dd96aae558a >97ac9bccf8f369036c/osgi.enroute.examples.cm.application/web/main.js> > >Kind regards, > > Peter Kriens > > > >> On 27 jul. 2015, at 10:51, Frank Langel <fr...@frankjlangel.com> wrote: >> >> Hello, >> >> I never was a big fan of Javascript due to lack of type support. With >>TypeScript, things change a bit. In the future, I see two trends >> Javascript (TypeScript) is moving downwards from the web client into >>the server and will be responsible for server based endpoint services >>(REST, calling application objects, glueing) >> In 1-2 years, Java will move upwards taking the desktop with the help >>of WebAssembly >> For the current future, I was wondering if anyone has a sample how to >>nicely and elegantly inject OSGI service in/use from Javascript. >> >> Thanks in advance >> Frank >> >> _______________________________________________ >> OSGi Developer Mail List >> osgi-dev@mail.osgi.org >> https://mail.osgi.org/mailman/listinfo/osgi-dev > >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: ><http://mail.osgi.org/pipermail/osgi-dev/attachments/20150727/95192600/att >achment-0001.html> > >------------------------------ > >Message: 3 >Date: Mon, 27 Jul 2015 12:01:51 +0200 >From: Erg?der Bekrek <e...@erguder.tk> >To: OSGi Developer Mail List <osgi-dev@mail.osgi.org> >Subject: Re: [osgi-dev] Calling/Injecting OSGI Services in JavaScript >Message-ID: <55b6018f.9000...@erguder.tk> >Content-Type: text/plain; charset="windows-1252"; Format="flowed" > >I'm recommending you to use this library which is an OSGi service >registry for JS > >http://nanoko-project.github.io/h-ubu/snapshot/using-nodejs.html# > >It looks like it works like a charm... you should contact its authors to >know more about it. >The documentation is really clear. > >Good day > >Erg? > >On 27.07.2015 10:51, Frank Langel wrote: >> Hello, >> >> I never was a big fan of Javascript due to lack of type support. With >> TypeScript, things change a bit. In the future, I see two trends >> >> * Javascript (TypeScript) is moving downwards from the web client >> into the server and will be responsible for server based endpoint >> services (REST, calling application objects, glueing) >> * In 1-2 years, Java will move upwards taking the desktop with the >> help of WebAssembly >> >> For the current future, I was wondering if anyone has a sample how to >> nicely and elegantly inject OSGI service in/use from Javascript. >> >> Thanks in advance >> Frank >> >> >> _______________________________________________ >> OSGi Developer Mail List >> osgi-dev@mail.osgi.org >> https://mail.osgi.org/mailman/listinfo/osgi-dev > >-------------- next part -------------- >An HTML attachment was scrubbed... >URL: ><http://mail.osgi.org/pipermail/osgi-dev/attachments/20150727/4e280ea7/att >achment-0001.html> > >------------------------------ > >_______________________________________________ >OSGi Developer Mail List >osgi-dev@mail.osgi.org >https://mail.osgi.org/mailman/listinfo/osgi-dev > >End of osgi-dev Digest, Vol 105, Issue 2 >**************************************** _______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev