Hi guys,

I've posted a video on Youtube [1] showing how neo4j server runs on OSGi after 
a bit of work. 
Currently the REST API is working fine. The webadmin is also working but there 
are a few things which don't like the gremlin shell (seems related to grrovy 
stuffs). Also  some links in the server info panel are not working. It seems 
that links having spaces like "Primitive count" don't work on my Mac, but they 
were working yesterday on my other windows computer. I'm not sure this is 
related with OSGi... Also there seem to have a problem when the RRD database 
starts but this is minor stuff I guess.

So, to do that I've made "a few" modification in neo4j source code.
Especially in the server module, I had to move classes and rename package so 
the bundle namespace don't overlap anymore with server-api module.
Then I've created an OSGiActivator and a specific bootstrapper which :
 - look for embedded HttpService
 - registers ServerModules as OSGi services.
Then when the server starts it starts registered ServerModules so they can be 
deployed using Jersey Servlet on HttpService.

I don't know if you wish to integrate these modifications in neo4j or even have 
a review of the modifications i've made. May be I can send a few pull request 
so at least you can get modifications which make OSGi integration much easier. 
Modifications are available in my forked repository [2].

Thanks for your feedback.

[1] http://www.youtube.com/watch?v=Ufuf7xcv4Mk
[2] https://github.com/njouanin/community



Le 28 avr. 2011 à 16:07, Nicolas Jouanin a écrit :

