Create my own Whiteboard/Application with extensions

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Create my own Whiteboard/Application with extensions

Oleg Cohen
Greetings,

I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working fine with the default Whiteboard instance. I would like to create my own Jax-RS Application with the same extensions that are configured in the default Whiteboard, for example jaxb-json one. Is there a convenient way to clone the default Whiteboard or create a fully-featured Application?

I would appreciate any guidance in this!

Thank you,
Oleg



Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

cschneider
I created an example of an application that uses jax-rs-whiteboard.


It uses the jackson extension. As you see the only thing you need in your code is this:
@Component(service = TaskResource.class)
@JaxrsResource
@Produces(MediaType.APPLICATION_JSON)
@JSONRequired
@Path("tasks")

Alternatively you can also publish a jax-rs Application as an OSGi service but I did not try this.

Christian

Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen <[hidden email]>:
Greetings,

I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working fine with the default Whiteboard instance. I would like to create my own Jax-RS Application with the same extensions that are configured in the default Whiteboard, for example jaxb-json one. Is there a convenient way to clone the default Whiteboard or create a fully-featured Application?

I would appreciate any guidance in this!

Thank you,
Oleg





--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist

Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

jbonofre
Hi

There's also an example in the karaf-rest-example.

Regards
JB

Le 30 oct. 2019 08:36, Christian Schneider <[hidden email]> a écrit :
I created an example of an application that uses jax-rs-whiteboard.


It uses the jackson extension. As you see the only thing you need in your code is this:
@Component(service = TaskResource.class)
@JaxrsResource
@Produces(MediaType.APPLICATION_JSON)
@JSONRequired
@Path("tasks")

Alternatively you can also publish a jax-rs Application as an OSGi service but I did not try this.

Christian

Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen <[hidden email]>:
Greetings,

I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working fine with the default Whiteboard instance. I would like to create my own Jax-RS Application with the same extensions that are configured in the default Whiteboard, for example jaxb-json one. Is there a convenient way to clone the default Whiteboard or create a fully-featured Application?

I would appreciate any guidance in this!

Thank you,
Oleg





--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist


Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

Oleg Cohen
In reply to this post by cschneider
Thank you, Christian! I will give it a try.

Best,
Oleg

On Wed, Oct 30, 2019 at 3:36 AM Christian Schneider <[hidden email]> wrote:
I created an example of an application that uses jax-rs-whiteboard.


It uses the jackson extension. As you see the only thing you need in your code is this:
@Component(service = TaskResource.class)
@JaxrsResource
@Produces(MediaType.APPLICATION_JSON)
@JSONRequired
@Path("tasks")

Alternatively you can also publish a jax-rs Application as an OSGi service but I did not try this.

Christian

Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen <[hidden email]>:
Greetings,

I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working fine with the default Whiteboard instance. I would like to create my own Jax-RS Application with the same extensions that are configured in the default Whiteboard, for example jaxb-json one. Is there a convenient way to clone the default Whiteboard or create a fully-featured Application?

I would appreciate any guidance in this!

Thank you,
Oleg





--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist



--
Oleg Cohen  |  Principal  |  A S S U R E B R I D G E
Office: +1 617 564 0737  |  Mobile: +1 617 455 7927  |  Fax: +1 888 409 6995
Email: [hidden email]  
|  www.assurebridge.com
Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

Oleg Cohen
In reply to this post by jbonofre
Hi JB,

Thank you for replying! Yes, there is an example of whiteboard, but the resource is using the default one. Unless I missed something. 

Best,
Oleg

On Wed, Oct 30, 2019 at 5:10 AM <[hidden email]> wrote:
Hi

There's also an example in the karaf-rest-example.

Regards
JB

Le 30 oct. 2019 08:36, Christian Schneider <[hidden email]> a écrit :
I created an example of an application that uses jax-rs-whiteboard.


It uses the jackson extension. As you see the only thing you need in your code is this:
@Component(service = TaskResource.class)
@JaxrsResource
@Produces(MediaType.APPLICATION_JSON)
@JSONRequired
@Path("tasks")

Alternatively you can also publish a jax-rs Application as an OSGi service but I did not try this.

Christian

Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen <[hidden email]>:
Greetings,

