|<< Back to previous view|
[GLASSFISH-17643] nucleus main process is called "ASMain" in glassfish.jar Created: 04/Nov/11 Updated: 22/May/13
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Participants:||Bill Shannon, martin.mares and Tom Mueller|
The class that contains the main method for nucleus is called "ASMain". It is contained in a JAR file called "glassfish.jar" When nucleus is used for other Java servers, these may not be appropriate names. The class name is visible to the user in the following cases:
1. Leave this as it is.
2. Rename the class to something more generic. "Main" is probably too generic because other Java programs, most specifically, NetBeans, uses Main. "GFMain" might be appropriate since the Java package name contains "glassfish".
3. Rename the class to be something specific to nucleus, such as NucleusMain. Rename the JAR file to nucleus.jar. Expect that nucleus-derived products provide their own JAR file that contains main, i.e., a class that extends NucleusMain. This would also require modifying the launcher so that it could identify the right JAR file to launch when starting the server.
Related to this issue is other meta data that is associated with the main program. For example, the jvisualvm program displays the GlassFish logo and "GlassFish" next to the name of the process. This is based on the full class name showing up in the following file in jvisualvm: visualvm/application/src/com/sun/tools/visualvm/application/type/MainClassApplicationTypeFactory.java. If the name of the class is changed, then jvisualvm must be updated too.
|Comment by Tom Mueller [ 24/Jan/12 04:09 PM ]|
A suggested fix from Bill Shannon:
|Comment by Bill Shannon [ 24/Jan/12 06:31 PM ]|
To expand on the previous comment...
My suggestion was to put the nucleus content in a nucleus.jar with a main
(You could call it NucleusMain if you really wanted to, but almost no one will
Put the app server content in a glassfish.jar with a main class named ASMain
Other servers built on nucleus should do something similar.
|Comment by Tom Mueller [ 07/Jan/13 10:38 PM ]|
To implement the design idea in the previous comment, it would be necessary to change the start-domain and start-local-instance logic so that it would run the correct JAR file.
Currently, the GFDomainLauncher and GFInstanceLauncher classes have the "glassfish.jar" and the full classname of ASMain hardcoded. If glassfish.jar is defined by appserver (not nucleus), then there should be no references to glassfish.jar anywhere within the nucleus code. Same with the "ASMain" class.
The only other reference to the ASMain class in nucleus is in the bootstrap ReJar.java file.
It should be possible to do this refactoring - just noting it here so as to not miss this.
|Comment by Tom Mueller [ 26/Mar/13 05:10 PM ]|
Deferring to 4.0.1.