> I've commited a completed implementation for this class [1].
> This implementation introspects bundles on their startup and register any 
> service declared in META-INF/services as an OSGi service. I've added a filter 
> to this behaviour, so it only does the work for bundles having the 
> Export-Services directive set to true in MANIFEST.MF. This avoids 
> registration of unwanted services like those declared in the jersey bundle.
> => this helps me a lot on my current work. Now I have server+webadmin nearly 
> working inside felix :)
> 
> 
> [1] 
> https://github.com/njouanin/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/osgi/OSGiExtensionLoader.java
> 
> 2011/4/28 Tobias Ivarsson <tobias.ivars...@neotechnology.com>
> Right,
> 
> OSGiExtensionLoader is not completed, but it is supposed to work roughly as
> you have outlined.
> 
> -tobias
> 
> On Wed, Apr 27, 2011 at 1:07 PM, Nicolas Jouanin
> <nicolas.joua...@gmail.com>wrote:
> 
> > Hi Andreas,
> >
> > I'm currently looking at class OSGiExtensionLoader and I wonder what's the
> > final purpose of this class ?
> > I mean currently it's used to load extensions which are registered as OSGi
> > services through the loadExtensionsOfType method.
> > Also it manages a list of bundle but does nothing with it. I think there's
> > something missing here. I guess it should introspect theses bundle and
> > register services declared in META-INF/services/ . Is that it ?
> >
> > Nicolas.
> >
> > 2011/4/25 Andreas Kollegger <andreas.kolleg...@neotechnology.com>
> >
> > > Hi Nicolas,
> > >
> > > I had done some work with embedding an OSGi environment within the server
> > > to host plugins, hoping to slowly modularize the server in a sensible
> > way.
> > > But that code has been pulled out, as we opted for the Java ServiceLoader
> > > approach for plugins.
> > >
> > > When deploying into an OSGi environment, I've approached it as embedded
> > > development. The server only adds the REST api (which isn't needed when
> > > talking directly to the database), and the Webadmin (replaced by the OSGi
> > > webconsole. well, except for visualization). We've been relaxed about
> > good
> > > OSGi discipline in the server bits, because it seemed like OSGi
> > development
> > > is embedded development.
> > >
> > > Are you developing an application in OSGi, or are you interested in
> > > replicating the server (including REST+webadmin) in OSGi?
> > >
> > > -Andreas
> > >
> > > On Apr 25, 2011, at 5:50 AM, Nicolas Jouanin wrote:
> > >
> > > > Hi,
> > > >
> > > > I think an OSGi section in the Neo4j wiki would be great.
> > > > Of course there's no problem for adding content from my documentation
> > > into Neo4j wiki. Let me know if you want me to do it.
> > > > Concerning OSGi support for the server, I'm also working on it.
> > Currently
> > > I'm trying to make the server component run using HttpService for
> > > deployment, and use OSGi services to discover the graphDb and server
> > > modules.
> > > > I have some troubles because of server and server-api packages which
> > > overlap and protected or even private method or class declaration.
> > > > You can follow the work on github :
> > > https://github.com/njouanin/community  (currently working on move-server
> > > branch).
> > > >
> > > > Nicolas.
> > > >
> > > > Le 24 avr. 2011 à 23:17, Peter Neubauer a écrit :
> > > >
> > > >> Nicolas,
> > > >> Great and concise write-up! Would it be ok to include something along
> > > >> these lines into the documentation for neo4j that gets compiled into
> > > >> http://docs.neo4j.org/ ? An OSGi related section is certainly a good
> > > >> idea.
> > > >>
> > > >> Andreas Kollegger has been playing with the OSGi side of things
> > > >> regarding the server, but I don't know the state of it at the moment.
> > > >> Andreas, any status?
> > > >>
> > > >> Cheers,
> > > >>
> > > >> /peter neubauer
> > > >>
> > > >> GTalk:      neubauer.peter
> > > >> Skype       peter.neubauer
> > > >> Phone       +46 704 106975
> > > >> LinkedIn   http://www.linkedin.com/in/neubauer
> > > >> Twitter      http://twitter.com/peterneubauer
> > > >>
> > > >> http://www.neo4j.org               - Your high performance graph
> > > database.
> > > >> http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
> > > >> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
> > party.
> > > >>
> > > >>
> > > >>
> > > >> On Mon, Apr 18, 2011 at 2:40 PM, Nicolas Jouanin
> > > >> <nicolas.joua...@gmail.com> wrote:
> > > >>> Hi,
> > > >>>
> > > >>> I've written a step-by-step guide for installing Neo4j on OSGi (
> > > >>>
> > > http://wiki.escapek.org/display/DEV/Neo4j+community+edition+installation
> > ).
> > > >>> It is based on my own experience and currently it shows how to
> > install
> > > Neo4j
> > > >>> community edition and opening a Embedded Graph Database from another
> > > bundle.
> > > >>> A small example is provided.
> > > >>> Next step i'd like to achieve would be a be able to only to install
> > > server,
> > > >>> webadmin or ha features but also make them running using OSGi
> > > HTTPService
> > > >>> for example. Those features could also for example look for exposed
> > > >>> GraphDatabase and then register management of webadmin features
> > > >>> automatically.
> > > >>> I don't know if it would be useful or even if that makes sense
> > > regarding
> > > >>> neo4j use cases. Let me know what you think about that.
> > > >>>
> > > >>> Nicolas.
> > > >>> _______________________________________________
> > > >>> Neo4j mailing list
> > > >>> User@lists.neo4j.org
> > > >>> https://lists.neo4j.org/mailman/listinfo/user
> > > >>>
> > > >> _______________________________________________
> > > >> Neo4j mailing list
> > > >> User@lists.neo4j.org
> > > >> https://lists.neo4j.org/mailman/listinfo/user
> > > >
> > > > _______________________________________________
> > > > Neo4j mailing list
> > > > User@lists.neo4j.org
> > > > https://lists.neo4j.org/mailman/listinfo/user
> > >
> > > _______________________________________________
> > > Neo4j mailing list
> > > User@lists.neo4j.org
> > > https://lists.neo4j.org/mailman/listinfo/user
> > >
> > _______________________________________________
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> 
> 
> 
> --
> Tobias Ivarsson <tobias.ivars...@neotechnology.com>
> Hacker, Neo Technology
> www.neotechnology.com
> Cellphone: +46 706 534857
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
> 

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to