I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working fine with the default Whiteboard instance. I would like to create my own Jax-RS Application with the same extensions that are configured in the default Whiteboard, for example jaxb-json one. Is there a convenient way to clone the default Whiteboard or create a fully-featured Application?

I would appreciate any guidance in this!

Thank you,
Oleg





--
--
Christian Schneider

http://www.liquid-reality.de

Computer Scientist




--
Oleg Cohen  |  Principal  |  A S S U R E B R I D G E
Office: +1 617 564 0737  |  Mobile: +1 617 455 7927  |  Fax: +1 888 409 6995
Email: [hidden email]  
|  www.assurebridge.com
Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

jbonofre
In reply to this post by jbonofre
FYI:

https://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-whiteboard

Regards
JB

On 30/10/2019 09:45, [hidden email] wrote:

> Hi
>
> There's also an example in the karaf-rest-example.
>
> Regards
> JB
>
> Le 30 oct. 2019 08:36, Christian Schneider <[hidden email]> a
> écrit :
>
>     I created an example of an application that uses jax-rs-whiteboard.
>
>     https://github.com/cschneider/osgi-best-practices/blob/master/backend/src/main/java/net/lr/tasklist/resource/TaskResource.java
>
>     It uses the jackson extension. As you see the only thing you need in
>     your code is this:
>     @Component(service = TaskResource.class)
>     @JaxrsResource
>     @Produces(MediaType.APPLICATION_JSON)
>     @JSONRequired
>     @Path("tasks")
>
>     Alternatively you can also publish a jax-rs Application as an OSGi
>     service but I did not try this.
>
>     Christian
>
>     Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen
>     <[hidden email] <mailto:[hidden email]>>:
>
>         Greetings,
>
>         I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working
>         fine with the default Whiteboard instance. I would like to
>         create my own Jax-RS Application with the same extensions that
>         are configured in the default Whiteboard, for example jaxb-json
>         one. Is there a convenient way to clone the default Whiteboard
>         or create a fully-featured Application?
>
>         I would appreciate any guidance in this!
>
>         Thank you,
>         Oleg
>
>
>
>         **
>
>
>
>     --
>     --
>     Christian Schneider
>     http://www.liquid-reality.de
>
>     Computer Scientist
>     http://www.adobe.com
>
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Create my own Whiteboard/Application with extensions

Tim Ward-2
HI all,

There is also an example in the JAX-RS whiteboard specification (https://osgi.org/specification/osgi.cmpn/7.0.0/service.jaxrs.html#d0e133933) showing how you can register a whiteboard application (rather than just a whiteboard resource). The example also shows how to add whiteboard resources to that whiteboard application.

Best Regards,

Tim

On 30 Oct 2019, at 16:24, Jean-Baptiste Onofré <[hidden email]> wrote:

FYI:

https://github.com/apache/karaf/tree/master/examples/karaf-rest-example/karaf-rest-example-whiteboard

Regards
JB

On 30/10/2019 09:45, [hidden email] wrote:
Hi

There's also an example in the karaf-rest-example.

Regards
JB

Le 30 oct. 2019 08:36, Christian Schneider <[hidden email]> a
écrit :

   I created an example of an application that uses jax-rs-whiteboard.

   https://github.com/cschneider/osgi-best-practices/blob/master/backend/src/main/java/net/lr/tasklist/resource/TaskResource.java

   It uses the jackson extension. As you see the only thing you need in
   your code is this:
   @Component(service = TaskResource.class)
   @JaxrsResource
   @Produces(MediaType.APPLICATION_JSON)
   @JSONRequired
   @Path("tasks")

   Alternatively you can also publish a jax-rs Application as an OSGi
   service but I did not try this.

   Christian

   Am Mi., 30. Okt. 2019 um 01:36 Uhr schrieb Oleg Cohen
   <[hidden email] <[hidden email]>>:

       Greetings,

       I am using Aries HTTP Whiteboard in Karaf 4.2.7. All is working
       fine with the default Whiteboard instance. I would like to
       create my own Jax-RS Application with the same extensions that
       are configured in the default Whiteboard, for example jaxb-json
       one. Is there a convenient way to clone the default Whiteboard
       or create a fully-featured Application?

       I would appreciate any guidance in this!

       Thank you,
       Oleg



       **



   -- 
   -- 
   Christian Schneider
   http://www.liquid-reality.de

   Computer Scientist
   http://www.adobe.com



-- 
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com