On Jan 1, 2011, at 3:59 AM, DaHoopster wrote:
>
> Jersey version: 1.4
>
> So I have this situation:
>
> I have a resource that synchronously generate a unique id, convert the
> payload into a JMS message and send it to a particular queue
> destination.
> The return response is the JMS message id. I would like to call this
> resource method from other resources and the client would get the
> jms id as
> response.
>
> So here is my desired workflow:
>
> client ------> resource A -----> JMS resource -----> return jms id to
> resource A -----> return jms id to client
>
>
> Invoking jms resource should be transparent to client, so no
> redirect is
> needed.
>
> How can I do this efficiently? I don't want to call the jms resource
> with a
> jersey client.
>
If you can consider the resource class for the JMS resource as
something useable independent of its URI and a matching request you
declare an inject point on the class of resource A.
See @InjectParam if using Jersey's injection capability otherwise you
can use a DI framework such as Guice, Spring or CDI.
Paul.
> Thanks,
> Han
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Invoking-a-different-resource-tp5878545p5878545.html
> Sent from the Jersey mailing list archive at Nabble.com.