users@glassfish.java.net

EJB application as REST client

From: <glassfish_at_javadesktop.org>
Date: Mon, 26 Jan 2009 08:25:52 PST

Hi,

I have developed a small rest client which consumes a rest service and writes to db. Now I would like to move this rest client into a ejb application so it can be triggered by for example a timer event. I could easily take all my code and call from a stateless ejb. What I cannot really figure out is how to best configure the webservice url. I wouldn't want to put it in a constant and even within the ejb.xml it seems a bit static. Should I create some kind of custom jndi resource that hands me the connection to the rest server? I could also just add a jvm-variable to the glassfish configuration with the url.

Datasources and jms/mq queues are configured in Glassfish without too much hassle.

How do you generally configure your application and server so that you easily can change the configuration?

Thanks!
[Message sent by forum member 'woel' (woel)]

http://forums.java.net/jive/thread.jspa?messageID=328196