It is an interesting question. Following might be helpful
Before creating an instance of the singleton class, check if it exists in the
system.properties. If it doesn't, create the instance and put that instance into
system.properties map.
For ex:
if (System.properties.get("Single")==null) {
Singleton single = new Singleton();
System.properties.put("single", single);
}
Second approach could be this:
Don't put the class in the classpath. Write your own classloader and specify the
absolute location of the class. This way app server wouldn't be able to load the class
automatically.
Hope that helps
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110153#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...