User: user57
Date: 02/02/27 01:24:27
Modified: src/main/org/jboss/system/server ServerConfig.java
ServerConfigImpl.java ServerConfigImplMBean.java
ServerImpl.java ServerLoader.java
Log:
o Release structure and server config changes
Revision Changes Path
1.6 +158 -74 jboss-system/src/main/org/jboss/system/server/ServerConfig.java
Index: ServerConfig.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerConfig.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ServerConfig.java 27 Feb 2002 05:49:44 -0000 1.5
+++ ServerConfig.java 27 Feb 2002 09:24:26 -0000 1.6
@@ -16,7 +16,7 @@
/**
* The interface of the basic <em>typed</em> JBoss server configuration.
*
- * @version <tt>$Revision: 1.5 $</tt>
+ * @version <tt>$Revision: 1.6 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
public interface ServerConfig
@@ -32,13 +32,13 @@
*
* <p>These libraries will be loaded from <tt>LIBRARY_URL</tt>.
*/
- String BOOT_LIBRARY_LIST = "org.jboss.system.server.boot.library.list";
+ String BOOT_LIBRARY_LIST = "jboss.boot.library.list";
/**
* Constant that holds the name of the environment property
* for specifying the class type of the server to create.
*/
- String SERVER_TYPE = "org.jboss.system.server.type";
+ String SERVER_TYPE = "jboss.server.type";
/////////////////////////////////////////////////////////////////////////
@@ -47,74 +47,116 @@
/**
* Constant that holds the name of the environment property
- * for specifying the home directory for JBoss.
+ * for specifying the home directory for JBoss.
*/
- String HOME_DIR = "org.jboss.system.server.home.dir";
+ String HOME_DIR = "jboss.home.dir";
/**
* Constant that holds the name of the environment property
- * for specifying the directory which JBoss will use for
- * temporary file storage.
+ * for specifying the home URL for JBoss.
+ *
+ * <p>If not set then the value of HOME_DIR will converted into a URL.
+ */
+ String HOME_URL = "jboss.home.url";
+
+ /**
+ * Constant that holds the name of the environment property
+ * for specifying the URL where JBoss will read library files
+ * from.
*
- * <p>If not set then the value of <tt><em>HOME_DIR</em>/tmp</tt>
- * will be used.
+ * <p>Defaults to <tt><em>HOME_URL</em>/lib</tt>/
*/
- String TEMP_DIR = "org.jboss.system.server.temp.dir";
+ String LIBRARY_URL = "jboss.lib.url";
+
+ /**
+ * Constant that holds the name of the environment property
+ * for specifying the URL where JBoss will read patch library files
+ * from.
+ *
+ * <p>If this value is a <tt>file</tt> URL, then all .zip and .jar files
+ * inside will be prepended to the classpath. Otherwise the URL will be
+ * added to the classpath. If not set then the no patch files will be
+ * loaded.
+ */
+ String PATCH_URL = "jboss.patch.url";
+
+ /**
+ * Constant that holds the name of the environment property
+ * for specifying the name of the server which will be used to
+ * calculate the servers home directory and url.
+ *
+ * <p>Defaults to <tt>default</tt>.
+ */
+ String SERVER_NAME = "jboss.server.name";
+
+ /**
+ * Constant that holds the name of the environment property
+ * for specifying the base directory for calculating server
+ * home directories.
+ *
+ * <p>Defaults to <tt><em>HOME_DIR</em>/server</tt>.
+ */
+ String SERVER_BASE_DIR = "jboss.server.base.dir";
+
+ /**
+ * Constant that holds the name of the environment property
+ * for specifying the server home directory for JBoss.
+ *
+ * <p>Defaults to <tt><em>SERVER_BASE_DIR</em>/<em>SERVER_NAME</em></tt>.
+ */
+ String SERVER_HOME_DIR = "jboss.server.home.dir";
/**
* Constant that holds the name of the environment property
* for specifying the directory which JBoss will use for
- * persistent data file storage.
+ * temporary file storage.
*
- * <p>If not set then the value of <tt><em>HOME_DIR</em>/db</tt>
- * will be used.
+ * <p>Defaults to <tt><em>SERVER_HOME_DIR</em>/tmp</tt> .
*/
- String DATA_DIR = "org.jboss.system.server.data.dir";
+ String SERVER_TEMP_DIR = "jboss.server.temp.dir";
/**
* Constant that holds the name of the environment property
- * for specifying the base URL which JBoss will use.
+ * for specifying the directory which JBoss will use for
+ * persistent data file storage.
+ *
+ * <p>Defaults to <tt><em>SERVER_HOME_DIR</em>/db</tt>.
*/
- String INSTALL_URL = "org.jboss.system.server.install.url";
+ String SERVER_DATA_DIR = "jboss.server.data.dir";
/**
* Constant that holds the name of the environment property
- * for specifying the base URL from which JBoss will read it's
- * configuration from.
+ * for specifying the base URL for calculating server
+ * home URLs.
*
- * <p>If not set then the value of <tt><em>INSTALL_URL</em>/conf</tt>
- * will be used.
+ * <p>Defaults to <tt><em>HOME_URL</em>/server</tt>.
*/
- String CONFIG_URL = "org.jboss.system.server.config.url";
+ String SERVER_BASE_URL = "jboss.server.base.url";
/**
* Constant that holds the name of the environment property
- * for specifying the name of the configuration which JBoss
- * will read from under <tt>CONFIG_URL</tt>.
+ * for specifying the server home URL for JBoss.
*
- * <p>If not set then the value of <tt>default</tt>
- * will be used.
+ * <p>Defaults to <tt><em>SERVER_BASE_URL</em>/<em>SERVER_NAME</em></tt>.
*/
- String CONFIG_NAME = "org.jboss.system.server.config.name";
+ String SERVER_HOME_URL = "jboss.server.home.url";
/**
* Constant that holds the name of the environment property
- * for specifying the URL where JBoss will read library files
- * from.
+ * for specifying the server configuration URL.
*
- * <p>If not set then the value of <tt><em>INSTALL_URL</em>/lib</tt>
- * will be used.
+ * <p>Defaults to <tt><em>SERVER_HOME_UTL</em>/conf</tt> .
*/
- String LIBRARY_URL = "org.jboss.system.server.library.url";
+ String SERVER_CONFIG_URL = "jboss.server.config.url";
/**
* Constant that holds the name of the environment property
- * for specifying the URL where JBoss will read patch library files
- * from.
+ * for specifying the URL where JBoss will read server specific
+ * library files from.
*
- * <p>If not set then the no patch files will be loaded.
+ * <p>Defaults to <tt><em>SERVER_HOME_URL</em>/lib</tt>/
*/
- String PATCH_URL = "org.jboss.system.server.patch.url";
+ String SERVER_LIBRARY_URL = "jboss.server.lib.url";
/**
* Constant that holds the name of the environment property
@@ -123,7 +165,7 @@
*
* <p>If not set then the server will default to exiting on shutdown.
*/
- String EXIT_ON_SHUTDOWN = "org.jboss.system.server.exitonshutdown";
+ String EXIT_ON_SHUTDOWN = "jboss.server.exitonshutdown";
/////////////////////////////////////////////////////////////////////////
@@ -131,36 +173,43 @@
/////////////////////////////////////////////////////////////////////////
/**
- * The suffix used when generating the default value for {@link #DATA_DIR}.
- * This value is appened to {@link #HOME_DIR}.
+ * The suffix used when generating the default value for {@link #LIBRARY_URL}
+ * and {@link #SERVER_LIBRARY_URL}.
*/
- String DATA_DIR_SUFFIX = "db";
+ String LIBRARY_URL_SUFFIX = "lib/";
/**
- * The suffix used when generating the default value for {@link #TEMP_DIR}.
- * This value is appened to {@link #HOME_DIR}.
+ * The suffix used when generating the default value for {@link
#SERVER_CONFIG_URL}.
*/
- String TEMP_DIR_SUFFIX = "tmp";
+ String SERVER_CONFIG_URL_SUFFIX = "conf/";
/**
- * The suffix used when generating the default value for {@link #LIBRARY_URL}.
- * This value is appened to {@link #INSTALL_URL}.
+ * The suffix used when generating the default value for {@link
#SERVER_BASE_DIR}.
*/
- String LIBRARY_URL_SUFFIX = "lib/";
+ String SERVER_BASE_DIR_SUFFIX = "server";
+
+ /**
+ * The suffix used when generating the default value for {@link
#SERVER_BASE_URL}.
+ */
+ String SERVER_BASE_URL_SUFFIX = "server/";
/**
- * The suffix used when generating the default value for {@link #CONFIG_URL}.
- * This value is appened to {@link #INSTALL_URL}.
+ * The suffix used when generating the default value for {@link
#SERVER_DATA_DIR}.
*/
- String CONFIG_URL_SUFFIX = "conf/";
+ String SERVER_DATA_DIR_SUFFIX = "db";
+
+ /**
+ * The suffix used when generating the default value for {@link
#SERVER_TEMP_DIR}.
+ */
+ String SERVER_TEMP_DIR_SUFFIX = "tmp";
/////////////////////////////////////////////////////////////////////////
// Defaults //
/////////////////////////////////////////////////////////////////////////
- /** The default value for {@link #CONFIG_NAME}. */
- String DEFAULT_CONFIG_NAME = "default";
+ /** The default value for {@link #SERVER_NAME}. */
+ String DEFAULT_SERVER_NAME = "default";
/** The default value for {@link #EXIT_ON_SHUTDOWN}. */
boolean DEFAULT_EXIT_ON_SHUTDOWN = false;
@@ -171,60 +220,95 @@
/////////////////////////////////////////////////////////////////////////
/**
- * Get the configuration name of the server.
+ * Get the local home directory which the server is running from.
*
- * @return The configuration name of the server.
+ * @return The local server home directory.
*/
- String getConfigName();
+ File getHomeDir();
/**
- * Get the local home directory which the server is running from.
+ * Get the home URL which the server is running from.
*
- * @return The local server home directory.
+ * @return The home URL which the server is running from.
*/
- File getHomeDir();
+ URL getHomeURL();
+
+ /**
+ * Get the library URL for the server.
+ *
+ * @return The library URL for the server.
+ */
+ URL getLibraryURL();
+
+ /**
+ * Get the patch URL for the server.
+ *
+ * @return The patch URL for the server.
+ */
+ URL getPatchURL();
+
+ /**
+ * Get the name of the server.
+ *
+ * @return The name of the server.
+ */
+ String getServerName();
+
+ /**
+ * Get the base directory for calculating server home directories.
+ *
+ * @return Base server home directory.
+ */
+ File getServerBaseDir();
+
+ /**
+ * Get the server home directory.
+ *
+ * @return Server home directory.
+ */
+ File getServerHomeDir();
/**
* Get the directory where temporary files will be stored.
*
* @return The directory where the server stores temporary files.
*/
- File getTempDir();
+ File getServerTempDir();
/**
* Get the directory where local data will be stored.
*
* @return The directory where the server stores local data.
*/
- File getDataDir();
-
+ File getServerDataDir();
+
/**
- * Get the installation URL for the server.
+ * Get the base directory for calculating server home URLs.
*
- * @return The installation URL for the server.
+ * @return Base server home URL.
*/
- URL getInstallURL();
-
+ URL getServerBaseURL();
+
/**
- * Get the library URL for the server.
+ * Get the server home URL.
*
- * @return The library URL for the server.
+ * @return Server home URL.
*/
- URL getLibraryURL();
-
+ URL getServerHomeURL();
+
/**
- * Get the configuration URL for the server.
+ * Get the server library URL.
*
- * @return The configuration URL for the server.
+ * @return Server library URL.
*/
- URL getConfigURL();
-
+ URL getServerLibraryURL();
+
/**
- * Get the patch URL for the server.
+ * Get the server configuration URL.
*
- * @return The patch URL for the server.
+ * @return Server configuration URL.
*/
- URL getPatchURL();
+ URL getServerConfigURL();
/**
* Enable or disable exiting the JVM when {@link Server#shutdown} is called.
1.3 +197 -80
jboss-system/src/main/org/jboss/system/server/ServerConfigImpl.java
Index: ServerConfigImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerConfigImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServerConfigImpl.java 27 Feb 2002 02:01:18 -0000 1.2
+++ ServerConfigImpl.java 27 Feb 2002 09:24:26 -0000 1.3
@@ -28,36 +28,22 @@
* code that needs to access these values does not have to directly
* worry about problems with lazy construction of final URL values.
*
+ * <p>Most values are determined durring first call to getter. All values
+ * when determined will have equivilent system properties set.
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class ServerConfigImpl
implements ServerConfig, ServerConfigImplMBean
{
/** The configuration properties to pull data from. */
- private final Properties props;
+ private Properties props;
- /** The local home directory for the server. */
- private final File homeDir;
-
- /** The directory for server temporay files. */
- private File tempDir;
-
- /** The directory for local data files. */
- private File dataDir;
-
- /** The base installation URL, used to construct other URLs. */
- private final URL installURL;
-
- /** The configuration name to use. */
- private String configName;
-
- /** The URL where configuration files will be found. */
- private URL configURL;
-
- /** The base URL where library files are. */
+ private File homeDir;
+ private URL homeURL;
private URL libraryURL;
-
+
/**
* The base URL where patch files will be loaded from. This is
* typed as an Object to allow its value to contain Null.VALUE
@@ -67,6 +53,16 @@
*/
private Object patchURL;
+ private String serverName;
+ private File serverBaseDir;
+ private File serverHomeDir;
+ private File serverTempDir;
+ private File serverDataDir;
+ private URL serverBaseURL;
+ private URL serverHomeURL;
+ private URL serverLibraryURL;
+ private URL serverConfigURL;
+
/** Exit on shutdown flag. */
private MuBoolean exitOnShutdown;
@@ -81,14 +77,17 @@
{
this.props = props;
- // Must home DIR and install URL
+ // Must have HOME_DIR
homeDir = getFile(ServerConfig.HOME_DIR);
if (homeDir == null)
throw new Exception("Missing configuration value for: " +
ServerConfig.HOME_DIR);
+ System.setProperty(ServerConfig.HOME_DIR, homeDir.toString());
- installURL = getURL(ServerConfig.INSTALL_URL);
- if (installURL == null)
- throw new Exception("Missing configuration value for: " +
ServerConfig.INSTALL_URL);
+ // If not set then default to homeDir
+ homeURL = getURL(ServerConfig.HOME_URL);
+ if (homeURL == null)
+ homeURL = homeDir.toURL();
+ System.setProperty(ServerConfig.HOME_URL, homeURL.toString());
}
/**
@@ -123,98 +122,178 @@
// Typed Access //
/////////////////////////////////////////////////////////////////////////
- public String getConfigName() {
- if (configName == null) {
- configName = props.getProperty(ServerConfig.CONFIG_NAME,
ServerConfig.DEFAULT_CONFIG_NAME);
+ public File getHomeDir()
+ {
+ return homeDir;
+ }
+
+ public URL getHomeURL()
+ {
+ return homeURL;
+ }
+
+ public URL getLibraryURL()
+ {
+ if (libraryURL == null) {
+ try {
+ libraryURL = getURL(ServerConfig.LIBRARY_URL);
+ if (libraryURL == null) {
+ libraryURL = new URL(homeURL, ServerConfig.LIBRARY_URL_SUFFIX);
+ }
+ System.setProperty(ServerConfig.LIBRARY_URL, libraryURL.toString());
+ }
+ catch (MalformedURLException e) {
+ throw new NestedRuntimeException(e);
+ }
}
- return configName;
+ return libraryURL;
}
- public File getHomeDir() {
- // this is preset in constructor
- return homeDir;
+ public URL getPatchURL()
+ {
+ if (patchURL == null) {
+ try {
+ patchURL = getURL(ServerConfig.PATCH_URL);
+ if (patchURL == null) {
+ patchURL = Null.VALUE;
+ }
+ else {
+ System.setProperty(ServerConfig.PATCH_URL, patchURL.toString());
+ }
+ }
+ catch (MalformedURLException e) {
+ throw new NestedRuntimeException(e);
+ }
+ }
+
+ if (patchURL == Null.VALUE)
+ return null;
+
+ return (URL)patchURL;
}
- public File getTempDir() {
- if (tempDir == null) {
- tempDir = getFile(ServerConfig.TEMP_DIR);
- if (tempDir == null) {
- tempDir = new File(homeDir, ServerConfig.TEMP_DIR_SUFFIX);
+ public String getServerName()
+ {
+ if (serverName == null) {
+ serverName = props.getProperty(ServerConfig.SERVER_NAME,
ServerConfig.DEFAULT_SERVER_NAME);
+ System.setProperty(ServerConfig.SERVER_NAME, serverName);
+ }
+ return serverName;
+ }
+
+ public File getServerBaseDir()
+ {
+ if (serverBaseDir == null) {
+ serverBaseDir = getFile(ServerConfig.SERVER_BASE_DIR);
+ if (serverBaseDir == null) {
+ serverBaseDir = new File(homeDir, ServerConfig.SERVER_BASE_DIR_SUFFIX);
+ System.setProperty(ServerConfig.SERVER_BASE_DIR,
serverBaseDir.toString());
}
}
-
- return tempDir;
+ return serverBaseDir;
}
- public File getDataDir() {
- if (dataDir == null) {
- dataDir = getFile(ServerConfig.DATA_DIR);
- if (dataDir == null) {
- dataDir = new File(homeDir, ServerConfig.DATA_DIR_SUFFIX);
+ public File getServerHomeDir() {
+ if (serverHomeDir == null) {
+ serverHomeDir = getFile(ServerConfig.SERVER_HOME_DIR);
+ if (serverHomeDir == null) {
+ serverHomeDir = new File(getServerBaseDir(),getServerName());
+ System.setProperty(ServerConfig.SERVER_HOME_DIR,
serverHomeDir.toString());
}
}
-
- return dataDir;
+ return serverHomeDir;
}
-
- public URL getInstallURL() {
- // this is preset in constructor
- return installURL;
+
+ public File getServerTempDir()
+ {
+ if (serverTempDir == null) {
+ serverTempDir = getFile(ServerConfig.SERVER_TEMP_DIR);
+ if (serverTempDir == null) {
+ serverTempDir = new
File(getServerHomeDir(),ServerConfig.SERVER_TEMP_DIR_SUFFIX);
+ System.setProperty(ServerConfig.SERVER_TEMP_DIR,
serverTempDir.toString());
+ }
+ }
+ return serverTempDir;
}
-
- public URL getLibraryURL() {
- if (libraryURL == null) {
+
+ public File getServerDataDir()
+ {
+ if (serverDataDir == null) {
+ serverDataDir = getFile(ServerConfig.SERVER_DATA_DIR);
+ if (serverDataDir == null) {
+ serverDataDir = new
File(getServerHomeDir(),ServerConfig.SERVER_DATA_DIR_SUFFIX);
+ System.setProperty(ServerConfig.SERVER_DATA_DIR,
serverDataDir.toString());
+ }
+ }
+ return serverDataDir;
+ }
+
+ public URL getServerBaseURL()
+ {
+ if (serverBaseURL == null) {
try {
- libraryURL = getURL(ServerConfig.LIBRARY_URL);
- if (libraryURL == null) {
- libraryURL = new URL(installURL, ServerConfig.LIBRARY_URL_SUFFIX);
+ serverBaseURL = getURL(ServerConfig.SERVER_BASE_URL);
+ if (serverBaseURL == null) {
+ serverBaseURL = new URL(homeURL,
ServerConfig.SERVER_BASE_URL_SUFFIX);
}
+ System.setProperty(ServerConfig.SERVER_BASE_URL,
serverBaseURL.toString());
}
catch (MalformedURLException e) {
throw new NestedRuntimeException(e);
}
}
- return libraryURL;
+ return serverBaseURL;
}
- public URL getConfigURL() {
- if (configURL == null) {
+ public URL getServerHomeURL()
+ {
+ if (serverHomeURL == null) {
try {
- // get the base url
- configURL = getURL(ServerConfig.CONFIG_URL);
- if (configURL == null) {
- configURL = new URL(installURL, ServerConfig.CONFIG_URL_SUFFIX);
+ serverHomeURL = getURL(ServerConfig.SERVER_HOME_URL);
+ if (serverHomeURL == null) {
+ serverHomeURL = new URL(getServerBaseURL(), getServerName() + "/");
}
-
- // tack on config name
- String temp = getConfigName();
- if (!temp.endsWith("/")) temp += "/";
- configURL = new URL(configURL, temp);
+ System.setProperty(ServerConfig.SERVER_HOME_URL,
serverHomeURL.toString());
}
catch (MalformedURLException e) {
throw new NestedRuntimeException(e);
}
}
- return configURL;
+ return serverHomeURL;
}
-
- public URL getPatchURL() {
- if (patchURL == null) {
+
+ public URL getServerLibraryURL()
+ {
+ if (serverLibraryURL == null) {
try {
- patchURL = getURL(ServerConfig.PATCH_URL);
- if (patchURL == null) {
- patchURL = Null.VALUE;
+ serverLibraryURL = getURL(ServerConfig.SERVER_LIBRARY_URL);
+ if (serverLibraryURL == null) {
+ serverLibraryURL = new URL(getServerHomeURL(),
ServerConfig.LIBRARY_URL_SUFFIX);
}
+ System.setProperty(ServerConfig.SERVER_LIBRARY_URL,
serverLibraryURL.toString());
}
catch (MalformedURLException e) {
throw new NestedRuntimeException(e);
}
}
+ return serverLibraryURL;
+ }
- if (patchURL == Null.VALUE)
- return null;
-
- return (URL)patchURL;
+ public URL getServerConfigURL()
+ {
+ if (serverConfigURL == null) {
+ try {
+ serverConfigURL = getURL(ServerConfig.SERVER_CONFIG_URL);
+ if (serverConfigURL == null) {
+ serverConfigURL = new URL(getServerHomeURL(),
ServerConfig.SERVER_CONFIG_URL_SUFFIX);
+ }
+ System.setProperty(ServerConfig.SERVER_CONFIG_URL,
serverConfigURL.toString());
+ }
+ catch (MalformedURLException e) {
+ throw new NestedRuntimeException(e);
+ }
+ }
+ return serverConfigURL;
}
public void setExitOnShutdown(final boolean flag) {
@@ -239,4 +318,42 @@
return exitOnShutdown.get();
}
+
+
+ /////////////////////////////////////////////////////////////////////////
+ // Deprecated //
+ /////////////////////////////////////////////////////////////////////////
+
+ /**
+ * @deprecated
+ */
+ public URL getInstallURL()
+ {
+ return getHomeURL();
+ }
+
+ /**
+ * @deprecated
+ */
+ public URL getConfigURL()
+ {
+ return getServerConfigURL();
+ }
+
+ /**
+ * @deprecated
+ */
+ public File getDataDir()
+ {
+ return getServerDataDir();
+ }
+
+ /**
+ * @deprecated
+ */
+ public File getTempDir()
+ {
+ return getServerTempDir();
+ }
+
}
1.3 +85 -25
jboss-system/src/main/org/jboss/system/server/ServerConfigImplMBean.java
Index: ServerConfigImplMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerConfigImplMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ServerConfigImplMBean.java 27 Feb 2002 02:01:18 -0000 1.2
+++ ServerConfigImplMBean.java 27 Feb 2002 09:24:26 -0000 1.3
@@ -21,7 +21,7 @@
* The JMX MBean interface for the <tt>ServerConfigImpl</tt> component.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface ServerConfigImplMBean
{
@@ -29,60 +29,95 @@
ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
/**
- * Get the configuration name of the server.
+ * Get the local home directory which the server is running from.
*
- * @return The configuration name of the server.
+ * @return The local server home directory.
*/
- String getConfigName();
+ File getHomeDir();
/**
- * Get the local home directory which the server is running from.
+ * Get the home URL which the server is running from.
*
- * @return The local server home directory.
+ * @return The home URL which the server is running from.
*/
- File getHomeDir();
+ URL getHomeURL();
+
+ /**
+ * Get the library URL for the server.
+ *
+ * @return The library URL for the server.
+ */
+ URL getLibraryURL();
+
+ /**
+ * Get the patch URL for the server.
+ *
+ * @return The patch URL for the server.
+ */
+ URL getPatchURL();
+
+ /**
+ * Get the name of the server.
+ *
+ * @return The name of the server.
+ */
+ String getServerName();
+
+ /**
+ * Get the base directory for calculating server home directories.
+ *
+ * @return Base server home directory.
+ */
+ File getServerBaseDir();
+
+ /**
+ * Get the server home directory.
+ *
+ * @return Server home directory.
+ */
+ File getServerHomeDir();
/**
* Get the directory where temporary files will be stored.
*
* @return The directory where the server stores temporary files.
*/
- File getTempDir();
+ File getServerTempDir();
/**
* Get the directory where local data will be stored.
*
* @return The directory where the server stores local data.
*/
- File getDataDir();
-
+ File getServerDataDir();
+
/**
- * Get the installation URL for the server.
+ * Get the base directory for calculating server home URLs.
*
- * @return The installation URL for the server.
+ * @return Base server home URL.
*/
- URL getInstallURL();
-
+ URL getServerBaseURL();
+
/**
- * Get the library URL for the server.
+ * Get the server home URL.
*
- * @return The library URL for the server.
+ * @return Server home URL.
*/
- URL getLibraryURL();
-
+ URL getServerHomeURL();
+
/**
- * Get the configuration URL for the server.
+ * Get the server library URL.
*
- * @return The configuration URL for the server.
+ * @return Server library URL.
*/
- URL getConfigURL();
-
+ URL getServerLibraryURL();
+
/**
- * Get the patch URL for the server.
+ * Get the server configuration URL.
*
- * @return The patch URL for the server.
+ * @return Server configuration URL.
*/
- URL getPatchURL();
+ URL getServerConfigURL();
/**
* Enable or disable exiting the JVM when {@link Server#shutdown} is called.
@@ -99,4 +134,29 @@
* @return The current value of the exit on shutdown flag.
*/
boolean getExitOnShutdown();
+
+
+ /////////////////////////////////////////////////////////////////////////
+ // Deprecated //
+ /////////////////////////////////////////////////////////////////////////
+
+ /**
+ * @deprecated
+ */
+ URL getInstallURL();
+
+ /**
+ * @deprecated
+ */
+ URL getConfigURL();
+
+ /**
+ * @deprecated
+ */
+ File getDataDir();
+
+ /**
+ * @deprecated
+ */
+ File getTempDir();
}
1.7 +12 -9 jboss-system/src/main/org/jboss/system/server/ServerImpl.java
Index: ServerImpl.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ServerImpl.java 27 Feb 2002 05:51:25 -0000 1.6
+++ ServerImpl.java 27 Feb 2002 09:24:26 -0000 1.7
@@ -48,7 +48,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class ServerImpl
implements Server, ServerImplMBean
@@ -147,14 +147,17 @@
log.debug("Using config: " + config);
// Log the basic configuration elements
- log.info("Config Name: " + config.getConfigName());
log.info("Home Dir: " + config.getHomeDir());
- log.info("Install URL: " + config.getInstallURL());
- log.info("Configuration URL: " + config.getConfigURL());
+ log.info("Home URL: " + config.getHomeURL());
log.info("Library URL: " + config.getLibraryURL());
- log.info("Data Dir: " + config.getDataDir());
- log.info("Temporay Dir: " + config.getTempDir());
log.info("Patch URL: " + config.getPatchURL());
+ log.info("Server Name: " + config.getServerName());
+ log.info("Server Home Dir: " + config.getServerHomeDir());
+ log.info("Server Home URL: " + config.getServerHomeURL());
+ log.info("Server Data Dir: " + config.getServerDataDir());
+ log.info("Server Temp Dir: " + config.getServerTempDir());
+ log.info("Server Config URL: " + config.getServerConfigURL());
+ log.info("Server Library URL: " + config.getServerLibraryURL());
}
/**
@@ -321,7 +324,7 @@
// Ok, now do a first deploy of JBoss' jboss-service.xml
server.invoke(mainDeployer,
"deploy",
- new Object[] { config.getConfigURL() + "jboss-service.xml" },
+ new Object[] { config.getServerConfigURL() +
"jboss-service.xml" },
new String[] { String.class.getName() });
// Start the main deployer thread
@@ -381,8 +384,8 @@
}
}
- // Add configuration directory to be able to load config files as resources
- list.add(config.getConfigURL());
+ // Add the server configuration directory to be able to load config files as
resources
+ list.add(config.getServerConfigURL());
// Not needed, ServerImpl will have the basics on its classpath from
ServerLoader
// may want to bring this back at some point if we want to have reloadable
core
1.6 +9 -20 jboss-system/src/main/org/jboss/system/server/ServerLoader.java
Index: ServerLoader.java
===================================================================
RCS file:
/cvsroot/jboss/jboss-system/src/main/org/jboss/system/server/ServerLoader.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ServerLoader.java 27 Feb 2002 05:51:25 -0000 1.5
+++ ServerLoader.java 27 Feb 2002 09:24:26 -0000 1.6
@@ -25,7 +25,7 @@
* <pre>
* // setup the basic server config properties
* Properties props = new Properties(System.getProperties());
- * props.put(ServerConfig.LIBRARY_URL, "http://myserver.com/myjboss/lib/");
+ * props.put(ServerConfig.SERVER_LIBRARY_URL,
"http://myserver.com/myjboss/lib/");
* // set some more properties
*
* // create a new loader to do the dirty work
@@ -50,7 +50,7 @@
* server.shutdown();
* </pre>
*
- * @version <tt>$Revision: 1.5 $</tt>
+ * @version <tt>$Revision: 1.6 $</tt>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
*/
public class ServerLoader
@@ -83,11 +83,7 @@
protected List extraClasspath = new LinkedList();
/**
- * Construct a <tt>ServerLoader</tt>. The properties map
- * passed in must contain a value for {@link ServerConfig#INSTALL_URL}
- * or {@link ServerConfig#LIBRARY_URL} at the very minimum for the
- * loader to function. Other values may be required by the server
- * implementation as well.
+ * Construct a <tt>ServerLoader</tt>.
*
* @param props Configuration properties.
*
@@ -100,24 +96,17 @@
this.props = props;
- //
- // NOTE:
- //
- // The following is a tiny duplication of what a ServerConfig impl
- // does. It was seperated to free the loader layer from the size
- // of a full impl. Make sure changes are sync'd when reving SC
- //
-
libraryURL = getURL(ServerConfig.LIBRARY_URL);
if (libraryURL == null) {
- // must have install url, or we can't continue
- URL installURL = getURL(ServerConfig.INSTALL_URL);
- if (installURL == null)
- throw new Exception("Missing configuration value for: " +
ServerConfig.INSTALL_URL);
+ // must have HOME_URL, or we can't continue
+ URL homeURL = getURL(ServerConfig.HOME_URL);
+ if (homeURL == null) {
+ throw new Exception("Missing configuration value for: " +
ServerConfig.LIBRARY_URL);
+ }
// need libraray url to make boot urls list
- libraryURL = new URL(installURL, ServerConfig.LIBRARY_URL_SUFFIX);
+ libraryURL = new URL(homeURL, ServerConfig.LIBRARY_URL_SUFFIX);
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development