Question: How would you make a single class available to all applications on an Application Server? What are the advantages and disadvantages of this approach?
Answer: Simply by getting the class loaded by a top-level Classloader. For example, if you want to make an application specific class available to all the applications, you just need to add that class to the CLASSPATH of your application server. All the classes of the CLASSPATH are loaded by the time Java-supplied Application Classloader transfers the control to the application specific Apps Server supplied classloaders and hence every class, which is a part of the CLASSPATH will be available to all the application specific classloaders.
Advantages/Disadvantages of this approach
The obvious advantage of this approach is that you don't need to load the same class more than once, but it comes with at least two disadvantages as well, which are:-
Sunday, June 1, 2008
Make a class available to all apps on an Apps Server
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment