Author: dain Date: Thu Nov 4 14:09:42 2004 New Revision: 56621 Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java Log: http://nagoya.apache.org/jira/browse/GERONIMO-431 ServerInfo no longer returns the guessed baseDirectory from getBaseDirectory The only way to interact with the real base directory is via a resolve method
Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java ============================================================================== --- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java (original) +++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Thu Nov 4 14:09:42 2004 @@ -76,29 +76,86 @@ /** * The JMX name used by a Kernel to register itself when it boots. + * todo drop "geronimo.boot:" from this name so the kernel shows up in the kernel default domain */ public static final ObjectName KERNEL = JMXUtil.getObjectName("geronimo.boot:role=Kernel"); + /** + * Index of kernel (Weak) references by kernel name + */ private static final Map kernels = new HashMap(); + + /** + * ReferenceQueue that watches the weak references to our kernels + */ private static final ReferenceQueue queue = new ReferenceQueue(); + + /** + * Helper objects for invoke and getAttribute + */ + private static final String[] NO_TYPES = new String[0]; + private static final Object[] NO_ARGS = new Object[0]; + + /** + * Name of the configuration manager + * todo drop "geronimo.boot:" from this name so the configuration manger shows up in the kernel default domain + */ + private static final ObjectName CONFIGURATION_MANAGER_NAME = JMXUtil.getObjectName("geronimo.boot:role=ConfigurationManager"); + + /** + * Te pattern we use to find all the configuation stores registered with the kernel + */ + private static final ObjectName CONFIGURATION_STORE_PATTERN = JMXUtil.getObjectName("*:role=ConfigurationStore,*"); + + /** + * Name of this kernel + */ private final String kernelName; + + /** + * JMX domain name of this kernel + */ private final String domainName; + /** + * The log + */ private Log log; + + /** + * Is this kernel running? + */ private boolean running; + + /** + * The timestamp when the kernel was started + */ private Date bootTime; + + /** + * The MBean server used by this kernel + */ private MBeanServer mbServer; + + /** + * Listeners for when the kernel shutdown + */ private LinkedList shutdownHooks = new LinkedList(); + /** + * This manager is used by the kernel to manage dependencies between gbeans + */ private DependencyManager dependencyManager; + /** + * The kernel uses this manager to load configurations which are collections of GBeans + */ private ConfigurationManager configurationManager; - private GBeanMBean configurationManagerGBean; - private static final String[] NO_TYPES = new String[0]; - private static final Object[] NO_ARGS = new Object[0]; - private static final ObjectName CONFIGURATION_MANAGER_NAME = JMXUtil.getObjectName("geronimo.boot:role=ConfigurationManager"); - private static final ObjectName CONFIGURATION_STORE_PATTERN = JMXUtil.getObjectName("*:role=ConfigurationStore,*"); + /** + * The GBeanMbean that wraps the configuration manager + */ + private GBeanMBean configurationManagerGBean; /** * No-arg constructor allowing this class to be used as a GBean reference. @@ -111,10 +168,11 @@ /** * Construct a Kernel which does not have a config store. * - * @param domainName the domain name to be used for the JMX MBeanServer + * @param kernelName the domain name to be used for the JMX MBeanServer */ - public Kernel(String domainName) { - this(domainName, domainName); + public Kernel(String kernelName) { + this.kernelName = kernelName; + this.domainName = kernelName; } /** @@ -122,6 +180,8 @@ * * @param kernelName the name of the kernel that uniquely indentifies the kernel in a VM * @param domainName the domain name to be used for the JMX MBeanServer + * @deprecated we are dropping the ability to have multiple kernels in a single mbean server, as the kernels will + * stomp on each others namespace */ public Kernel(String kernelName, String domainName) { this.kernelName = kernelName; @@ -380,7 +440,6 @@ } public int getConfigurationState(URI configID) throws NoSuchConfigException { - ConfigurationManager configurationManager = getConfigurationManager(); try { ObjectName configName = Configuration.getConfigurationObjectName(configID); return ((Integer)getAttribute(configName, "state")).intValue(); Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java ============================================================================== --- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java (original) +++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/serverinfo/ServerInfo.java Thu Nov 4 14:09:42 2004 @@ -30,15 +30,19 @@ * @version $Rev$ $Date$ */ public class ServerInfo { + private final String baseDirectory; private final File base; private final URI baseURI; public ServerInfo() { + baseDirectory = null; base = null; baseURI = null; } public ServerInfo(String baseDirectory) throws Exception { + this.baseDirectory = baseDirectory; + // force load of server constants ServerConstants.getVersion(); @@ -83,7 +87,7 @@ } public String getBaseDirectory() { - return base.getAbsolutePath(); + return baseDirectory; } public String getVersion() {