GeeCON Prague 2014*
The moose likes Web Services and the fly likes Restful Webservices on fly(dynamically) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "Restful Webservices on fly(dynamically)" Watch "Restful Webservices on fly(dynamically)" New topic
Author

Restful Webservices on fly(dynamically)

Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Hi Folks,

I would like introduce some dynamic cabability of exposing the spring bean as restful services

scenario is

1) i need to read the list of spring bean id's from fileat runtime( or during the loading time of web app)
2) based on bean id's i fetch from step 1 , i need to some how expose the beans as restful services

is there a way to acieve the same ?

Thanks, Ganesh Gowtham
http://ganesh.gowtham.googlepages.com
Roger Sterling
Ranch Hand

Joined: Apr 06, 2012
Posts: 426

Yes, you can, but it's not turn-key or plug-and-play. You need to write the code to perform the initialization and re-initialization.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2057
Ganesh Gowtham,

May I know in what situation would such dynamism be ideal?
Ganesh Gowtham
Ranch Hand

Joined: Mar 30, 2005
Posts: 225

Scenraio is something of this sort ...

In our project we have couple of Spring beans save POJO ( service layer which talks to dao ...)

During the spring context startup, i would like to expose configured beans as Restful services ...

As @Lance said, i need to tweak or extend or customise the spring loading stuff to acieve the same ...

Any examples or WIKI or idea would be really appreciated.

Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

Apache CXF can help you here. you just need to give some configurations saying which all beans are to be made available as a web-service.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Restful Webservices on fly(dynamically)