RE: Restlet, JSR-311 and OSGi (was Re: Please remove Require-Bundle)

2008-04-23 Thread Jerome Louvel

Hi Edward, Peter, and all,

Thanks for the feed-back and the help propositions. I'm really excited about
moving the OSGi integration forward!

So, I started to write some specifications on the Restlet-OSGi integration
in our wiki:
http://wiki.restlet.org/docs_1.1/g1/43-restlet/124-restlet.html

If you could have a look and comment (here or on the wiki), that would be
great.

Best regards,
Jerome  

PS: Sorry, but I won't be at J1 or JAX this year.

 -Message d'origine-
 De : Peter Kriens [mailto:[EMAIL PROTECTED] 
 Envoyé : mercredi 23 avril 2008 11:52
 À : Edward Yakop
 Cc : Jerome Louvel; discuss@restlet.tigris.org
 Objet : Re: Restlet, JSR-311 and OSGi (was Re: Please remove 
 Require-Bundle)
 
 I am terribly busy at the moment but I am very interested to 
 help this  
 getting to work. I am now at JAX in Wiesbaden but I will also be in  
 J1. Any chance to meet?
 
 For this type of problems, please take a look at the OSGi 
 whiteboard  
 pattern. It would be nice if the programmer that had a 
 restlet could  
 just register a REST service in the OSGi service registry that would  
 be picked up by the rest bundle. Metadata like the URI can be 
 encoded  
 in the properties of the service. This model makes it trivial to  
 provide a rest oriented IO.
 
 Anyway, if there are any direct questions do not hesitate to ask me.  
 Please send me design info so I can comment.
 
 If there are any companies involved that are also OSGi members, then  
 it could be useful to think about standardizing this in the future.
 
 Hope this helps, kind regards,
 
   Peter Kriens
 
 
 
 
 On 23 apr 2008, at 04:51, Edward Yakop wrote:
 
  Hi,
 
  I will check out restlet code a.s.a.p. and verify whether my initial
  thought still valid.
 
  My comments are inline.
 
  On Wed, Apr 23, 2008 at 3:43 AM, Jerome Louvel 
 [EMAIL PROTECTED]  
  wrote:
  Yes in the sense that Jetty is already doing this with the
  OSGi HTTP Service. (i.e. Jetty implements the OSGi
  HttpService specification) This makes it possible not just
  for the application developer to not have to worry about how
  to configure Jetty, but also for the *other* bundle
  developers not having to worry which HTTP Server
  (implementation) the host application uses and how it will
  tell the host application to configure itself.
 
  OK, that makes sense. Using our Servlet adapter we could easily  
  leverage the
  OSGi HTTP service.
 
  This is correct.
 
  What I mean is Restlet will expose an (or more) OSGi service
  when started as a bundle. Of course, this means that Restlet
  will need to have an OSGi Activator, which depends on (at
  least) OSGi core API, so this might be a restlet.ext instead
  of a core.
 
  Yes, we would need a new com.noelios.restlet.ext.osgi 
 module. It  
  would
  provide a RestletService to register Restlet Applications.
 
  I don't think doing the http service way of doing things is easier
  for the user.
  I think it would be better for user to register Restlet exposed
  service and let the
  restlet bundle to track these services instead.
 
  This way, The user doesn't need to do additional work to 
 track restlet
  service, and
  register their restlet context (not sure about the term).
 
 
  The goal is, simply adding the appropriate RESTlet Jars
  (including, like restlet.ext.osgi) will expose Restlet as a
  service, so it can be used as normal. Edward Yakop from
  OPS4J.org suggested this, and I really like his idea, (but
  not sure yet how to execute it).
 
  We would need the following JARs:
   - org.restlet.jar
   - com.noelios.restlet.jar
   - com.noelios.restlet.ext.servlet.jar
   - com.noelios.restlet.ext.osgi.jar
 
  Ok.
 
  Support for OSGI plugin framework
  http://restlet.tigris.org/issues/show_bug.cgi?id=83
 
  Cool. will look into this.
 
  Regards,
  Edward Yakop
 



Re: Restlet, JSR-311 and OSGi (was Re: Please remove Require-Bundle)

2008-04-23 Thread Hendy Irawan

Jerome Louvel wrote:

Hi Edward, Peter, and all,

Thanks for the feed-back and the help propositions. I'm really excited about
moving the OSGi integration forward!

So, I started to write some specifications on the Restlet-OSGi integration
in our wiki:
http://wiki.restlet.org/docs_1.1/g1/43-restlet/124-restlet.html

If you could have a look and comment (here or on the wiki), that would be
great.

Best regards,
Jerome  


PS: Sorry, but I won't be at J1 or JAX this year.

  

Thanks Jerome. I'll try to put something on there.

I have a quick comment though: Regarding the Log service, I favor Apache 
CL API to OSGi Logging (people might disagree). e.g. Spring framework 
uses ApacheCL. Besides, ApacheCL implementation OSGi bundles are already 
widely available. (bundled with Eclipse, Eclipse IDE itself uses 
ApacheCL) But I love pax-logging more (thanks to Edward) (pax-logging is 
logging implementation bundle for numerous logging APIs)

-Message d'origine-
De : Peter Kriens [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 23 avril 2008 11:52

À : Edward Yakop
Cc : Jerome Louvel; discuss@restlet.tigris.org
Objet : Re: Restlet, JSR-311 and OSGi (was Re: Please remove 
Require-Bundle)


I am terribly busy at the moment but I am very interested to 
help this  
getting to work. I am now at JAX in Wiesbaden but I will also be in  
J1. Any chance to meet?


For this type of problems, please take a look at the OSGi 
whiteboard  
pattern. It would be nice if the programmer that had a 
restlet could  
just register a REST service in the OSGi service registry that would  
be picked up by the rest bundle. Metadata like the URI can be 
encoded  
in the properties of the service. This model makes it trivial to  
provide a rest oriented IO.


Anyway, if there are any direct questions do not hesitate to ask me.  
Please send me design info so I can comment.


If there are any companies involved that are also OSGi members, then  
it could be useful to think about standardizing this in the future.


Hope this helps, kind regards,

Peter Kriens




On 23 apr 2008, at 04:51, Edward Yakop wrote:



Hi,

I will check out restlet code a.s.a.p. and verify whether my initial
thought still valid.

My comments are inline.

On Wed, Apr 23, 2008 at 3:43 AM, Jerome Louvel 
  
[EMAIL PROTECTED]  


wrote:
  

Yes in the sense that Jetty is already doing this with the
OSGi HTTP Service. (i.e. Jetty implements the OSGi
HttpService specification) This makes it possible not just
for the application developer to not have to worry about how
to configure Jetty, but also for the *other* bundle
developers not having to worry which HTTP Server
(implementation) the host application uses and how it will
tell the host application to configure itself.
  
OK, that makes sense. Using our Servlet adapter we could easily  
leverage the

OSGi HTTP service.


This is correct.

  

What I mean is Restlet will expose an (or more) OSGi service
when started as a bundle. Of course, this means that Restlet
will need to have an OSGi Activator, which depends on (at
least) OSGi core API, so this might be a restlet.ext instead
of a core.
  
Yes, we would need a new com.noelios.restlet.ext.osgi 

module. It  


would
provide a RestletService to register Restlet Applications.


I don't think doing the http service way of doing things is easier
for the user.
I think it would be better for user to register Restlet exposed
service and let the
restlet bundle to track these services instead.

This way, The user doesn't need to do additional work to 
  

track restlet


service, and
register their restlet context (not sure about the term).


  

The goal is, simply adding the appropriate RESTlet Jars
(including, like restlet.ext.osgi) will expose Restlet as a
service, so it can be used as normal. Edward Yakop from
OPS4J.org suggested this, and I really like his idea, (but
not sure yet how to execute it).
  

We would need the following JARs:
 - org.restlet.jar
 - com.noelios.restlet.jar
 - com.noelios.restlet.ext.servlet.jar
 - com.noelios.restlet.ext.osgi.jar


Ok.

  

Support for OSGI plugin framework
http://restlet.tigris.org/issues/show_bug.cgi?id=83


Cool. will look into this.

Regards,
Edward Yakop
  


  



--
Hendy Irawan
www.hendyirawan.com



Re: Restlet, JSR-311 and OSGi (was Re: Please remove Require-Bundle)

2008-04-23 Thread Hendy Irawan

Jerome Louvel wrote:

Hi Edward, Peter, and all,

Thanks for the feed-back and the help propositions. I'm really excited about
moving the OSGi integration forward!

So, I started to write some specifications on the Restlet-OSGi integration
in our wiki:
http://wiki.restlet.org/docs_1.1/g1/43-restlet/124-restlet.html

If you could have a look and comment (here or on the wiki), that would be
great.

Best regards,
Jerome  


PS: Sorry, but I won't be at J1 or JAX this year.

  

I've commented on that page.

In addition, I've added my JettyTest sample to 
https://scm.ops4j.org/repos/ops4j/laboratory/users/efy/restlet/


(see Activator.java for info)

It describes how to use Restlet with OSGi (currently):

  1. using HttpService (Jetty) in another bundle
  2. using Restlet's own HTTP server

You'll notice that I had this hack:

   // Manually set the Restlet implementation, otherwise it won't 
be able to

   // find it even though com.noelios.* bundles are installed
   org.restlet.util.Engine.setInstance(new 
com.noelios.restlet.Engine());
  
I'm not sure if Noelios actually intended this for Restlet to be usable 
from OSGi...



-Message d'origine-
De : Peter Kriens [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 23 avril 2008 11:52

À : Edward Yakop
Cc : Jerome Louvel; discuss@restlet.tigris.org
Objet : Re: Restlet, JSR-311 and OSGi (was Re: Please remove 
Require-Bundle)


I am terribly busy at the moment but I am very interested to 
help this  
getting to work. I am now at JAX in Wiesbaden but I will also be in  
J1. Any chance to meet?


For this type of problems, please take a look at the OSGi 
whiteboard  
pattern. It would be nice if the programmer that had a 
restlet could  
just register a REST service in the OSGi service registry that would  
be picked up by the rest bundle. Metadata like the URI can be 
encoded  
in the properties of the service. This model makes it trivial to  
provide a rest oriented IO.


Anyway, if there are any direct questions do not hesitate to ask me.  
Please send me design info so I can comment.


If there are any companies involved that are also OSGi members, then  
it could be useful to think about standardizing this in the future.


Hope this helps, kind regards,

Peter Kriens




On 23 apr 2008, at 04:51, Edward Yakop wrote:



Hi,

I will check out restlet code a.s.a.p. and verify whether my initial
thought still valid.

My comments are inline.

On Wed, Apr 23, 2008 at 3:43 AM, Jerome Louvel 
  
[EMAIL PROTECTED]  


wrote:
  

Yes in the sense that Jetty is already doing this with the
OSGi HTTP Service. (i.e. Jetty implements the OSGi
HttpService specification) This makes it possible not just
for the application developer to not have to worry about how
to configure Jetty, but also for the *other* bundle
developers not having to worry which HTTP Server
(implementation) the host application uses and how it will
tell the host application to configure itself.
  
OK, that makes sense. Using our Servlet adapter we could easily  
leverage the

OSGi HTTP service.


This is correct.

  

What I mean is Restlet will expose an (or more) OSGi service
when started as a bundle. Of course, this means that Restlet
will need to have an OSGi Activator, which depends on (at
least) OSGi core API, so this might be a restlet.ext instead
of a core.
  
Yes, we would need a new com.noelios.restlet.ext.osgi 

module. It  


would
provide a RestletService to register Restlet Applications.


I don't think doing the http service way of doing things is easier
for the user.
I think it would be better for user to register Restlet exposed
service and let the
restlet bundle to track these services instead.

This way, The user doesn't need to do additional work to 
  

track restlet


service, and
register their restlet context (not sure about the term).


  

The goal is, simply adding the appropriate RESTlet Jars
(including, like restlet.ext.osgi) will expose Restlet as a
service, so it can be used as normal. Edward Yakop from
OPS4J.org suggested this, and I really like his idea, (but
not sure yet how to execute it).
  

We would need the following JARs:
 - org.restlet.jar
 - com.noelios.restlet.jar
 - com.noelios.restlet.ext.servlet.jar
 - com.noelios.restlet.ext.osgi.jar


Ok.

  

Support for OSGI plugin framework
http://restlet.tigris.org/issues/show_bug.cgi?id=83


Cool. will look into this.

Regards,
Edward Yakop
  


  




--
Hendy Irawan
www.hendyirawan.com



RE: Restlet, JSR-311 and OSGi (was Re: Please remove Require-Bundle)

2008-04-22 Thread Jerome Louvel

Hi all,

[...]

 Yes in the sense that Jetty is already doing this with the 
 OSGi HTTP Service. (i.e. Jetty implements the OSGi 
 HttpService specification) This makes it possible not just 
 for the application developer to not have to worry about how 
 to configure Jetty, but also for the *other* bundle 
 developers not having to worry which HTTP Server 
 (implementation) the host application uses and how it will 
 tell the host application to configure itself.

OK, that makes sense. Using our Servlet adapter we could easily leverage the
OSGi HTTP service.

 What I mean is Restlet will expose an (or more) OSGi service 
 when started as a bundle. Of course, this means that Restlet 
 will need to have an OSGi Activator, which depends on (at 
 least) OSGi core API, so this might be a restlet.ext instead 
 of a core.

Yes, we would need a new com.noelios.restlet.ext.osgi module. It would
provide a RestletService to register Restlet Applications.

 The goal is, simply adding the appropriate RESTlet Jars 
 (including, like restlet.ext.osgi) will expose Restlet as a 
 service, so it can be used as normal. Edward Yakop from 
 OPS4J.org suggested this, and I really like his idea, (but 
 not sure yet how to execute it).

We would need the following JARs:
 - org.restlet.jar
 - com.noelios.restlet.jar
 - com.noelios.restlet.ext.servlet.jar
 - com.noelios.restlet.ext.osgi.jar
 
 To my knowledge, JAX-RS / JSR-311 is in the works, and Jerome 
 is on it, and of course Restlet is implementing it. So I have 
 very high hopes that JSR-311 spec will be done with OSGi 
 usage in consideration. If so, there is possibility that the 
 next revision of OSGi compendium will include JSR-311 as it 
 is (or a subset, instead of a partial extension or a 
 different spec) as RESTful OSGi service spec, should they 
 decide its inclusion.

Stephan Koops developped the JAX-RS extension on top of the Restlet API. In
the end, a JAX-RS application can just be a Restlet application (instance of
org.restlet.ext.jaxrs.JaxRsApplication).

See details here:
http://wiki.restlet.org/docs_1.1/g1/13-restlet/28-restlet/57-restlet.html 

So we could easily provide an integration with both:
 - pure Restlet API: class driven + server/client side + multi-protocol
 - JAX-RS API: annotation driven, server side only, HTTP protocol only

 (OSGi's history starts from small, embedded devices... Maybe 
 soon we can control our refrigerator using REST requests? Who 
 knows!) NASA did Restlet and OSGi for their robot! 
 http://eclipsecon.greenmeetingsystems.com/attachments/download
 /322 ... (and yes, they called it RESTBots)

Yeah, I read the slides of their cool presentation. I need to find time to
blog about all this Restlet+OSGi idea... :-)
 
 I would recommend inviting someone from OSGi community if 
 they are willing to help. Maybe Peter Kriens (master OSGi 
 evangelist) can provide some suggestions about this.

Definitely, if Peter or Edward can spend some time looking over our
shoulders or even contribute some code, that would be great. I want to move
this extension forward, it seems that we don't miss many pieces now.

There is an (old) RFE related to OSGi that we should update as well:

Support for OSGI plugin framework
http://restlet.tigris.org/issues/show_bug.cgi?id=83

Best regards,
Jerome  



RE: Restlet, JSR-311 and OSGi (was Re: Please remove Require-Bundle)

2008-04-22 Thread Jerome Louvel

Stephan,

Indeed, we should get support for OSGi/JAX-RS without additional changes on
your side.

Best regards,
Jerome  

 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Envoyé : mardi 22 avril 2008 22:31
 À : discuss@restlet.tigris.org
 Objet : Re: Restlet, JSR-311 and OSGi (was Re: Please remove 
 Require-Bundle)
 
 Hi Jerome,
  Stephan Koops developped the JAX-RS extension on top of the 
 Restlet API. In
  the end, a JAX-RS application can just be a Restlet 
 application (instance of
  org.restlet.ext.jaxrs.JaxRsApplication).

 Did I understand right, that there is nothing to do for me here?
 
 best regards
Stephan