Singleton Webservice

Dear all,

I'm trying to create a singleton webservice. (a webservice of which only 1 instance is allowed. All calls to the webservice should 'end' in this singleton)

Reason for this; the application uses a multithreaded back-end controlled by a ThreadPoolExecutor. This only has effect when there's only one controller to which all web service calls are routed.

Is there anyone who can tell me how I should implement this?

Your help is very much appreciated!

Regards,

Chris van Diemen

[532 byte] By [CvDiemena] at [2007-11-27 9:25:27]
# 1

Hi Chris,

You want all the ws requests to be accepted by one object, right? So why don't you create a Singleton class and let that to be called by the ws rather than the one that's being currently called.

Current system

WS -> Execution code which uses a Thread pool

New suggestion

WS -> Singleton Receiver -> Execution code which uses a Thread pool

Kamal-Mettanandaa at 2007-7-12 22:22:05 > top of Java-index,Other Topics,Patterns & OO Design...