Index: system-jmx/.classpath
===================================================================
--- system-jmx/.classpath (revision 89343)
+++ system-jmx/.classpath (working copy)
@@ -24,6 +24,8 @@
-
+
+
+
Index: system-jmx/src/main/org/jboss/deployment/SARDeployer.java
===================================================================
--- system-jmx/src/main/org/jboss/deployment/SARDeployer.java (revision 89343)
+++ system-jmx/src/main/org/jboss/deployment/SARDeployer.java (working copy)
@@ -43,7 +43,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.mx.loading.LoaderRepositoryFactory;
import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
import org.jboss.mx.util.MBeanProxyExt;
@@ -437,9 +437,9 @@
ServiceControllerMBean.OBJECT_NAME, server);
// Get the data directory, install url & library url
- ServerConfig config = ServerConfigLocator.locate();
- dataDir = config.getServerDataDir();
- serverHomeURL = config.getServerHomeURL();
+ JBossASServerConfig config = ServerConfigLocator.locate();
+ dataDir = new File(config.getServerDataLocation().toURI());
+ serverHomeURL = config.getServerHomeLocation();
}
/**
Index: system-jmx/src/main/org/jboss/deployment/SubDeployerSupport.java
===================================================================
--- system-jmx/src/main/org/jboss/deployment/SubDeployerSupport.java (revision 89343)
+++ system-jmx/src/main/org/jboss/deployment/SubDeployerSupport.java (working copy)
@@ -34,8 +34,7 @@
import javax.management.Notification;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.system.server.ServerConfigLocator;
@@ -103,10 +102,10 @@
protected void createService() throws Exception
{
// get the temporary directories to use
- ServerConfig config = ServerConfigLocator.locate();
- tempNativeDir = config.getServerNativeDir();
- tempDeployDir = config.getServerTempDeployDir();
- loadNative = ServerConfigUtil.isLoadNative();
+ JBossASServerConfig config = ServerConfigLocator.locate();
+ tempNativeDir = new File(config.getNativeLibraryLocation().toURI());
+ tempDeployDir = new File(config.getServerTempLocation().toURI());
+ loadNative = config.isLoadNative();
// Setup the proxy to mainDeployer
mainDeployer = (MainDeployerMBean)
Index: system-jmx/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java
===================================================================
--- system-jmx/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java (revision 89343)
+++ system-jmx/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java (working copy)
@@ -39,7 +39,7 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployment.DefaultDeploymentSorter;
import org.jboss.deployment.IncompleteDeploymentException;
import org.jboss.mx.util.JMXExceptionDecoder;
@@ -686,9 +686,9 @@
{
// get server's home for relative paths, need this for setting
// attribute final values, so we need to do it here
- ServerConfig serverConfig = ServerConfigLocator.locate();
- serverHome = serverConfig.getServerHomeDir();
- serverHomeURL = serverConfig.getServerHomeURL();
+ JBossASServerConfig serverConfig = ServerConfigLocator.locate();
+ serverHomeURL = serverConfig.getServerHomeLocation();
+ serverHome = new File(serverHomeURL.toURI());
return super.preRegister(server, name);
}
Index: system-jmx/src/main/org/jboss/deployment/XSLSubDeployer.java
===================================================================
--- system-jmx/src/main/org/jboss/deployment/XSLSubDeployer.java (revision 89343)
+++ system-jmx/src/main/org/jboss/deployment/XSLSubDeployer.java (working copy)
@@ -37,7 +37,7 @@
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.util.xml.DOMWriter;
import org.jboss.util.xml.JBossEntityResolver;
@@ -277,4 +277,40 @@
}
return original;
}
+
+ /**
+ * ServerConfigUtil
+ *
+ * @author ALR
+ * @version $Revision$
+ * @deprecated Moved from jboss-bootstrap Legacy as a transition class;
+ */
+ @Deprecated
+ private static class ServerConfigUtil
+ {
+ /**
+ * Utility to get a shortened url relative to the server home if possible
+ *
+ * @param longUrl
+ * @return the short url
+ */
+ public static String shortUrlFromServerHome(String longUrl)
+ {
+ String serverHomeUrl = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_URL);
+
+ if (longUrl == null || serverHomeUrl == null)
+ return longUrl;
+
+ if (longUrl.startsWith(serverHomeUrl))
+ return ".../" + longUrl.substring(serverHomeUrl.length());
+ else
+ {
+ String jarServerHomeUrl = "jar:" + serverHomeUrl;
+ if (longUrl.startsWith(jarServerHomeUrl))
+ return ".../" + longUrl.substring(jarServerHomeUrl.length());
+ else
+ return longUrl;
+ }
+ }
+ }
}
Index: system-jmx/src/main/org/jboss/deployment/MainDeployer.java
===================================================================
--- system-jmx/src/main/org/jboss/deployment/MainDeployer.java (revision 89343)
+++ system-jmx/src/main/org/jboss/deployment/MainDeployer.java (working copy)
@@ -45,12 +45,13 @@
import java.util.StringTokenizer;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.Notification;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.structure.spi.DeploymentContext;
@@ -502,9 +503,9 @@
*/
protected void createService() throws Exception
{
- ServerConfig config = ServerConfigLocator.locate();
+ JBossASServerConfig config = ServerConfigLocator.locate();
// Get the temp directory location
- File basedir = config.getServerTempDir();
+ File basedir = new File(config.getServerTempLocation().toURI());
// Set the local copy temp dir to tmp/deploy
tempDir = new File(basedir, "deploy");
// Delete any existing content
Index: system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java
===================================================================
--- system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java (working copy)
@@ -21,11 +21,11 @@
*/
package org.jboss.system.server;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.mx.util.MBeanProxyExt;
/**
- * A helper for locating the {@link ServerConfig} instance
+ * A helper for locating the {@link JBossASServerConfig} instance
* for the running server.
*
* @version $Revision$
@@ -33,13 +33,13 @@
*/
public class ServerConfigLocator
{
- private static volatile ServerConfig instance = null;
+ private static volatile JBossASServerConfig instance = null;
- public static ServerConfig locate()
+ public static JBossASServerConfig locate()
{
if (instance == null) {
- instance = (ServerConfig)
- MBeanProxyExt.create(ServerConfig.class,
+ instance = (JBossASServerConfig)
+ MBeanProxyExt.create(JBossASServerConfig.class,
ServerConfigImplMBean.OBJECT_NAME);
}
Index: system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java
===================================================================
--- system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java (working copy)
@@ -21,186 +21,17 @@
*/
package org.jboss.system.server;
-import java.io.File;
-import java.net.URL;
-
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.mx.util.ObjectNameFactory;
/**
* MBean interface.
*/
-public interface ServerConfigImplMBean
+public interface ServerConfigImplMBean extends JBossASServerConfig
{
/** Default ObjectName */
ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- /**
- * Get the server Specification-Version
- */
- String getSpecificationVersion();
-
- /**
- * Get the local home directory which the server is running from.
- */
- File getHomeDir();
-
- /**
- * Get the home URL which the server is running from.
- */
- URL getHomeURL();
-
- /**
- * Get the home URL which the server is running from.
- */
- URL getLibraryURL();
-
- /**
- * Get the patch URL for the server.
- */
- URL getPatchURL();
-
- /**
- * Get the name of the server.
- */
- String getServerName();
-
- /**
- * Get the base directory for calculating server home directories.
- */
- File getServerBaseDir();
-
- /**
- * Get the server home directory.
- */
- File getServerHomeDir();
-
- /**
- * Get the directory where log files will be stored.
- * @return the writable log directory
- */
- java.io.File getServerLogDir();
-
- /**
- * Get the directory where temporary files will be stored.
- */
- File getServerTempDir();
-
- /**
- * Get the directory where local data will be stored.
- */
- File getServerDataDir();
-
- /**
- * Get the base directory for calculating server home URLs.
- */
- URL getServerBaseURL();
-
- /**
- * Get the server home URL.
- */
- URL getServerHomeURL();
-
- /**
- * Get the server library URL.
- */
- URL getServerLibraryURL();
-
- /**
- * Get the server configuration URL.
- */
- URL getServerConfigURL();
-
- /**
- * Get the common base URL.
- */
- URL getCommonBaseURL();
-
- /**
- * Get the common library URL.
- */
- URL getCommonLibraryURL();
-
- /**
- * Get the current value of the flag that indicates if we are
- * using the platform MBeanServer as the main jboss server.
- * Both the {@link ServerConfig.PLATFORM_MBEANSERVER}
- * property must be set, and the jvm must be jdk1.5+
- */
- boolean getPlatformMBeanServer();
-
- /**
- * Enable or disable exiting the JVM when {@link Server#shutdown}
- * is called. If enabled, then shutdown calls {@link Server#exit}.
- * If disabled, then only the shutdown hook will be run.
- * @param flag True to enable calling exit on shutdown.
- */
- void setExitOnShutdown(boolean flag);
-
- /**
- * Get the current value of the exit on shutdown flag.
- * @return The current value of the exit on shutdown flag.
- */
- boolean getExitOnShutdown();
-
- /**
- * Enable or disable blocking when {@link Server#shutdown} is called.
- * If enabled, then shutdown will be called in the current thread.
- * If disabled, then the shutdown hook will be run ansynchronously
- * in a separate thread.
- * @param flag True to enable blocking shutdown.
- */
- void setBlockingShutdown(boolean flag);
-
- /**
- * Get the current value of the blocking shutdown flag.
- * @return The current value of the blocking shutdown flag.
- */
- boolean getBlockingShutdown();
-
- /**
- * Set the RequireJBossURLStreamHandlerFactory flag. if false,
- * exceptions when setting the URLStreamHandlerFactory will
- * be logged and ignored.
- * @param flag True to enable blocking shutdown.
- */
- void setRequireJBossURLStreamHandlerFactory(boolean flag);
-
- /**
- * Get the current value of the requireJBossURLStreamHandlerFactory flag.
- * @return The current value of the requireJBossURLStreamHandlerFactory flag.
- */
- boolean getRequireJBossURLStreamHandlerFactory();
-
- /**
- * Set the filename of the root deployable that will be used to
- * finalize the bootstrap process.
- * @param filename The filename of the root deployable.
- */
- void setRootDeploymentFilename(String filename);
-
- /**
- * Get the filename of the root deployable that will be used to
- * finalize the bootstrap process.
- * @return The filename of the root deployable.
- */
- String getRootDeploymentFilename();
-
- /**
- * Get the native dir for unpacking
- *
- * @return the directory
- */
- File getServerNativeDir() ;
-
- /**
- * Get the temporary deployment dir for unpacking
- *
- * @return the directory
- */
- File getServerTempDeployDir() ;
-
}
Index: system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java
===================================================================
--- system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java (working copy)
@@ -21,19 +21,13 @@
*/
package org.jboss.system.server;
-import javax.management.ObjectName;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.mx.util.ObjectNameFactory;
-
/**
* MBean interface.
*/
-public interface ServerImplMBean extends Server
+public interface ServerImplMBean extends JBossASServer, ServerConstants
{
- /** The default object name */
- ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.system:type=Server");
-
// Attributes ----------------------------------------------------
/**
Index: system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
===================================================================
--- system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java (working copy)
@@ -27,9 +27,10 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
+import java.util.EnumSet;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
-import java.util.Map;
import javax.management.ListenerNotFoundException;
import javax.management.MBeanNotificationInfo;
@@ -41,13 +42,22 @@
import javax.management.ObjectInstance;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.ServerProcess;
+import org.jboss.bootstrap.spi.Bootstrap;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
+import org.jboss.bootstrap.spi.config.ConfigurationInitializer;
+import org.jboss.bootstrap.spi.config.ConfigurationValidator;
+import org.jboss.bootstrap.spi.config.InvalidConfigurationException;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleEventException;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
+import org.jboss.bootstrap.spi.server.ServerInitializer;
import org.jboss.classloader.spi.ClassLoaderSystem;
import org.jboss.classloading.spi.RealClassLoader;
import org.jboss.classloading.spi.metadata.ExportAll;
import org.jboss.classloading.spi.vfs.policy.VFSClassLoaderPolicy;
import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
import org.jboss.mx.loading.RepositoryClassLoader;
import org.jboss.mx.server.ServerConstants;
import org.jboss.mx.util.JMXExceptionDecoder;
@@ -79,9 +89,9 @@
/** The JMX MBeanServer which will serve as our communication bus. */
private MBeanServer mbeanServer;
- private ServerProcess serverImpl;
+ private JBossASServer serverImpl;
private ServiceController controller;
- private ServerConfig serverConfig;
+ private JBossASServerConfig serverConfig;
private ServerConfigImplMBean serverConfigMBean;
private ServerInfoMBean serverInfo;
/** The kernel */
@@ -95,11 +105,11 @@
/** Whether to use the old classloader */
private boolean oldClassLoader;
- public ServerProcess getServerImpl()
+ public JBossASServer getServerImpl()
{
return serverImpl;
}
- public void setServerImpl(ServerProcess serverImpl)
+ public void setServerImpl(JBossASServer serverImpl)
{
this.serverImpl = serverImpl;
this.notificationEmitter = (NotificationEmitter) serverImpl;
@@ -178,10 +188,10 @@
ServerConstants.DEFAULT_MBEAN_SERVER_BUILDER_CLASS);
System.setProperty(ServerConstants.MBEAN_SERVER_BUILDER_CLASS_PROPERTY, builder);
- serverConfig = serverImpl.getConfig();
+ serverConfig = serverImpl.getConfiguration();
serverConfigMBean = new ServerConfigImpl(serverConfig);
// Check if we'll use the platform MBeanServer or instantiate our own
- if (serverConfig.getPlatformMBeanServer() == true)
+ if (serverConfig.isUsePlatformMBeanServer())
{
// jdk1.5+
ClassLoader cl = Thread.currentThread().getContextClassLoader();
@@ -287,21 +297,22 @@
// ServerImplMBean delegation
public void init(Properties props) throws Exception
{
- serverImpl.init(props);
+ serverImpl.initialize();
}
- public void exit()
- {
- serverImpl.exit();
- }
+ // AS isn't always going to be a standalone process
+// public void exit()
+// {
+// serverImpl.exit();
+// }
+//
+// public void exit(int exitcode)
+// {
+// serverImpl.exit(exitcode);
+// }
- public void exit(int exitcode)
+ public JBossASServerConfig getConfig()
{
- serverImpl.exit(exitcode);
- }
-
- public ServerConfig getConfig()
- {
return serverConfig;
}
public String getBuildDate()
@@ -349,24 +360,25 @@
return serverImpl.getVersionNumber();
}
- public void halt()
- {
- serverImpl.halt();
- }
+ // AS isn't always going to be a standalone process
+// public void halt()
+// {
+// serverImpl.halt();
+// }
+//
+// public void halt(int exitcode)
+// {
+// serverImpl.halt(exitcode);
+// }
- public void halt(int exitcode)
- {
- serverImpl.halt(exitcode);
- }
-
public boolean isInShutdown()
{
- return serverImpl.isInShutdown();
+ return serverImpl.getState().equals(LifecycleState.STOPPING);
}
public boolean isStarted()
{
- return serverImpl.isStarted();
+ return serverImpl.getState().equals(LifecycleState.STARTED);
}
public void runFinalization()
@@ -389,11 +401,140 @@
}
+ public Map getDeployments()
+ {
+ return serverImpl.getDeployments();
+ }
+
+ public Kernel getKernel()
+ {
+ return serverImpl.getKernel();
+ }
+
+ public void addBootstrap(final Bootstrap arg0) throws IllegalArgumentException
+ {
+ serverImpl.addBootstrap(arg0);
+ }
+
+ public ConfigurationInitializer getConfigInitializer()
+ {
+ return serverImpl.getConfigInitializer();
+ }
+
+ public JBossASServerConfig getConfiguration()
+ {
+ return serverImpl.getConfiguration();
+ }
+
+ public ServerInitializer getServerInitializer()
+ {
+ return serverImpl.getServerInitializer();
+ }
+
+ public LifecycleState getState()
+ {
+ return serverImpl.getState();
+ }
+
+ public ConfigurationValidator getValidator()
+ {
+ return serverImpl.getValidator();
+ }
+
+ public void initialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
+ {
+ serverImpl.initialize();
+ }
+
+ public void registerEventHandler(final LifecycleEventHandler arg0, final EnumSet arg1)
+ throws IllegalArgumentException
+ {
+ serverImpl.registerEventHandler(arg0, arg1);
+ }
+
+ public void registerEventHandler(final LifecycleEventHandler arg0, final LifecycleState... arg1)
+ throws IllegalArgumentException
+ {
+ serverImpl.registerEventHandler(arg0, arg1);
+
+ }
+
+ public void registerEventHandler(final LifecycleState arg0, final LifecycleEventHandler arg1)
+ throws IllegalArgumentException
+ {
+ serverImpl.registerEventHandler(arg0, arg1);
+ }
+
+ public void registerEventHandlers(final LifecycleState arg0, final LifecycleEventHandler... arg1)
+ throws IllegalArgumentException
+ {
+ serverImpl.registerEventHandlers(arg0, arg1);
+ }
+
+ public void removeBootstrap(final Bootstrap arg0)
+ throws IllegalArgumentException
+ {
+ serverImpl.removeBootstrap(arg0);
+
+ }
+
+ public void setConfigInitializer(final ConfigurationInitializer arg0)
+ throws IllegalStateException
+ {
+ serverImpl.setConfigInitializer(arg0);
+
+ }
+
+ public void setConfiguration(final JBossASServerConfig arg0)
+ {
+ serverImpl.setConfiguration(arg0);
+ }
+
+ public void setServerInitializer(final ServerInitializer arg0)
+ throws IllegalStateException
+ {
+ serverImpl.setServerInitializer(arg0);
+
+ }
+
+ public void setValidator(final ConfigurationValidator arg0) throws IllegalStateException
+ {
+ serverImpl.setValidator(arg0);
+
+ }
+
+ public boolean unregisterEventHandler(final LifecycleEventHandler arg0, final LifecycleState arg1)
+ throws IllegalArgumentException
+ {
+ return serverImpl.unregisterEventHandler(arg0, arg1);
+ }
+
public void shutdown()
{
- if (log.isTraceEnabled())
- log.trace("Shutdown caller:", new Throwable("Here"));
- serverImpl.shutdown();
+ // JBAS-6916
+ // We'll shut down the server via the Main shutdown hook...
+// if (log.isTraceEnabled())
+// log.trace("Shutdown caller:", new Throwable("Here"));
+// try{
+// serverImpl.shutdown();
+// }
+// catch(Throwable t)
+// {
+// throw new RuntimeException("Error in shutdown of server: " + serverImpl,t);
+// }
+
+ // JBAS-6916:
+ //TODO This must be removed, VM exit is not a feature of server shutdown.
+ // Now exit the Runtime, because AS has non-daemon Threads still
+ // chugging away.
+ new Thread()
+ {
+ public void run()
+ {
+ log.info("Server exit called, exiting the JVM now!");
+ Runtime.getRuntime().exit(1);
+ }
+ }.start();
}
/**
@@ -441,7 +582,7 @@
try
{
MBeanServer registeredServer = mbeanServer;
- if (serverConfig.getPlatformMBeanServer() == true)
+ if (serverConfig.isUsePlatformMBeanServer())
registeredServer = LazyMBeanServer.getRegisteredMBeanServer(mbeanServer);
MBeanServerFactory.releaseMBeanServer(registeredServer);
}
@@ -466,7 +607,7 @@
// Add the patch URL. If the url protocol is file, then
// add the contents of the directory it points to
- URL patchURL = serverConfig.getPatchURL();
+ URL patchURL = null; //serverConfig.getPatchURL(); //TODO Supply a patchURL?
if (patchURL != null)
{
if (patchURL.getProtocol().equals("file"))
@@ -493,7 +634,7 @@
}
// Add the mbeanServer configuration directory to be able to load serverConfig files as resources
- list.add(serverConfig.getServerConfigURL());
+ list.add(serverConfig.getServerConfLocation());
log.debug("Boot url list: " + list);
return list;
Index: system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java
===================================================================
--- system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java (working copy)
@@ -21,10 +21,11 @@
*/
package org.jboss.system.server;
-import java.io.File;
import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
/**
* An mbean wrapper for the BaseServerConfig that exposes the config as the
@@ -35,7 +36,7 @@
*/
public class ServerConfigImpl implements ServerConfigImplMBean
{
- private ServerConfig config;
+ private JBossASServerConfig config;
/**
* Construct a ServerConfigImpl with the ServerConfig pojo which will be used
@@ -43,12 +44,12 @@
*
* @param config - the ServerConfig pojo to expose as a ServerConfigImplMBean
*/
- public ServerConfigImpl(ServerConfig config)
+ public ServerConfigImpl(JBossASServerConfig config)
{
this.config = config;
}
- public ServerConfig getConfig()
+ public JBossASServerConfig getConfig()
{
return config;
}
@@ -58,148 +59,374 @@
return config.equals(obj);
}
- public boolean getBlockingShutdown()
+ /*
+ * All methods below this marker delegate to the underlying config
+ */
+
+ public JBossASServerConfig bindAddress(String arg0)
{
- return config.getBlockingShutdown();
+ config.bindAddress(arg0);
+ return this;
}
- public boolean getExitOnShutdown()
+ public JBossASServerConfig bootLibraryLocation(String arg0) throws IllegalArgumentException
{
- return config.getExitOnShutdown();
+ config.bootLibraryLocation(arg0);
+ return this;
}
- public File getHomeDir()
+ public JBossASServerConfig bootLibraryLocation(URL arg0)
{
- return config.getHomeDir();
+ config.bootLibraryLocation(arg0);
+ return this;
}
- public URL getHomeURL()
+ public JBossASServerConfig commonBaseLocation(String arg0) throws IllegalArgumentException
{
- return config.getHomeURL();
+ config.commonBaseLocation(arg0);
+ return this;
}
- public URL getLibraryURL()
+ public JBossASServerConfig commonBaseLocation(URL arg0)
{
- return config.getLibraryURL();
+ config.commonBaseLocation(arg0);
+ return this;
}
- public URL getPatchURL()
+ public JBossASServerConfig commonLibLocation(String arg0) throws IllegalArgumentException
{
- return config.getPatchURL();
+ config.commonLibLocation(arg0);
+ return this;
}
- public boolean getPlatformMBeanServer()
+ public JBossASServerConfig commonLibLocation(URL arg0)
{
- return config.getPlatformMBeanServer();
+ config.commonLibLocation(arg0);
+ return this;
}
- public boolean getRequireJBossURLStreamHandlerFactory()
+ public String getBindAddress()
{
- return config.getRequireJBossURLStreamHandlerFactory();
+ return config.getBindAddress();
}
- public String getRootDeploymentFilename()
+ public URL getBootLibraryLocation()
{
- return config.getRootDeploymentFilename();
+ return config.getBootLibraryLocation();
}
- public File getServerBaseDir()
+ public URL getCommonBaseLocation()
{
- return config.getServerBaseDir();
+ return config.getCommonBaseLocation();
}
- public URL getServerBaseURL()
+ public URL getCommonLibLocation()
{
- return config.getServerBaseURL();
+ return config.getCommonLibLocation();
}
- public URL getServerConfigURL()
+ public URL getJBossHome()
{
- return config.getServerConfigURL();
+ return config.getJBossHome();
}
- public File getServerDataDir()
+ public URL getNativeLibraryLocation()
{
- return config.getServerDataDir();
+ return config.getNativeLibraryLocation();
}
- public File getServerHomeDir()
+ public String getPartitionName()
{
- return config.getServerHomeDir();
+ return config.getPartitionName();
}
- public URL getServerHomeURL()
+ public URL getServerBaseLocation()
{
- return config.getServerHomeURL();
+ return config.getServerBaseLocation();
}
- public URL getServerLibraryURL()
+ public URL getServerConfLocation()
{
- return config.getServerLibraryURL();
+ return config.getServerConfLocation();
}
- public URL getCommonBaseURL()
+ public URL getServerDataLocation()
{
- return config.getCommonBaseURL();
+ return config.getServerDataLocation();
}
-
- public URL getCommonLibraryURL()
+
+ public URL getServerHomeLocation()
{
- return config.getCommonLibraryURL();
+ return config.getServerHomeLocation();
}
-
- public File getServerLogDir()
+
+ public URL getServerLibLocation()
{
- return config.getServerLogDir();
+ return config.getServerLibLocation();
}
+ public URL getServerLogLocation()
+ {
+ return config.getServerLibLocation();
+ }
+
public String getServerName()
{
return config.getServerName();
}
- public File getServerNativeDir()
+ public URL getServerTempLocation()
{
- return config.getServerNativeDir();
+ return config.getServerTempLocation();
}
- public File getServerTempDeployDir()
+ public String getUdpGroup()
{
- return config.getServerTempDeployDir();
+ return config.getUdpGroup();
}
- public File getServerTempDir()
+ public Integer getUdpPort()
{
- return config.getServerTempDir();
+ return config.getUdpPort();
}
- public int hashCode()
+ public Boolean isLoadNative()
{
- return config.hashCode();
+ return config.isLoadNative();
}
- public void setBlockingShutdown(boolean flag)
+ public JBossASServerConfig jbossHome(String arg0) throws IllegalArgumentException
{
- config.setBlockingShutdown(flag);
+ config.jbossHome(arg0);
+ return this;
}
- public void setExitOnShutdown(boolean flag)
+ public JBossASServerConfig jbossHome(URL arg0)
{
- config.setExitOnShutdown(flag);
+ config.jbossHome(arg0);
+ return this;
}
- public void setRequireJBossURLStreamHandlerFactory(boolean flag)
+ public JBossASServerConfig loadNative(Boolean arg0)
{
- config.setRequireJBossURLStreamHandlerFactory(flag);
+ config.loadNative(arg0);
+ return this;
}
- public void setRootDeploymentFilename(String filename)
+ public JBossASServerConfig nativeLibraryLocation(String arg0) throws IllegalArgumentException
{
- config.setRootDeploymentFilename(filename);
+ config.nativeLibraryLocation(arg0);
+ return this;
}
- public String getSpecificationVersion()
+ public JBossASServerConfig nativeLibraryLocation(URL arg0)
{
- return config.getSpecificationVersion();
+ config.nativeLibraryLocation(arg0);
+ return this;
}
+
+ public JBossASServerConfig partitionName(String arg0)
+ {
+ config.partitionName(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverBaseLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverBaseLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverBaseLocation(URL arg0)
+ {
+ config.serverBaseLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverConfLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverConfLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverConfLocation(URL arg0)
+ {
+ config.serverConfLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverDataLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverDataLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverDataLocation(URL arg0)
+ {
+ config.serverDataLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverHomeLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverHomeLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverHomeLocation(URL arg0)
+ {
+ config.serverHomeLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverLibLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverLibLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverLibLocation(URL arg0)
+ {
+ config.serverLibLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverLogLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverLogLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverLogLocation(URL arg0)
+ {
+ config.serverLogLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverName(String arg0)
+ {
+ config.serverName(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverTempLocation(String arg0) throws IllegalArgumentException
+ {
+ config.serverTempLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig serverTempLocation(URL arg0)
+ {
+ config.serverTempLocation(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig udpGroup(String arg0)
+ {
+ config.udpGroup(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig udpPort(Integer arg0)
+ {
+ config.udpPort(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig bootstrapHome(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.bootstrapHome(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig bootstrapHome(URL arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.bootstrapHome(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig bootstrapName(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.bootstrapName(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig bootstrapUrl(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.bootstrapUrl(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig bootstrapUrl(URL arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.bootstrapUrl(arg0);
+ return this;
+ }
+
+ public void freeze() throws IllegalStateException
+ {
+ config.freeze();
+
+ }
+
+ public URL getBootstrapHome()
+ {
+ return config.getBootstrapHome();
+ }
+
+ public String getBootstrapName()
+ {
+ return config.getBootstrapName();
+ }
+
+ public URL getBootstrapUrl()
+ {
+ return config.getBootstrapUrl();
+ }
+
+ public Map getProperties()
+ {
+ return config.getProperties();
+ }
+
+ public boolean isFrozen()
+ {
+ return config.isFrozen();
+ }
+
+ public JBossASServerConfig property(String arg0, String arg1) throws IllegalArgumentException, IllegalStateException
+ {
+ config.property(arg0, arg1);
+ return this;
+ }
+
+ public Boolean isUsePlatformMBeanServer()
+ {
+ return config.isUsePlatformMBeanServer();
+ }
+
+ public JBossASServerConfig usePlatformMBeanServer(Boolean arg0)
+ {
+ config.usePlatformMBeanServer(arg0);
+ return this;
+ }
+
+ public String getProperty(String arg0) throws IllegalArgumentException
+ {
+ return config.getProperty(arg0);
+ }
+
+ public JBossASServerConfig properties(Map arg0) throws IllegalArgumentException,
+ IllegalStateException
+ {
+ config.properties(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig properties(Properties arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.properties(arg0);
+ return this;
+ }
+
}
Index: system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java
===================================================================
--- system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java (working copy)
@@ -25,7 +25,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.vfs.spi.deployer.JAXPDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -135,8 +135,8 @@
VirtualFile codebaseFile = unit.getRoot();
if (".".equals(codebase) == false)
{
- ServerConfig config = ServerConfigLocator.locate();
- URL codeBaseURL = new URL(config.getServerHomeURL(), codebase);
+ JBossASServerConfig config = ServerConfigLocator.locate();
+ URL codeBaseURL = new URL(config.getServerHomeLocation(), codebase);
codebaseFile = VFS.getRoot(codeBaseURL);
}
Index: system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java
===================================================================
--- system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java (revision 89343)
+++ system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java (working copy)
@@ -644,7 +644,7 @@
catch(Exception e) {
// Otherwise, try to make it inside the jboss directory hierarchy
- File homeDir = ServerConfigLocator.locate().getServerHomeDir();
+ File homeDir = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI());
dir = new File(homeDir, baseDir);
Index: system-jmx/pom.xml
===================================================================
--- system-jmx/pom.xml (revision 89343)
+++ system-jmx/pom.xml (working copy)
@@ -87,7 +87,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
org.jboss.jbossas
Index: system-jmx/build.xml
===================================================================
--- system-jmx/build.xml (revision 89343)
+++ system-jmx/build.xml (working copy)
@@ -100,7 +100,9 @@
-
+
+
+
Index: profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- profileservice/src/resources/hdscanner-jboss-beans.xml (revision 89343)
+++ profileservice/src/resources/hdscanner-jboss-beans.xml (working copy)
@@ -19,7 +19,7 @@
-
+
Index: cluster/.classpath
===================================================================
--- cluster/.classpath (revision 89343)
+++ cluster/.classpath (working copy)
@@ -12,8 +12,10 @@
-
+
+
+
Index: cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java
===================================================================
--- cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java (revision 89343)
+++ cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java (working copy)
@@ -36,7 +36,7 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.logging.Logger;
import org.jboss.system.ServiceMBean;
import org.jboss.util.loading.ContextClassLoaderSwitcher;
Index: cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
===================================================================
--- cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java (revision 89343)
+++ cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java (working copy)
@@ -39,10 +39,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.Name;
@@ -50,7 +46,7 @@
import javax.naming.Reference;
import javax.naming.StringRefAddr;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
import org.jboss.ha.framework.interfaces.HAPartition;
@@ -208,7 +204,7 @@
private String cacheConfigName;
private ChannelFactory channelFactory;
private String stackName;
- private String partitionName = ServerConfigUtil.getDefaultPartitionName();
+ private String partitionName = JBossASConfigurationInitializer.VALUE_PARTITION_NAME_DEFAULT;
private InetAddress nodeAddress = null;
private long state_transfer_timeout=60000;
private long method_call_timeout=60000;
Index: cluster/src/main/org/jboss/ha/framework/server/ClusterFileTransfer.java
===================================================================
--- cluster/src/main/org/jboss/ha/framework/server/ClusterFileTransfer.java (revision 89343)
+++ cluster/src/main/org/jboss/ha/framework/server/ClusterFileTransfer.java (working copy)
@@ -21,14 +21,30 @@
*/
package org.jboss.ha.framework.server;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Vector;
+
+import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.ha.framework.interfaces.HAPartition;
-import org.jboss.ha.framework.interfaces.ClusterNode;
+import org.jboss.ha.framework.interfaces.HAPartition.AsynchHAMembershipListener;
+import org.jboss.logging.Logger;
import org.jboss.system.server.ServerConfigLocator;
-import org.jboss.logging.Logger;
-import org.jboss.ha.framework.interfaces.HAPartition.AsynchHAMembershipListener;
-import java.util.*;
-import java.io.*;
+import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException;
/**
* Handles transfering files on the cluster. Files are sent in small chunks at a time (up to MAX_CHUNK_BUFFER_SIZE bytes per
@@ -54,7 +70,18 @@
private HAPartition mPartition;
- private static final File TEMP_DIRECTORY = ServerConfigLocator.locate().getServerTempDir();
+ private static final File TEMP_DIRECTORY;
+ static
+ {
+ try
+ {
+ TEMP_DIRECTORY = new File(ServerConfigLocator.locate().getServerTempLocation().toURI());
+ }
+ catch (URISyntaxException urise)
+ {
+ throw new RuntimeException("Error on initialization", urise);
+ }
+ }
// Mapping between parent folder name and target destination folder
// the search key is the parent folder name and value is the java.io.File.
Index: cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java
===================================================================
--- cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java (revision 89343)
+++ cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java (working copy)
@@ -30,7 +30,7 @@
import javax.naming.InitialContext;
import org.apache.log4j.MDC;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
import org.jboss.ha.framework.interfaces.HAPartition;
import org.jboss.ha.framework.interfaces.HAPartition.AsynchHAMembershipListener;
import org.jboss.ha.framework.server.HAPartitionLocator;
@@ -88,7 +88,7 @@
private static Logger changeLog = Logger.getLogger(CHANGE_NAME);
- private volatile String partitionName = ServerConfigUtil.getDefaultPartitionName();
+ private volatile String partitionName = JBossASConfigurationInitializer.VALUE_PARTITION_NAME_DEFAULT;
private volatile HAPartition partition;
Index: cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
===================================================================
--- cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java (revision 89343)
+++ cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java (working copy)
@@ -24,10 +24,13 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.deployment.Deployer;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployment.scanner.URLDeploymentScanner;
import org.jboss.ha.framework.interfaces.HAPartition;
import org.jboss.system.server.ServerConfigLocator;
@@ -110,8 +113,8 @@
protected void createService() throws Exception
{
super.createService();
- ServerConfig lConfig = ServerConfigLocator.locate();
- mTempDirectory = lConfig.getServerTempDir();
+ JBossASServerConfig lConfig = ServerConfigLocator.locate();
+ mTempDirectory = new File(lConfig.getServerTempLocation().toURI());
createUnexistingLocalDir ();
}
Index: cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java
===================================================================
--- cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java (revision 89343)
+++ cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java (working copy)
@@ -24,19 +24,20 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Hashtable;
+
+import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import javax.management.MBeanServer;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
+import org.jboss.ha.framework.interfaces.HAPartition;
+import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
+import org.jboss.ha.framework.server.HAPartitionLocator;
+import org.jboss.ha.framework.server.HATarget;
import org.jboss.invocation.Invoker;
import org.jboss.invocation.InvokerInterceptor;
import org.jboss.invocation.http.interfaces.ClientMethodInterceptorHA;
import org.jboss.invocation.http.interfaces.HttpInvokerProxyHA;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
-import org.jboss.ha.framework.interfaces.LoadBalancePolicy;
-import org.jboss.ha.framework.interfaces.HAPartition;
-import org.jboss.ha.framework.server.HAPartitionLocator;
-import org.jboss.ha.framework.server.HATarget;
/** An extension of HttpProxyFactory that supports clustering of invoker proxies.
* It does this by creating a HATarget that monitors the replication of the
@@ -52,7 +53,7 @@
{
private ObjectName realJmxInvokerName;
private ObjectName wrappedJmxInvokerName;
- private String partitionName = ServerConfigUtil.getDefaultPartitionName();
+ private String partitionName = JBossASConfigurationInitializer.VALUE_PARTITION_NAME_DEFAULT;
private Class policyClass;
private HAInvokerWrapper invokerWrapper;
private HATarget invokerTarget;
Index: cluster/pom.xml
===================================================================
--- cluster/pom.xml (revision 89343)
+++ cluster/pom.xml (working copy)
@@ -155,7 +155,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
Index: cluster/build.xml
===================================================================
--- cluster/build.xml (revision 89343)
+++ cluster/build.xml (working copy)
@@ -102,7 +102,9 @@
&modules;
-
+
+
+
Index: system/.classpath
===================================================================
--- system/.classpath (revision 89343)
+++ system/.classpath (working copy)
@@ -37,7 +37,12 @@
-
+
+
+
+
+
+
Index: system/src/tests/org/jboss/test/server/profileservice/test/AbstractProfileServiceTestBase.java
===================================================================
--- system/src/tests/org/jboss/test/server/profileservice/test/AbstractProfileServiceTestBase.java (revision 89343)
+++ system/src/tests/org/jboss/test/server/profileservice/test/AbstractProfileServiceTestBase.java (working copy)
@@ -25,8 +25,8 @@
import java.net.MalformedURLException;
import java.net.URL;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
import org.jboss.deployers.client.spi.main.MainDeployer;
import org.jboss.system.server.profileservice.repository.AbstractProfileFactory;
import org.jboss.test.BaseTestCase;
@@ -47,20 +47,20 @@
super(name);
}
- protected Server createDefaultServer(String name) throws MalformedURLException
+ protected JBossASServer createDefaultServer(String name) throws MalformedURLException
{
File configDir = new File("src/resources/parsing-tests/config/");
File commonDir = new File("src/resources/parsing-tests/common/");
return createServer(name, configDir.toURL(), commonDir.toURL());
}
- protected Server createServer(String name, URL configDir, URL commonDir)
+ protected JBossASServer createServer(String name, URL configDir, URL commonDir)
{
- ServerConfig config = new MockServerConfig(name, configDir, commonDir);
+ JBossASServerConfig config = new MockServerConfig(name, configDir, commonDir);
return createServer(config);
}
- protected Server createServer(ServerConfig config)
+ protected JBossASServer createServer(JBossASServerConfig config)
{
return new MockServer(config);
}
Index: system/src/tests/org/jboss/test/server/profileservice/support/MockServer.java
===================================================================
--- system/src/tests/org/jboss/test/server/profileservice/support/MockServer.java (revision 89343)
+++ system/src/tests/org/jboss/test/server/profileservice/support/MockServer.java (working copy)
@@ -21,123 +21,224 @@
*/
package org.jboss.test.server.profileservice.support;
-import java.util.Collections;
import java.util.Date;
+import java.util.EnumSet;
import java.util.Map;
-import java.util.Properties;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.Bootstrap;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
+import org.jboss.bootstrap.spi.config.ConfigurationInitializer;
+import org.jboss.bootstrap.spi.config.ConfigurationValidator;
+import org.jboss.bootstrap.spi.config.InvalidConfigurationException;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleEventException;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleEventHandler;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
+import org.jboss.bootstrap.spi.server.ServerInitializer;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
/**
* @author Emanuel Muckenhuber
* @version $Revision$
*/
-public class MockServer implements Server
+public class MockServer implements JBossASServer
{
- public ServerConfig config;
+ public JBossASServerConfig config;
- public MockServer(ServerConfig config)
+ public MockServer(JBossASServerConfig config)
{
this.config = config;
}
-
- public ServerConfig getConfig() throws IllegalStateException
- {
- return this.config;
- }
-
+
public String getBuildDate()
{
- // FIXME getBuildDate
+ // TODO Auto-generated method stub
return null;
}
public String getBuildID()
{
- // FIXME getBuildID
+ // TODO Auto-generated method stub
return null;
}
public String getBuildJVM()
{
- // FIXME getBuildJVM
+ // TODO Auto-generated method stub
return null;
}
public String getBuildNumber()
{
- // FIXME getBuildNumber
+ // TODO Auto-generated method stub
return null;
}
public String getBuildOS()
{
- // FIXME getBuildOS
+ // TODO Auto-generated method stub
return null;
}
public Date getStartDate()
{
- // FIXME getStartDate
+ // TODO Auto-generated method stub
return null;
}
public String getVersion()
{
- // FIXME getVersion
+ // TODO Auto-generated method stub
return null;
}
public String getVersionName()
{
- // FIXME getVersionName
+ // TODO Auto-generated method stub
return null;
}
public String getVersionNumber()
{
- // FIXME getVersionNumber
+ // TODO Auto-generated method stub
return null;
}
- public void init(Properties props) throws IllegalStateException, Exception
+ public Kernel getKernel()
{
- init(props, null);
+ // TODO Auto-generated method stub
+ return null;
}
- public void init(Properties props, Map metadata) throws IllegalStateException, Exception
+
+ public void addBootstrap(Bootstrap arg0) throws IllegalArgumentException
{
- // FIXME init
+ // TODO Auto-generated method stub
}
- public Map getMetaData()
+
+ public ConfigurationInitializer getConfigInitializer()
{
- return Collections.emptyMap();
+ // TODO Auto-generated method stub
+ return null;
}
- public boolean isInShutdown()
+
+ public JBossASServerConfig getConfiguration()
{
- // FIXME isInShutdown
- return false;
+ return this.config;
}
- public boolean isStarted()
+ public ServerInitializer getServerInitializer()
{
- // FIXME isStarted
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public void shutdown() throws IllegalStateException
+ public LifecycleState getState()
{
- // FIXME shutdown
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ConfigurationValidator getValidator()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void initialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
+ {
+ // TODO Auto-generated method stub
}
+ public void registerEventHandler(LifecycleState arg0, LifecycleEventHandler arg1) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void registerEventHandler(LifecycleEventHandler arg0, EnumSet arg1)
+ throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void registerEventHandler(LifecycleEventHandler arg0, LifecycleState... arg1) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void registerEventHandlers(LifecycleState arg0, LifecycleEventHandler... arg1)
+ throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void removeBootstrap(Bootstrap arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setConfigInitializer(ConfigurationInitializer arg0) throws IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setConfiguration(JBossASServerConfig arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setServerInitializer(ServerInitializer arg0)
+ throws IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setValidator(ConfigurationValidator arg0) throws IllegalStateException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void shutdown() throws IllegalStateException, Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
public void start() throws IllegalStateException, Exception
{
- // FIXME start
+ // TODO Auto-generated method stub
}
+ public boolean unregisterEventHandler(LifecycleEventHandler arg0, LifecycleState arg1)
+ throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public Map getMetaData()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map getDeployments()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Index: system/src/tests/org/jboss/test/server/profileservice/support/MockServerConfig.java
===================================================================
--- system/src/tests/org/jboss/test/server/profileservice/support/MockServerConfig.java (revision 89343)
+++ system/src/tests/org/jboss/test/server/profileservice/support/MockServerConfig.java (working copy)
@@ -21,16 +21,17 @@
*/
package org.jboss.test.server.profileservice.support;
-import java.io.File;
import java.net.URL;
+import java.util.Map;
+import java.util.Properties;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
/**
* @author Emanuel Muckenhuber
* @version $Revision$
*/
-public class MockServerConfig implements ServerConfig
+public class MockServerConfig implements JBossASServerConfig
{
String serverName;
URL configURL;
@@ -50,183 +51,403 @@
this.commonBaseURL = commonBaseURL;
}
- public URL getServerConfigURL()
+ public String getServerName()
{
- return this.configURL;
+ return this.serverName;
}
- public URL getCommonBaseURL()
+ /*
+ * Below this marker are unimplemented stubs
+ */
+
+ public JBossASServerConfig bindAddress(String arg0)
{
- return this.commonBaseURL;
+ // TODO Auto-generated method stub
+ return null;
}
-
- public String getServerName()
+
+ public JBossASServerConfig bootLibraryLocation(URL arg0)
{
- return this.serverName;
+ // TODO Auto-generated method stub
+ return null;
}
-
- public boolean getBlockingShutdown()
+
+ public JBossASServerConfig bootLibraryLocation(String arg0) throws IllegalArgumentException
{
- // FIXME getBlockingShutdown
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public URL getBootstrapURL()
+ public JBossASServerConfig commonBaseLocation(URL arg0)
{
- // FIXME getBootstrapURL
+ // TODO Auto-generated method stub
return null;
}
- public URL getCommonLibraryURL()
+ public JBossASServerConfig commonBaseLocation(String arg0) throws IllegalArgumentException
{
- // FIXME getCommonLibraryURL
+ // TODO Auto-generated method stub
return null;
}
-
- public boolean getExitOnShutdown()
+ public JBossASServerConfig commonLibLocation(URL arg0)
{
- // FIXME getExitOnShutdown
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public File getHomeDir()
+ public JBossASServerConfig commonLibLocation(String arg0) throws IllegalArgumentException
{
- // FIXME getHomeDir
+ // TODO Auto-generated method stub
return null;
}
- public URL getHomeURL()
+ public String getBindAddress()
{
- // FIXME getHomeURL
+ // TODO Auto-generated method stub
return null;
}
- public URL getLibraryURL()
+ public URL getBootLibraryLocation()
{
- // FIXME getLibraryURL
+ // TODO Auto-generated method stub
return null;
}
- public URL getPatchURL()
+ public URL getCommonBaseLocation()
{
- // FIXME getPatchURL
+ // TODO Auto-generated method stub
return null;
}
- public boolean getPlatformMBeanServer()
+ public URL getCommonLibLocation()
{
- // FIXME getPlatformMBeanServer
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public boolean getRequireJBossURLStreamHandlerFactory()
+ public URL getJBossHome()
{
- // FIXME getRequireJBossURLStreamHandlerFactory
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public String getRootDeploymentFilename()
+ public URL getNativeLibraryLocation()
{
- // FIXME getRootDeploymentFilename
+ // TODO Auto-generated method stub
return null;
}
- public File getServerBaseDir()
+ public String getPartitionName()
{
- // FIXME getServerBaseDir
+ // TODO Auto-generated method stub
return null;
}
- public URL getServerBaseURL()
+ public URL getServerBaseLocation()
{
- // FIXME getServerBaseURL
+ // TODO Auto-generated method stub
return null;
}
- public File getServerDataDir()
+ public URL getServerConfLocation()
{
- // FIXME getServerDataDir
+ // TODO Auto-generated method stub
return null;
}
- public File getServerHomeDir()
+ public URL getServerDataLocation()
{
- // FIXME getServerHomeDir
+ // TODO Auto-generated method stub
return null;
}
- public URL getServerHomeURL()
+ public URL getServerHomeLocation()
{
- // FIXME getServerHomeURL
+ // TODO Auto-generated method stub
return null;
}
- public URL getServerLibraryURL()
+ public URL getServerLibLocation()
{
- // FIXME getServerLibraryURL
+ // TODO Auto-generated method stub
return null;
}
- public File getServerLogDir()
+ public URL getServerLogLocation()
{
- // FIXME getServerLogDir
+ // TODO Auto-generated method stub
return null;
}
- public File getServerNativeDir()
+
+
+ public URL getServerTempLocation()
{
- // FIXME getServerNativeDir
+ // TODO Auto-generated method stub
return null;
}
- public File getServerTempDeployDir()
+ public String getUdpGroup()
{
- // FIXME getServerTempDeployDir
+ // TODO Auto-generated method stub
return null;
}
- public File getServerTempDir()
+ public Integer getUdpPort()
{
- // FIXME getServerTempDir
+ // TODO Auto-generated method stub
return null;
}
- public String getSpecificationVersion()
+ public Boolean isLoadNative()
{
- // FIXME getSpecificationVersion
+ // TODO Auto-generated method stub
return null;
}
- public boolean isInstallLifeThread()
+ public JBossASServerConfig jbossHome(String arg0) throws IllegalArgumentException
{
- // FIXME isInstallLifeThread
- return false;
+ // TODO Auto-generated method stub
+ return null;
}
- public void setBlockingShutdown(boolean blockingShutdown)
+ public JBossASServerConfig jbossHome(URL arg0)
{
- // FIXME setBlockingShutdown
-
+ // TODO Auto-generated method stub
+ return null;
}
- public void setExitOnShutdown(boolean flag)
+ public JBossASServerConfig loadNative(Boolean arg0)
{
- // FIXME setExitOnShutdown
-
+ // TODO Auto-generated method stub
+ return null;
}
- public void setRequireJBossURLStreamHandlerFactory(boolean requireJBossURLStreamHandlerFactory)
+ public JBossASServerConfig nativeLibraryLocation(URL arg0)
{
- // FIXME setRequireJBossURLStreamHandlerFactory
-
+ // TODO Auto-generated method stub
+ return null;
}
- public void setRootDeploymentFilename(String filename)
+ public JBossASServerConfig nativeLibraryLocation(String arg0) throws IllegalArgumentException
{
- // FIXME setRootDeploymentFilename
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig partitionName(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverBaseLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverBaseLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverConfLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverConfLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverDataLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverDataLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverHomeLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverHomeLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverLibLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverLibLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverLogLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverLogLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverName(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverTempLocation(URL arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig serverTempLocation(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig udpGroup(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig udpPort(Integer arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig bootstrapHome(URL arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig bootstrapHome(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig bootstrapName(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig bootstrapUrl(URL arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig bootstrapUrl(String arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void freeze() throws IllegalStateException
+ {
+ // TODO Auto-generated method stub
}
+ public URL getBootstrapHome()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getBootstrapName()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public URL getBootstrapUrl()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Map getProperties()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isFrozen()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public JBossASServerConfig property(String arg0, String arg1) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Boolean isUsePlatformMBeanServer()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig usePlatformMBeanServer(Boolean arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getProperty(String arg0) throws IllegalArgumentException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig properties(Map arg0) throws IllegalArgumentException,
+ IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public JBossASServerConfig properties(Properties arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+
}
Index: system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java
===================================================================
--- system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java (revision 89343)
+++ system/src/tests/org/jboss/test/server/profileservice/MainWithSimpleHotDeployTestCase.java (working copy)
@@ -25,8 +25,8 @@
import java.security.CodeSource;
import org.jboss.Main;
-import org.jboss.bootstrap.microcontainer.ServerImpl;
-import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.impl.as.server.JBossASServerImpl;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.registry.KernelRegistry;
@@ -101,9 +101,9 @@
String[] args = {"-c", "defaulthotdeploy", "-Djboss.server.deployerBeansPrefix="+deployPrefix};
Main main = new Main();
main.boot(args);
- Server server = main.getServer();
- assertTrue("Server", server instanceof ServerImpl);
- ServerImpl serverImpl = (ServerImpl) server;
+ JBossASServer server = (JBossASServer) main.getServer();
+ assertTrue("Server", server instanceof JBossASServerImpl);
+ JBossASServerImpl serverImpl = (JBossASServerImpl) server;
// Validate that the expected deployment beans exist
Kernel kernel = serverImpl.getKernel();
@@ -135,7 +135,14 @@
// Shutdown
- main.shutdown();
+ try
+ {
+ main.shutdown();
+ }
+ catch (Throwable t)
+ {
+ throw new Exception("Error in shutdown", t);
+ }
}
private void assertInstalled(Kernel kernel, String name)
Index: system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java
===================================================================
--- system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java (revision 89343)
+++ system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java (working copy)
@@ -21,8 +21,8 @@
*/
package org.jboss.system.tools;
+import java.net.URISyntaxException;
import java.net.URL;
-import java.net.URISyntaxException;
/**
* Deployment repository adapter.
Index: system/src/main/org/jboss/system/tools/DeploymentScanner.java
===================================================================
--- system/src/main/org/jboss/system/tools/DeploymentScanner.java (revision 89343)
+++ system/src/main/org/jboss/system/tools/DeploymentScanner.java (working copy)
@@ -21,15 +21,15 @@
*/
package org.jboss.system.tools;
-import java.net.URL;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
+import java.net.URL;
import org.jboss.aop.microcontainer.aspects.jmx.JMX;
import org.jboss.beans.metadata.api.annotations.Start;
import org.jboss.beans.metadata.api.annotations.Stop;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.util.StringPropertyReplacer;
-import org.jboss.bootstrap.spi.ServerConfig;
/**
* Deployment scanner impl - hooking into ProfileService.
@@ -39,7 +39,7 @@
@JMX(name = "jboss.deployment:flavor=URL,type=DeploymentScanner", exposedInterface = DeploymentScannerMBean.class, registerDirectly = true)
public class DeploymentScanner implements DeploymentScannerMBean
{
- private ServerConfig serverConfig;
+ private JBossASServerConfig serverConfig;
private URL serverHomeURL;
private DeploymentRepositoryAdapter adapter;
@@ -60,7 +60,7 @@
if (serverConfig == null)
throw new IllegalArgumentException("Null server config.");
- serverHomeURL = serverConfig.getServerHomeURL();
+ serverHomeURL = serverConfig.getServerHomeLocation();
}
@Start(ignored = true)
@@ -147,7 +147,7 @@
*
* @param serverConfig the server config
*/
- public void setServerConfig(ServerConfig serverConfig)
+ public void setServerConfig(JBossASServerConfig serverConfig)
{
this.serverConfig = serverConfig;
}
Index: system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java
===================================================================
--- system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java (revision 89343)
+++ system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java (working copy)
@@ -21,9 +21,9 @@
*/
package org.jboss.system.tools;
-import java.net.URL;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
+import java.net.URL;
/**
* Deployment api for tools.
Index: system/src/main/org/jboss/system/server/profile/repository/metadata/AbstractProfileMetaData.java
===================================================================
--- system/src/main/org/jboss/system/server/profile/repository/metadata/AbstractProfileMetaData.java (revision 89343)
+++ system/src/main/org/jboss/system/server/profile/repository/metadata/AbstractProfileMetaData.java (working copy)
@@ -25,7 +25,6 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
import org.jboss.profileservice.spi.metadata.ProfileMetaData;
import org.jboss.profileservice.spi.metadata.SubProfileMetaData;
Index: system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java
===================================================================
--- system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java (revision 89343)
+++ system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java (working copy)
@@ -24,11 +24,13 @@
import java.io.File;
import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
import org.jboss.logging.Logger;
import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
import org.jboss.xb.binding.Unmarshaller;
@@ -56,11 +58,16 @@
resolver.addClassBindingForLocation("repository-content", RepositoryContentMetadata.class);
}
- public JAXBRepositoryContentMetadataPersister(Server server)
+ public JAXBRepositoryContentMetadataPersister(JBossASServer server) throws Throwable
{
- this(server.getConfig().getServerDataDir());
+ this(server.getConfiguration().getServerDataLocation());
}
+ public JAXBRepositoryContentMetadataPersister(URL url) throws URISyntaxException
+ {
+ this(url.toURI());
+ }
+
public JAXBRepositoryContentMetadataPersister(URI uri)
{
this(new File(uri));
Index: system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/LocalContentManagerFactory.java
===================================================================
--- system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/LocalContentManagerFactory.java (revision 89343)
+++ system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/LocalContentManagerFactory.java (working copy)
@@ -26,6 +26,7 @@
import java.util.Collection;
import java.util.Map;
+import org.jboss.profileservice.spi.Profile;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.system.server.profileservice.repository.clustered.sync.SynchronizationActionContext;
Index: system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java (revision 89343)
+++ system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java (working copy)
@@ -25,7 +25,6 @@
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -36,11 +35,11 @@
import org.jboss.beans.info.spi.BeanInfo;
import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.bootstrap.spi.Bootstrap;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.microcontainer.MCServer;
+import org.jboss.bootstrap.spi.as.JBossASBootstrap;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
+import org.jboss.bootstrap.spi.mc.config.MCServerConfig;
+import org.jboss.bootstrap.spi.mc.server.MCServer;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.IncompleteDeploymentException;
@@ -67,7 +66,6 @@
import org.jboss.managed.api.ManagedProperty;
import org.jboss.managed.api.MutableManagedObject;
import org.jboss.managed.api.annotation.ManagementComponent;
-import org.jboss.managed.api.annotation.ManagementConstants;
import org.jboss.managed.api.annotation.ManagementObject;
import org.jboss.managed.api.annotation.ViewUse;
import org.jboss.managed.api.factory.ManagedObjectFactory;
@@ -76,16 +74,12 @@
import org.jboss.managed.plugins.ManagedObjectImpl;
import org.jboss.managed.plugins.ManagedOperationImpl;
import org.jboss.managed.plugins.ManagedPropertyImpl;
-import org.jboss.managed.plugins.factory.AbstractManagedObjectFactory;
import org.jboss.metatype.api.types.ArrayMetaType;
-import org.jboss.metatype.api.types.CollectionMetaType;
import org.jboss.metatype.api.types.MetaType;
import org.jboss.metatype.api.types.SimpleMetaType;
import org.jboss.metatype.api.values.ArrayValueSupport;
-import org.jboss.metatype.api.values.CollectionValueSupport;
import org.jboss.metatype.api.values.EnumValue;
import org.jboss.metatype.api.values.EnumValueSupport;
-import org.jboss.metatype.api.values.GenericValue;
import org.jboss.profileservice.spi.MutableProfile;
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.Profile;
@@ -103,7 +97,7 @@
* @author Emanuel Muckenhuber
* @version $Revision$
*/
-public class ProfileServiceBootstrap implements Bootstrap, KernelRegistryPlugin
+public class ProfileServiceBootstrap implements JBossASBootstrap, KernelRegistryPlugin
{
/** The log */
private static final Logger log = Logger.getLogger(ProfileServiceBootstrap.class);
@@ -231,7 +225,7 @@
/**
*
*/
- public void start(Server server)
+ public void start(JBossASServer server)
throws Exception
{
shutdown.set(false);
@@ -251,7 +245,7 @@
// Load the profiles
if(this.profileKey == null)
- this.profileKey = new ProfileKey(server.getConfig().getServerName());
+ this.profileKey = new ProfileKey(server.getConfiguration().getServerName());
Map metaData = server.getMetaData();
ProfileMetaData pmd = (ProfileMetaData) metaData.get(ProfileMetaData.class.getName());
@@ -298,14 +292,14 @@
}
}
- public void prepareShutdown(Server server)
+ public void prepareShutdown(JBossASServer server)
{
shutdown.set(true);
if (mainDeployer != null)
mainDeployer.prepareShutdown();
}
- public void shutdown(Server server)
+ public void shutdown(JBossASServer server)
{
// Disable hotdeployment scanning
for(ProfileKey key : profileService.getActiveProfileKeys())
@@ -408,7 +402,7 @@
* @param server - the Bootstrap.start Server instance. This must be an
* MCServer in order for there to be KernelDeployments available.
*/
- protected void initBootstrapMDs(Server server)
+ protected void initBootstrapMDs(JBossASServer server)
{
if(mof == null || mgtDeploymentCreator == null)
{
@@ -417,10 +411,10 @@
}
Map serverDeployments = null;
- if(server instanceof MCServer)
+ if(server instanceof JBossASServer)
{
// Build ManagedDeployments for the KernelDeployments
- MCServer mcserver = MCServer.class.cast(server);
+ JBossASServer mcserver = JBossASServer.class.cast(server);
Kernel kernel = mcserver.getKernel();
serverDeployments = mcserver.getDeployments();
ManagedDeployment firstDeployment = null;
@@ -562,7 +556,7 @@
}
// ServerConfig
type = new ComponentType("MCBean", "ServerConfig");
- ServerConfig config = mcserver.getConfig();
+ JBossASServerConfig config = mcserver.getConfiguration();
ManagedObject mo = mof.initManagedObject(config, null);
ManagedComponentImpl configComp = new ManagedComponentImpl(type, firstDeployment, mo);
firstDeployment.addComponent("ServerConfig", configComp);
Index: system/src/main/org/jboss/system/server/profileservice/SecurityActions.java
===================================================================
--- system/src/main/org/jboss/system/server/profileservice/SecurityActions.java (revision 89343)
+++ system/src/main/org/jboss/system/server/profileservice/SecurityActions.java (working copy)
@@ -21,8 +21,8 @@
*/
package org.jboss.system.server.profileservice;
+import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.security.AccessController;
/**
* Package privileged actions.
Index: system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java
===================================================================
--- system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java (revision 89343)
+++ system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java (working copy)
@@ -41,8 +41,8 @@
import org.jboss.managed.api.ManagedDeployment;
import org.jboss.managed.api.ManagedObject;
import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.managed.api.annotation.ManagementConstants;
import org.jboss.managed.api.annotation.ManagementDeployment;
-import org.jboss.managed.api.annotation.ManagementConstants;
import org.jboss.managed.plugins.ManagedDeploymentImpl;
/**
Index: system/pom.xml
===================================================================
--- system/pom.xml (revision 89343)
+++ system/pom.xml (working copy)
@@ -193,7 +193,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
org.jboss
Index: system/build.xml
===================================================================
--- system/build.xml (revision 89343)
+++ system/build.xml (working copy)
@@ -95,7 +95,9 @@
-
+
+
+
Index: tomcat/.classpath
===================================================================
--- tomcat/.classpath (revision 89343)
+++ tomcat/.classpath (working copy)
@@ -29,6 +29,8 @@
-
+
+
+
Index: tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java
===================================================================
--- tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java (revision 89343)
+++ tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java (working copy)
@@ -46,7 +46,8 @@
import org.apache.catalina.startup.CatalinaProperties;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.modeler.Registry;
-import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
import org.jboss.security.plugins.JaasSecurityManagerServiceMBean;
@@ -343,8 +344,8 @@
// we'll never receive Server.START_NOTIFICATION_TYPE, so check
// with the Server and start the connectors immediately, if this is the case.
// Otherwise register to receive the server start-up notification.
- Boolean started = (Boolean) server.getAttribute(ServerImplMBean.OBJECT_NAME, "Started");
- if (started.booleanValue() == true)
+ LifecycleState currentState = (LifecycleState) server.getAttribute(ServerImplMBean.OBJECT_NAME, "State");
+ if (currentState.equals(LifecycleState.STARTED))
{
log.debug("Server '" + ServerImplMBean.OBJECT_NAME + "' already started, starting connectors now");
@@ -448,8 +449,9 @@
throw new IllegalStateException("Must set TomcatDeployer before stopping");
// Hot undeploy
- Boolean inShutdown = (Boolean) server.getAttribute(ServerImplMBean.OBJECT_NAME, "InShutdown");
- if (inShutdown.booleanValue() == false)
+ final LifecycleState currentState = (LifecycleState) server.getAttribute(ServerImplMBean.OBJECT_NAME, "State");
+ boolean inShutdown = currentState.equals(LifecycleState.STOPPING);
+ if (inShutdown == false)
{
log.debug("Server '" + ServerImplMBean.OBJECT_NAME + "' already started, stopping connectors now");
@@ -656,7 +658,7 @@
public void handleNotification(Notification msg, Object handback)
{
String type = msg.getType();
- if (type.equals(Server.START_NOTIFICATION_TYPE))
+ if (type.equals(JBossASServer.START_NOTIFICATION_TYPE))
{
log.debug("Saw " + type + " notification, starting connectors");
try
@@ -668,7 +670,7 @@
log.warn("Failed to startConnectors", e);
}
}
- if (type.equals(Server.STOP_NOTIFICATION_TYPE))
+ if (type.equals(JBossASServer.STOP_NOTIFICATION_TYPE))
{
log.debug("Saw " + type + " notification, stopping connectors");
try
Index: tomcat/build.xml
===================================================================
--- tomcat/build.xml (revision 89343)
+++ tomcat/build.xml (working copy)
@@ -90,7 +90,9 @@
-
+
+
+
Index: thirdparty/pom.xml
===================================================================
--- thirdparty/pom.xml (revision 89343)
+++ thirdparty/pom.xml (working copy)
@@ -288,12 +288,47 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
- jboss.jboss-bootstrap
+ jboss.jboss-bootstrap-impl-as
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-base
+
+ jboss.jboss-bootstrap-impl-base
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-mc
+
+ jboss.jboss-bootstrap-impl-mc
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi
+
+ jboss.jboss-bootstrap-spi
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-as
+
+ jboss.jboss-bootstrap-spi-as
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-mc
+
+ jboss.jboss-bootstrap-spi-mc
+
+
+
org.jboss.cache
jbosscache-core
@@ -1366,8 +1401,28 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
+
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-base
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-mc
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-as
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-mc
+
Index: varia/.classpath
===================================================================
--- varia/.classpath (revision 89343)
+++ varia/.classpath (working copy)
@@ -19,11 +19,13 @@
+
+
+
-
Index: varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java
===================================================================
--- varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java (revision 89343)
+++ varia/src/tests/org/jboss/test/services/binding/test/ServiceBindingTestBase.java (working copy)
@@ -38,6 +38,7 @@
import junit.framework.Assert;
import junit.framework.TestCase;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.services.binding.ServiceBinding;
import org.jboss.services.binding.ServiceBindingMetadata;
import org.jboss.services.binding.impl.XSLTServiceBindingValueSourceConfig;
@@ -70,6 +71,8 @@
private static final String SERVER_TEMP_DIR_PROPERTY = "jboss.server.temp.dir";
+ private static final String SYS_PROP_SERVER_TEMP_DIR = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_TEMP_DIR;
+
protected ServiceBindingMetadata bindingMetadata;
protected ServiceBinding binding;
@@ -95,10 +98,11 @@
if (existingElementEditor == null)
PropertyEditorManager.registerEditor(Element.class, ElementEditor.class);
- serverTempDir = System.getProperty(SERVER_TEMP_DIR_PROPERTY);
+ serverTempDir = System.getProperty(SYS_PROP_SERVER_TEMP_DIR);
if (serverTempDir == null)
- System.setProperty(SERVER_TEMP_DIR_PROPERTY, System.getProperty("java.io.tmpdir"));
-
+ {
+ System.setProperty(SYS_PROP_SERVER_TEMP_DIR, System.getProperty("java.io.tmpdir"));
+ }
bindingMetadata = new ServiceBindingMetadata(SVC_NAME, BINDING_NAME, HOST, PORT, false, false);
binding = new ServiceBinding(bindingMetadata, HOST, 0);
}
@@ -109,7 +113,9 @@
if (existingElementEditor == null)
PropertyEditorManager.registerEditor(Element.class, null);
if (serverTempDir == null)
- System.clearProperty(SERVER_TEMP_DIR_PROPERTY);
+ {
+ System.clearProperty(SYS_PROP_SERVER_TEMP_DIR);
+ }
super.tearDown();
}
@@ -206,4 +212,4 @@
-}
\ No newline at end of file
+}
Index: varia/src/main/org/jboss/jdbc/HypersonicDatabase.java
===================================================================
--- varia/src/main/org/jboss/jdbc/HypersonicDatabase.java (revision 89343)
+++ varia/src/main/org/jboss/jdbc/HypersonicDatabase.java (working copy)
@@ -35,7 +35,7 @@
/**
* Integration with HSQLDB
*
- * @author Rickard Öberg
+ * @author Rickard �berg
* @author Scott Stark.
* @author Peter Fagerlund
* @author Jason Dillon
@@ -601,7 +601,7 @@
// Get the server data directory
File dataDir = null;
- if (dbDataDir == null) dataDir = ServerConfigLocator.locate().getServerDataDir();
+ if (dbDataDir == null) dataDir = new File(ServerConfigLocator.locate().getServerDataLocation().toURI());
else dataDir = new File(dbDataDir);
// Get DB directory
@@ -643,7 +643,8 @@
{
// Get the server data directory
File dataDir = null;
- if (dbDataDir == null) dataDir = ServerConfigLocator.locate().getServerDataDir();
+ if (dbDataDir == null)
+ dataDir = new File(ServerConfigLocator.locate().getServerDataLocation().toURI());
else dataDir = new File(dbDataDir);
// Get DB directory
Index: varia/src/main/org/jboss/varia/deployment/FoeDeployer.java
===================================================================
--- varia/src/main/org/jboss/varia/deployment/FoeDeployer.java (revision 89343)
+++ varia/src/main/org/jboss/varia/deployment/FoeDeployer.java (working copy)
@@ -27,40 +27,35 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
-import java.net.URL;
import java.net.MalformedURLException;
-
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
-import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Map;
-import java.util.jar.JarFile;
import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployment.DeploymentException;
import org.jboss.deployment.DeploymentInfo;
import org.jboss.deployment.MainDeployerMBean;
import org.jboss.deployment.SubDeployer;
import org.jboss.deployment.SubDeployerSupport;
-
+import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.system.ServiceControllerMBean;
import org.jboss.system.server.ServerConfigLocator;
-
import org.jboss.util.Counter;
import org.jboss.util.file.Files;
import org.jboss.util.file.JarUtils;
-import org.jboss.mx.util.MBeanProxyExt;
-
import org.jboss.varia.deployment.convertor.Convertor;
/**
@@ -360,10 +355,10 @@
server
);
- ServerConfig config = ServerConfigLocator.locate();
+ JBossASServerConfig config = ServerConfigLocator.locate();
// build the scratch directory
- File tempDirectory = config.getServerTempDir();
+ File tempDirectory = new File(config.getServerTempLocation().toURI());
scratchDirectory = new File(tempDirectory, "foe");
if(!scratchDirectory.exists())
scratchDirectory.mkdirs();
Index: varia/src/main/org/jboss/varia/property/SystemPropertiesService.java
===================================================================
--- varia/src/main/org/jboss/varia/property/SystemPropertiesService.java (revision 89343)
+++ varia/src/main/org/jboss/varia/property/SystemPropertiesService.java (working copy)
@@ -21,6 +21,7 @@
*/
package org.jboss.varia.property;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -34,6 +35,7 @@
import java.util.SortedSet;
import java.util.StringTokenizer;
import java.util.TreeSet;
+
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -394,7 +396,7 @@
throws Exception
{
// get server's home for relative paths, need this for making urls
- serverHome = ServerConfigLocator.locate().getServerHomeDir().getPath();
+ serverHome = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI()).getPath();
return super.preRegister(server, name);
}
Index: varia/src/main/org/jboss/services/deployment/LibraryManager.java
===================================================================
--- varia/src/main/org/jboss/services/deployment/LibraryManager.java (revision 89343)
+++ varia/src/main/org/jboss/services/deployment/LibraryManager.java (working copy)
@@ -23,9 +23,10 @@
import java.io.File;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.net.URL;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.logging.Logger;
import org.jboss.system.server.ServerConfigLocator;
import org.jboss.util.file.Files;
@@ -65,13 +66,20 @@
private LibraryManager()
{
// discover if there is a local server library dir
- ServerConfig config = ServerConfigLocator.locate();
- URL serverLibURL = config.getServerLibraryURL();
+ JBossASServerConfig config = ServerConfigLocator.locate();
+ URL serverLibURL = config.getServerLibLocation();
if (serverLibURL != null && serverLibURL.getProtocol().startsWith("file"))
{
this.serverLibDir = new File(serverLibURL.getFile());
- this.serverTmpDir = config.getServerTempDir();
+ try
+ {
+ this.serverTmpDir = new File(config.getServerTempLocation().toURI());
+ }
+ catch (URISyntaxException urise)
+ {
+ throw new RuntimeException("Error in initialization", urise);
+ }
log.debug("Using serverLibDir: " + this.serverLibDir);
log.debug("Using serverTmpDir: " + this.serverTmpDir);
}
Index: varia/src/main/org/jboss/services/deployment/DeploymentManager.java
===================================================================
--- varia/src/main/org/jboss/services/deployment/DeploymentManager.java (revision 89343)
+++ varia/src/main/org/jboss/services/deployment/DeploymentManager.java (working copy)
@@ -49,7 +49,6 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
-import org.jboss.bootstrap.spi.ServerConfig;
import org.jboss.deployment.DeploymentInfo;
import org.jboss.logging.Logger;
import org.jboss.mx.util.MBeanServerLocator;
@@ -574,7 +573,7 @@
catch(Exception e) {
// Otherwise, try to see inside the jboss directory hierarchy
- File homeDir = ServerConfigLocator.locate().getServerHomeDir();
+ File homeDir = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI());
dir = new File(homeDir, targetDir);
Index: varia/src/main/org/jboss/services/binding/impl/Util.java
===================================================================
--- varia/src/main/org/jboss/services/binding/impl/Util.java (revision 89343)
+++ varia/src/main/org/jboss/services/binding/impl/Util.java (working copy)
@@ -33,7 +33,7 @@
import java.net.URL;
import java.net.URLConnection;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.services.binding.ServiceBinding;
import org.jboss.services.binding.ServiceBindingValueSource;
@@ -140,7 +140,7 @@
public static File createTempFile() throws IOException
{
- String tmpName = SecurityActions.getSystemProperty(ServerConfig.SERVER_TEMP_DIR, "");
+ String tmpName = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_TEMP_DIR,"");
File tempDirectory = new File(tmpName);
File targetFile = File.createTempFile("service-binding", ".tmp", tempDirectory);
targetFile.deleteOnExit();
Index: varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java
===================================================================
--- varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java (revision 89343)
+++ varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java (working copy)
@@ -22,7 +22,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.system.ServiceMBeanSupport;
import org.opennms.protocols.snmp.SnmpTrapSession;
@@ -126,7 +126,8 @@
try {
// cater for possible global -b option, if no override has been specified
InetAddress address = this.bindAddress != null ? this.bindAddress :
- toInetAddress(System.getProperty(ServerConfig.SERVER_BIND_ADDRESS));
+ toInetAddress(System
+ .getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS));
this.trapSession =
new SnmpTrapSession(new TrapReceiver(this.log), this.port, address);
Index: varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java
===================================================================
--- varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java (revision 89343)
+++ varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java (working copy)
@@ -30,7 +30,8 @@
import javax.management.Notification;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.jmx.adaptor.snmp.config.manager.Manager;
import org.jboss.logging.Logger;
import org.jboss.xb.binding.MappingObjectModelFactory;
@@ -299,8 +300,8 @@
{
if (host == null || host.length() == 0) {
- String defaultBindAddress = System.getProperty(ServerConfig.SERVER_BIND_ADDRESS);
- if (defaultBindAddress != null && !defaultBindAddress.equals("0.0.0.0"))
+ String defaultBindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
+ if (defaultBindAddress != null && !defaultBindAddress.equals(JBossASConfigurationInitializer.VALUE_BIND_ADDRESS_ANY))
return InetAddress.getByName(defaultBindAddress);
else
return InetAddress.getLocalHost();
Index: varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java
===================================================================
--- varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java (revision 89343)
+++ varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java (working copy)
@@ -25,7 +25,7 @@
import javax.management.Notification;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.system.ListenerServiceMBeanSupport;
import org.opennms.protocols.snmp.SnmpAgentSession;
import org.opennms.protocols.snmp.SnmpPeer;
@@ -568,7 +568,7 @@
{
// cater for possible global -b option, if no override has been specified
InetAddress address = this.bindAddress != null ? this.bindAddress :
- toInetAddress(System.getProperty(ServerConfig.SERVER_BIND_ADDRESS));
+ toInetAddress(System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS));
// the listening address
SnmpPeer peer = new SnmpPeer(address, this.port);
Index: varia/pom.xml
===================================================================
--- varia/pom.xml (revision 89343)
+++ varia/pom.xml (working copy)
@@ -44,7 +44,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
Index: varia/build.xml
===================================================================
--- varia/build.xml (revision 89343)
+++ varia/build.xml (working copy)
@@ -117,7 +117,9 @@
-
+
+
+
Index: component-matrix/pom.xml
===================================================================
--- component-matrix/pom.xml (revision 89343)
+++ component-matrix/pom.xml (working copy)
@@ -35,7 +35,7 @@
1.2_12
1.2.1.GA
4.6.1.GA
- 1.1.0.SP1
+ 1.1.1.Alpha1
3.1.2.SP1
1.1.2.GA
3.1.2.GA
@@ -54,7 +54,12 @@
1.0.0.GA
1.0.1.GA
1.0.0.GA
- 1.0.0-Beta-3
+ 0.1.2
+ 0.1.2
+ 0.1.2
+ 0.1.2
+ 0.1.2
+ 0.1.2
1.0.0.GA
3.1.0.GA
3.0.0.GA
@@ -544,11 +549,41 @@
org.jboss.bootstrap
- jboss-bootstrap
- ${version.org.jboss.bootstrap}
+ jboss-bootstrap-impl-as
+ ${version.org.jboss.bootstrap.impl.as}
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-base
+ ${version.org.jboss.bootstrap.impl.base}
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-impl-mc
+ ${version.org.jboss.bootstrap.impl.mc}
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi
+ ${version.org.jboss.bootstrap.spi}
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-as
+ ${version.org.jboss.bootstrap.spi.as}
+
+
+
+ org.jboss.bootstrap
+ jboss-bootstrap-spi-mc
+ ${version.org.jboss.bootstrap.spi.mc}
+
+
+
org.jboss.logging
jboss-logging-spi
2.1.0.GA
@@ -1266,7 +1301,7 @@
org.jboss.test
jboss-test
- 1.1.4.GA
+ 1.1.5-alpha-2
apache-log4j
@@ -1278,7 +1313,7 @@
org.jboss.jbossas
jboss-server-manager
- 1.0.2.GA
+ 1.0.3-alpha-2
org.jboss.jbossas
@@ -2196,6 +2231,7 @@
org.hibernate:hibernate
org.jboss.jbossas:jboss-as-bootstrap
+ org.jboss.jbossas:jboss-bootstrap
Index: server/.classpath
===================================================================
--- server/.classpath (revision 89343)
+++ server/.classpath (working copy)
@@ -21,8 +21,9 @@
-
-
+
+
+
Index: server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
===================================================================
--- server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java (revision 89343)
+++ server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java (working copy)
@@ -23,7 +23,7 @@
import java.net.URL;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
@@ -121,11 +121,12 @@
if(standardJBossXmlPath == null)
{
// Use default server conf/standardjboss.xml location
- String configPath = System.getProperty(ServerConfig.SERVER_CONFIG_URL);
+ final String configUrlProp = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_CONF_URL;
+ String configPath = System.getProperty(configUrlProp);
if(configPath == null )
{
if(ignoreMissingStandardJBossXml == false)
- throw new DeploymentException("standardjboss.xml not specified and "+ServerConfig.SERVER_CONFIG_URL+" does not exist");
+ throw new DeploymentException("standardjboss.xml not specified and "+configUrlProp+" does not exist");
return null;
}
URL configUrl = new URL(configPath);
Index: server/src/main/org/jboss/Shutdown.java
===================================================================
--- server/src/main/org/jboss/Shutdown.java (revision 89343)
+++ server/src/main/org/jboss/Shutdown.java (working copy)
@@ -21,27 +21,25 @@
*/
package org.jboss;
+import gnu.getopt.Getopt;
+import gnu.getopt.LongOpt;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.UndeclaredThrowableException;
-import java.util.Hashtable;
import java.util.ArrayList;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
+import java.util.Hashtable;
+
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.InitialContext;
-
-import gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerProcess;
+import org.jboss.bootstrap.spi.server.Server;
import org.jboss.naming.HttpNamingContextFactory;
-import org.jboss.system.server.ServerImplMBean;
import org.jboss.security.SecurityAssociation;
import org.jboss.security.SimplePrincipal;
import org.jnp.interfaces.NamingContext;
@@ -80,8 +78,6 @@
System.out.println();
System.out.println("operations:");
System.out.println(" -S, --shutdown Shutdown the server");
- System.out.println(" -e, --exit= Force the VM to exit with a status code");
- System.out.println(" -H, --halt= Force the VM to halt with a status code");
System.out.println();
}
@@ -93,7 +89,7 @@
System.exit(0);
}
- String sopts = "-:hD:s:n:a:u:p:Se:H:";
+ String sopts = "-:hD:s:n:a:u:p:S";
LongOpt[] lopts =
{
new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
@@ -101,8 +97,6 @@
new LongOpt("adapter", LongOpt.REQUIRED_ARGUMENT, null, 'a'),
new LongOpt("serverName", LongOpt.REQUIRED_ARGUMENT, null, 'n'),
new LongOpt("shutdown", LongOpt.NO_ARGUMENT, null, 'S'),
- new LongOpt("exit", LongOpt.REQUIRED_ARGUMENT, null, 'e'),
- new LongOpt("halt", LongOpt.REQUIRED_ARGUMENT, null, 'H'),
new LongOpt("user", LongOpt.REQUIRED_ARGUMENT, null, 'u'),
new LongOpt("password", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
};
@@ -115,10 +109,7 @@
String adapterName = "jmx/rmi/RMIAdaptor";
String username = null;
String password = null;
- ObjectName serverJMXName = ServerImplMBean.OBJECT_NAME;
- boolean exit = false;
- boolean halt = false;
- int exitcode = -1;
+ ObjectName serverJMXName = new ObjectName("jboss.system:type=Server");
while ((code = getopt.getopt()) != -1)
{
@@ -179,14 +170,6 @@
password = getopt.getOptarg();
SecurityAssociation.setCredential(password);
break;
- case 'e':
- exitcode = Integer.parseInt(getopt.getOptarg());
- exit = true;
- break;
- case 'H':
- exitcode = Integer.parseInt(getopt.getOptarg());
- halt = true;
- break;
}
}
@@ -225,22 +208,11 @@
MBeanServerConnection adaptor = (MBeanServerConnection) obj;
ServerProxyHandler handler = new ServerProxyHandler(adaptor, serverJMXName);
- Class>[] ifaces = {ServerProcess.class};
+ Class>[] ifaces = {Server.class};
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- ServerProcess server = (ServerProcess) Proxy.newProxyInstance(tcl, ifaces, handler);
-
- if (exit)
- {
- server.exit(exitcode);
- }
- else if (halt)
- {
- server.halt(exitcode);
- }
- else
- {
- server.shutdown();
- }
+ Server,?> server = (Server,?>) Proxy.newProxyInstance(tcl, ifaces, handler);
+ server.shutdown();
+
System.out.println("Shutdown message has been posted to the server.");
System.out.println("Server shutdown may take a while - check logfiles for completion");
}
Index: server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java
===================================================================
--- server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java (revision 89343)
+++ server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java (working copy)
@@ -195,7 +195,7 @@
String ejbName = con.getBeanMetaData().getEjbName();
// Get the system data directory
- File dir = ServerConfigLocator.locate().getServerDataDir();
+ File dir = new File(ServerConfigLocator.locate().getServerDataLocation().toURI());
//
// jason: may have to use a generated token from container config
Index: server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
===================================================================
--- server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java (revision 89343)
+++ server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java (working copy)
@@ -192,7 +192,7 @@
String ejbName = con.getBeanMetaData().getEjbName();
// Get the system data directory
- File dir = ServerConfigLocator.locate().getServerTempDir();
+ File dir = new File(ServerConfigLocator.locate().getServerTempLocation().toURI());
// Setup the reference to the session data store directory
dir = new File(dir, storeDirName);
Index: server/src/main/org/jboss/naming/NamingProviderURLWriter.java
===================================================================
--- server/src/main/org/jboss/naming/NamingProviderURLWriter.java (revision 89343)
+++ server/src/main/org/jboss/naming/NamingProviderURLWriter.java (working copy)
@@ -26,7 +26,7 @@
import java.io.PrintWriter;
import java.net.URI;
-import org.jboss.bootstrap.spi.Server;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
import org.jboss.logging.Logger;
/**
@@ -43,7 +43,7 @@
private static final Logger log = Logger.getLogger(NamingProviderURLWriter.class);
private String bootstrapUrl;
- private Server server;
+ private JBossASServer server;
private URI outputDir;
private String filename = DEFAULT_PERSIST_FILE_NAME;
private File outputFile;
@@ -68,7 +68,7 @@
this.filename = name;
}
- public void setServer(Server server)
+ public void setServer(JBossASServer server)
{
this.server = server;
}
@@ -92,7 +92,7 @@
{
if (server != null)
{
- base = server.getConfig().getServerDataDir();
+ base = new File(server.getConfiguration().getServerDataLocation().toURI());
outputDir = base.toURI();
}
}
Index: server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java
===================================================================
--- server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java (revision 89343)
+++ server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java (working copy)
@@ -25,20 +25,21 @@
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Iterator;
+
import javax.management.ObjectName;
import javax.naming.InitialContext;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.invocation.Invoker;
import org.jboss.invocation.InvokerInterceptor;
+import org.jboss.invocation.http.interfaces.ClientMethodInterceptor;
import org.jboss.invocation.http.interfaces.HttpInvokerProxy;
-import org.jboss.invocation.http.interfaces.ClientMethodInterceptor;
+import org.jboss.metadata.MetaData;
import org.jboss.naming.Util;
import org.jboss.proxy.GenericProxyFactory;
import org.jboss.system.Registry;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.StringPropertyReplacer;
-import org.jboss.metadata.MetaData;
import org.w3c.dom.Element;
/** Create an interface proxy that uses HTTP to communicate with the server
Index: server/src/main/org/jboss/invocation/http/server/HttpInvoker.java
===================================================================
--- server/src/main/org/jboss/invocation/http/server/HttpInvoker.java (revision 89343)
+++ server/src/main/org/jboss/invocation/http/server/HttpInvoker.java (working copy)
@@ -23,6 +23,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
+
import javax.management.MBeanException;
import javax.management.ObjectName;
import javax.management.RuntimeMBeanException;
@@ -31,7 +32,8 @@
import javax.naming.NamingException;
import javax.transaction.Transaction;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.Invoker;
import org.jboss.invocation.MarshalledInvocation;
@@ -203,7 +205,7 @@
{
InetAddress addr = InetAddress.getLocalHost();
// First check for a global bind address
- String host = ServerConfigUtil.getSpecificBindAddress();
+ String host = getSpecificBindAddress();
if( host == null )
{
host = useHostName ? addr.getHostName() : addr.getHostAddress();
@@ -212,5 +214,18 @@
setInvokerURL(url);
}
}
+
+ /**
+ * Retrieve the default bind address, but only if it is specific
+ *
+ * @return the specific bind address
+ */
+ protected static String getSpecificBindAddress()
+ {
+ String address = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
+ if (address == null || address.equals(JBossASConfigurationInitializer.VALUE_BIND_ADDRESS_ANY))
+ return null;
+ return address;
+ }
}
Index: server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java
===================================================================
--- server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java (revision 89343)
+++ server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java (working copy)
@@ -21,37 +21,38 @@
*/
package org.jboss.invocation.pooled.server;
+import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
-import java.util.LinkedList;
-import java.security.PrivilegedExceptionAction;
+import java.rmi.NoSuchObjectException;
import java.security.AccessController;
import java.security.PrivilegedActionException;
-import java.lang.reflect.Method;
-import java.rmi.NoSuchObjectException;
+import java.security.PrivilegedExceptionAction;
+import java.util.LinkedList;
+
import javax.management.ObjectName;
import javax.naming.InitialContext;
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import javax.net.SocketFactory;
-import javax.net.ServerSocketFactory;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.pooled.interfaces.PooledInvokerProxy;
+import org.jboss.invocation.pooled.interfaces.PooledMarshalledInvocation;
import org.jboss.invocation.pooled.interfaces.ServerAddress;
-import org.jboss.invocation.pooled.interfaces.PooledMarshalledInvocation;
import org.jboss.logging.Logger;
+import org.jboss.net.sockets.DefaultSocketFactory;
import org.jboss.proxy.TransactionInterceptor;
+import org.jboss.security.SecurityDomain;
import org.jboss.system.Registry;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.tm.TransactionPropagationContextFactory;
import org.jboss.tm.TransactionPropagationContextImporter;
import org.jboss.tm.TransactionPropagationContextUtil;
-import org.jboss.security.SecurityDomain;
-import org.jboss.net.sockets.DefaultSocketFactory;
/**
* This invoker pools Threads and client connections to one server socket.
Index: server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
===================================================================
--- server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java (revision 89343)
+++ server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java (working copy)
@@ -37,6 +37,7 @@
import javax.naming.NamingException;
import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -68,9 +69,9 @@
import org.jboss.security.ISecurityManagement;
import org.jboss.security.SecurityConstants;
import org.jboss.security.authorization.PolicyRegistration;
+import org.jboss.virtual.VFSUtils;
import org.jboss.web.WebApplication;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-import org.jboss.virtual.VFSUtils;
import org.omg.CORBA.ORB;
/**
@@ -168,7 +169,7 @@
*/
public static String shortWarUrlFromServerHome(String warUrl)
{
- String serverHomeUrl = System.getProperty(org.jboss.bootstrap.spi.ServerConfig.SERVER_HOME_URL);
+ String serverHomeUrl = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_HOME_URL);
if (warUrl == null || serverHomeUrl == null)
return warUrl;
Index: server/src/main/org/jboss/web/WebService.java
===================================================================
--- server/src/main/org/jboss/web/WebService.java (revision 89343)
+++ server/src/main/org/jboss/web/WebService.java (working copy)
@@ -30,8 +30,8 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.threadpool.BasicThreadPoolMBean;
@@ -293,7 +293,7 @@
// if no override has been specified, default to the jboss bind address
if (getBindAddress() == null)
- setBindAddress(System.getProperty(ServerConfig.SERVER_BIND_ADDRESS));
+ setBindAddress(System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS));
// if no host specified, default to the java.rmi.server.hostname property value
if (getHost() == null)
Index: server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml
===================================================================
--- server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml (revision 89343)
+++ server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml (working copy)
@@ -31,7 +31,7 @@
Server object from which the OutputDirURL can be obtained if not directly configured
Server
- org.jboss.bootstrap.spi.Server
+ org.jboss.bootstrap.spi.as.server.JBossASServer
Index: server/src/etc/conf/all/bootstrap/profile.xml
===================================================================
--- server/src/etc/conf/all/bootstrap/profile.xml (revision 89343)
+++ server/src/etc/conf/all/bootstrap/profile.xml (working copy)
@@ -151,7 +151,7 @@
-
+
Index: server/pom.xml
===================================================================
--- server/pom.xml (revision 89343)
+++ server/pom.xml (working copy)
@@ -177,7 +177,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
Index: server/build.xml
===================================================================
--- server/build.xml (revision 89343)
+++ server/build.xml (working copy)
@@ -115,7 +115,9 @@
-
+
+
+
@@ -504,12 +506,12 @@
-
+
-
-
+
+
@@ -524,10 +526,7 @@
-
-
-
-
+
Index: main/.classpath
===================================================================
--- main/.classpath (revision 89343)
+++ main/.classpath (working copy)
@@ -3,6 +3,8 @@
-
+
+
+
Index: main/src/main/org/jboss/Main.java
===================================================================
--- main/src/main/org/jboss/Main.java (revision 89343)
+++ main/src/main/org/jboss/Main.java (working copy)
@@ -24,19 +24,29 @@
import gnu.getopt.Getopt;
import gnu.getopt.LongOpt;
+import java.io.Closeable;
import java.io.File;
import java.io.FilenameFilter;
+import java.io.IOException;
+import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLClassLoader;
import java.net.URLDecoder;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
+import java.util.Set;
-import org.jboss.bootstrap.ServerLoader;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.factory.ServerFactory;
+import org.jboss.bootstrap.spi.lifecycle.LifecycleState;
+import org.jboss.bootstrap.spi.server.Server;
/**
* Provides a command line interface to start the JBoss server.
@@ -61,32 +71,99 @@
*/
public class Main
{
- /** EDU.oswego.cs.dl.util.concurrent */
- private String concurrentLib = "concurrent.jar";
-
/** A URL for obtaining microkernel patches */
private URL bootURL;
-
+
/** Extra jars from the /lib location that are added to the start of the boot
classpath. This can be used to override jboss /lib boot classes.
*/
- private List bootLibraries = new LinkedList();
+ private List bootLibraries = new LinkedList();
/** Extra libraries to load the server with .*/
- private List extraLibraries = new LinkedList();
+ private List extraLibraries = new LinkedList();
/** Extra classpath URLS to load the server with .*/
private List extraClasspath = new LinkedList();
/**
+ * The default list of boot libraries. Does not include
+ * the JAXP or JMX impl, users of this class should add the
+ * proper libraries.
+ * TODO: use vfs to list the root directory
+ * http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153175
+ *
+ * Copied from legacy bootstrap ServerLoader
+ * //TODO JBAS-6920
+ */
+ @Deprecated
+ public static final String[] DEFAULT_BOOT_LIBRARY_LIST =
+ {
+ // Concurrent
+ "concurrent.jar",
+ // Logging
+ "log4j-boot.jar",
+ "jboss-logging-spi.jar",
+ "jboss-logging-log4j.jar",
+ "jboss-logging-jdk.jar",
+ "jboss-logmanager.jar",
+ "jboss-logbridge.jar",
+ // Common jars
+ "jboss-common-core.jar",
+ "jboss-xml-binding.jar",
+ // Bootstrap
+ "jboss-bootstrap-spi.jar",
+ "jboss-bootstrap-spi-as.jar",
+ "jboss-bootstrap-spi-mc.jar",
+ "jboss-bootstrap-impl-base.jar",
+ "jboss-bootstrap-impl-as.jar",
+ "jboss-bootstrap-impl-mc.jar",
+ // Microcontainer
+ "javassist.jar",
+ "jboss-reflect.jar",
+ "jboss-mdr.jar",
+ "jboss-dependency.jar",
+ "jboss-kernel.jar",
+ "jboss-metatype.jar",
+ "jboss-managed.jar",
+ // Fixme ClassLoading
+ "jboss-vfs.jar",
+ "jboss-classloading-spi.jar",
+ "jboss-classloader.jar",
+ "jboss-classloading.jar",
+ "jboss-classloading-vfs.jar",
+ // Fixme aop
+ "jboss-aop.jar",
+ "jboss-aop-mc-int.jar",
+ "trove.jar",};
+
+ /**
* Server properties. This object holds all of the required
* information to get the server up and running. Use System
* properties for defaults.
*/
- private Properties props = new Properties(System.getProperties());
+ private Map props = new HashMap();
+
+ /**
+ * The booted server instance.
+ *
+ * We don't use JBossASServer directly here, because it has
+ * a reference to MC and the Kernel. This would put the bootstrap
+ * AS SPI upon the application classpath, with references to
+ * classes on child ClassLoaders, leading to NCDFE. So just use
+ * the minimal SPI set and load everything via reflection
+ * using the URLCLs we create which reference the boot libraries.
+ */
+ private Server, ?> server;
+
+ /**
+ * The FQN of the default server implementation class to create
+ */
+ private static final String DEFAULT_AS_SERVER_IMPL_CLASS_NAME = "org.jboss.bootstrap.impl.as.server.JBossASServerImpl";
- /** The booted server instance */
- private Server server;
+ /**
+ * The name of the system property denoting where the boot.log will be placed
+ */
+ private static final String SYS_PROP_BOOT_LOG_DIR_NAME = "jboss.boot.server.log.dir";
/**
* Explicit constructor.
@@ -94,13 +171,22 @@
public Main()
{
super();
+
+ // Set default properties
+ final Properties sysProps = System.getProperties();
+ for (final Object propName : sysProps.keySet())
+ {
+ final String propNameString = (String) propName;
+ final String propValue = (String) sysProps.get(propNameString);
+ props.put(propNameString, propValue);
+ }
}
/**
* Access the booted server.
* @return the Server instance.
*/
- public Server getServer()
+ public Server, ?> getServer()
{
return server;
}
@@ -124,15 +210,34 @@
// Initialize the JDK logmanager
String name = System.getProperty("java.util.logging.manager");
- if (name == null) {
- System.setProperty("java.util.logging.manager",
- "org.jboss.logmanager.LogManager");
+ if (name == null)
+ {
+ SecurityActions.setSystemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
}
- // Auto set HOME_DIR to ../bin/run.jar if not set
- String homeDir = props.getProperty(ServerConfig.HOME_DIR);
- if (homeDir == null)
+ // Get JBOSS_HOME appropriately
+ final String homeUrl = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_HOME_URL);
+ final String homeDir = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_HOME_DIR);
+ URL jbossHome = null;
+ // We've been given home URL
+ if (homeUrl != null)
{
+ jbossHome = new URL(homeUrl);
+ }
+ // We've been given home dir
+ else if (homeDir != null)
+ {
+ final File homeDirFile = new File(homeDir);
+ if(!homeDirFile.exists())
+ {
+ throw new IllegalArgumentException("Specified " + JBossASServerConfig.PROP_KEY_JBOSSAS_HOME_DIR
+ + " does not point to a valid location: " + homeDirFile.toString());
+ }
+ jbossHome = homeDirFile.toURI().toURL();
+ }
+ // Nothing specified, so autoset relative to our location
+ else
+ {
String path = Main.class.getProtectionDomain().getCodeSource().getLocation().getFile();
/* The 1.4 JDK munges the code source file with URL encoding so run
* this path through the decoder so that is JBoss starts in a path with
@@ -141,21 +246,54 @@
path = URLDecoder.decode(path, "UTF-8");
File runJar = new File(path);
File homeFile = runJar.getParentFile().getParentFile();
- homeDir = homeFile.getCanonicalPath();
+ URL homeUrlFromDir = homeFile.toURI().toURL();
+ jbossHome = homeUrlFromDir;
}
- props.setProperty(ServerConfig.HOME_DIR, homeDir);
-
- // Setup HOME_URL too, ServerLoader needs this
- String homeURL = props.getProperty(ServerConfig.HOME_URL);
- if (homeURL == null)
+
+ // Get Library URL
+ String libUrlFromProp = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_BOOT_LIBRARY_URL);
+ URL libUrl = null;
+ if (libUrlFromProp != null)
{
- File file = new File(homeDir);
- homeURL = file.toURI().toURL().toString();
- props.setProperty(ServerConfig.HOME_URL, homeURL);
+ libUrl = new URL(libUrlFromProp);
}
+ else
+ {
+ libUrl = new URL(jbossHome, JBossASConfigurationInitializer.VALUE_LIBRARY_URL_SUFFIX_DEFAULT);
+ }
+
+ /*
+ * Set boot log directory
+ */
+ final String sysPropBootLogDir = SYS_PROP_BOOT_LOG_DIR_NAME;
+ final String sysPropLogDir = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_LOG_DIR;
+ String serverName = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_NAME);
+ if (serverName == null || serverName.length() == 0)
+ {
+ serverName = JBossASConfigurationInitializer.VALUE_SERVER_NAME_DEFAULT;
+ }
+ final String manualBootLogDir = props.get(sysPropBootLogDir);
+ final String manualLogDir = props.get(sysPropLogDir);
+ // If nothing's been explicitly specified
+ if (manualBootLogDir == null && manualLogDir == null)
+ {
+ // We default it
+ final URL serverLog = new URL(jbossHome, "server/" + serverName + "/log/");
+ final File serverLogFile = new File(serverLog.toURI());
+ final String serverLogString = serverLogFile.getAbsolutePath();
+ SecurityActions.setSystemProperty(sysPropBootLogDir, serverLogString);
+ }
+ // If we've got a manual log dir, use it
+ else if (manualLogDir != null)
+ {
+ SecurityActions.setSystemProperty(sysPropBootLogDir, manualLogDir);
+ }
+
+ // Get TCCL
+ final ClassLoader tccl = SecurityActions.getThreadContextClassLoader();
- // Load the server instance
- ServerLoader loader = new ServerLoader(props);
+ // Define a Set URLs to have visible to the CL loading the Server
+ final Set urls = new HashSet();
/* If there is a patch dir specified make it the first element of the
loader bootstrap classpath. If its a file url pointing to a dir, then
@@ -169,63 +307,108 @@
if (dir.exists())
{
// Add the local file patch directory
- loader.addURL(dir.toURL());
+ urls.add(dir.toURL());
// Add the contents of the directory too
File[] jars = dir.listFiles(new JarFilter());
for (int j = 0; jars != null && j < jars.length; j++)
{
- loader.addURL(jars[j].getCanonicalFile().toURL());
+ urls.add(jars[j].getCanonicalFile().toURL());
}
}
}
else
{
- loader.addURL(bootURL);
+ urls.add(bootURL);
}
}
// Add any extra libraries
for (int i = 0; i < bootLibraries.size(); i++)
{
- loader.addLibrary(bootLibraries.get(i));
+ urls.add(bootLibraries.get(i));
}
- // Add the jars from the endorsed dir
- loader.addEndorsedJars();
+ // // Add the jars from the endorsed dir
+ // loader.addEndorsedJars();
// jmx UnifiedLoaderRepository needs a concurrent class...
- loader.addLibrary(concurrentLib);
+ // urls.add(concurrentLib);
// Add any extra libraries after the boot libs
for (int i = 0; i < extraLibraries.size(); i++)
{
- loader.addLibrary(extraLibraries.get(i));
+ urls.add(extraLibraries.get(i));
}
// Add any extra classapth URLs
for (int i = 0; i < extraClasspath.size(); i++)
{
- loader.addURL(extraClasspath.get(i));
+ urls.add(extraClasspath.get(i));
}
+
+ // Add all boot libs required from $JBOSS_HOME/lib
+ final File bootLibDir = new File(libUrl.toURI());
+ if (!bootLibDir.exists())
+ {
+ throw new IllegalArgumentException("Boot lib directory not found: " + bootLibDir.toString());
+ }
+ if (!bootLibDir.isDirectory())
+ {
+ throw new IllegalArgumentException("Boot lib directory is not a directory: " + bootLibDir.toString());
+ }
+ for (String filename : DEFAULT_BOOT_LIBRARY_LIST)
+ {
+ final File bootLibFile = new File(bootLibDir, filename);
+ if (!bootLibFile.exists())
+ {
+ System.out.println("WARNING: Could not find expected boot lib " + bootLibFile);
+ }
+ final URL bootLibUrl = bootLibFile.toURI().toURL();
+ urls.add(bootLibUrl);
+ }
+
+ // Make a ClassLoader to be used in loading the server
+ final URL[] urlArray = urls.toArray(new URL[]
+ {});
+ final ClassLoader loadingCl = new URLClassLoader(urlArray, tccl);
// Load the server
- ClassLoader parentCL = Thread.currentThread().getContextClassLoader();
- server = loader.load(parentCL);
+ server = ServerFactory.createServer(DEFAULT_AS_SERVER_IMPL_CLASS_NAME,loadingCl);
- // Initialize the server
- server.init(props);
+ // Get out the default configuration
+ JBossASServerConfig config = (JBossASServerConfig) server.getConfiguration();
+
+ // Set JBOSS_HOME and properties
+ config.properties(props).jbossHome(jbossHome);
+
+ // Make a shutdown hook
+ SecurityActions.addShutdownHook(new ShutdownHook(server,loadingCl));
- // Start 'er up mate!
- server.start();
+ try
+ {
+ // Set the CL
+ SecurityActions.setThreadContextClassLoader(loadingCl);
+
+ // Initialize the server
+ server.initialize();
+
+ // Start 'er up mate!
+ server.start();
+ }
+ finally
+ {
+ // Reset the CL
+ SecurityActions.setThreadContextClassLoader(tccl);
+ }
}
/**
* Shutdown the booted Server instance.
*
*/
- public void shutdown()
+ public void shutdown() throws Throwable
{
server.shutdown();
}
@@ -270,54 +453,52 @@
String programName = System.getProperty("program.name", "jboss");
String sopts = "-:hD:d:p:n:c:Vj::B:L:C:P:b:g:u:m:l:";
LongOpt[] lopts =
- {
- new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
- new LongOpt("bootdir", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
- new LongOpt("patchdir", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
- new LongOpt("netboot", LongOpt.REQUIRED_ARGUMENT, null, 'n'),
- new LongOpt("configuration", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
- new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V'),
- new LongOpt("jaxp", LongOpt.REQUIRED_ARGUMENT, null, 'j'),
- new LongOpt("bootlib", LongOpt.REQUIRED_ARGUMENT, null, 'B'),
- new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L'),
- new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'C'),
- new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null, 'P'),
- new LongOpt("host", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
- new LongOpt("partition", LongOpt.REQUIRED_ARGUMENT, null, 'g'),
- new LongOpt("udp", LongOpt.REQUIRED_ARGUMENT, null, 'u'),
- new LongOpt("mcast_port", LongOpt.REQUIRED_ARGUMENT, null, 'm'),
- new LongOpt("log", LongOpt.REQUIRED_ARGUMENT, null, 'l'),
- };
+ {new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'),
+ new LongOpt("bootdir", LongOpt.REQUIRED_ARGUMENT, null, 'd'),
+ new LongOpt("patchdir", LongOpt.REQUIRED_ARGUMENT, null, 'p'),
+ new LongOpt("netboot", LongOpt.REQUIRED_ARGUMENT, null, 'n'),
+ new LongOpt("configuration", LongOpt.REQUIRED_ARGUMENT, null, 'c'),
+ new LongOpt("version", LongOpt.NO_ARGUMENT, null, 'V'),
+ new LongOpt("jaxp", LongOpt.REQUIRED_ARGUMENT, null, 'j'),
+ new LongOpt("bootlib", LongOpt.REQUIRED_ARGUMENT, null, 'B'),
+ new LongOpt("library", LongOpt.REQUIRED_ARGUMENT, null, 'L'),
+ new LongOpt("classpath", LongOpt.REQUIRED_ARGUMENT, null, 'C'),
+ new LongOpt("properties", LongOpt.REQUIRED_ARGUMENT, null, 'P'),
+ new LongOpt("host", LongOpt.REQUIRED_ARGUMENT, null, 'b'),
+ new LongOpt("partition", LongOpt.REQUIRED_ARGUMENT, null, 'g'),
+ new LongOpt("udp", LongOpt.REQUIRED_ARGUMENT, null, 'u'),
+ new LongOpt("mcast_port", LongOpt.REQUIRED_ARGUMENT, null, 'm'),
+ new LongOpt("log", LongOpt.REQUIRED_ARGUMENT, null, 'l'),};
Getopt getopt = new Getopt(programName, args, sopts, lopts);
int code;
String arg;
- if (System.getProperty(ServerConfig.SERVER_BIND_ADDRESS) == null)
+ final String propKeyJBossasBindAddress = JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS;
+ if (props.get(propKeyJBossasBindAddress) == null)
{
- // ServerConfig.SERVER_BIND_ADDRESS could have been defined via
+ // JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS could have been defined via
// run.conf and so we don't wanna override that.
- props.setProperty(ServerConfig.SERVER_BIND_ADDRESS, "127.0.0.1");
- System.setProperty(ServerConfig.SERVER_BIND_ADDRESS, "127.0.0.1");
+ final String defaultBindAddress = "127.0.0.1";
+ props.put(propKeyJBossasBindAddress, defaultBindAddress);
+ System.setProperty(propKeyJBossasBindAddress, defaultBindAddress);
}
while ((code = getopt.getopt()) != -1)
{
switch (code)
{
- case ':':
- case '?':
+ case ':' :
+ case '?' :
// for now both of these should exit with error status
System.exit(1);
break; // for completeness
- case 1:
+ case 1 :
// this will catch non-option arguments
// (which we don't currently care about)
- System.err.println(programName +
- ": unused non-option argument: " +
- getopt.getOptarg());
+ System.err.println(programName + ": unused non-option argument: " + getopt.getOptarg());
break; // for completeness
- case 'h':
+ case 'h' :
// show command line help
System.out.println("usage: " + programName + " [options]");
System.out.println();
@@ -326,7 +507,8 @@
System.out.println(" -V, --version Show version information");
System.out.println(" -- Stop processing options");
System.out.println(" -D[=] Set a system property");
- System.out.println(" -d, --bootdir= Set the boot patch directory; Must be absolute or url");
+ System.out
+ .println(" -d, --bootdir= Set the boot patch directory; Must be absolute or url");
System.out.println(" -p, --patchdir= Set the patch directory; Must be absolute or url");
System.out.println(" -n, --netboot= Boot from net with the given url as base");
System.out.println(" -c, --configuration= Set the server configuration name");
@@ -343,8 +525,7 @@
System.exit(0);
break; // for completeness
- case 'D':
- {
+ case 'D' : {
// set a system property
arg = getopt.getOptarg();
String name, value;
@@ -377,38 +558,38 @@
break;
}
- case 'd':
+ case 'd' :
// set the boot patch URL
bootURL = makeURL(getopt.getOptarg());
break;
- case 'p':
- {
+ case 'p' : {
// set the patch URL
URL patchURL = makeURL(getopt.getOptarg());
- props.put(ServerConfig.PATCH_URL, patchURL.toString());
+ //TODO
+ // props.put(ServerConfig.PATCH_URL, patchURL.toString());
break;
}
- case 'n':
+ case 'n' :
// set the net boot url
arg = getopt.getOptarg();
// make sure there is a trailing '/'
- if (!arg.endsWith("/")) arg += "/";
+ if (!arg.endsWith("/"))
+ arg += "/";
- props.put(ServerConfig.HOME_URL, new URL(arg).toString());
+ props.put(JBossASServerConfig.PROP_KEY_JBOSSAS_HOME_URL, new URL(arg).toString());
break;
- case 'c':
+ case 'c' :
// set the server name
arg = getopt.getOptarg();
- props.put(ServerConfig.SERVER_NAME, arg);
+ props.put(JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_NAME, arg);
break;
- case 'V':
- {
+ case 'V' : {
// Package information for org.jboss
Package jbossPackage = Package.getPackage("org.jboss");
@@ -422,41 +603,40 @@
break; // for completness
}
- case 'j':
+ case 'j' :
// Show an error and exit
System.err.println(programName + ": option '-j, --jaxp' no longer supported");
System.exit(1);
break; // for completness
- case 'B':
+ case 'B' :
arg = getopt.getOptarg();
- bootLibraries.add(arg);
+ bootLibraries.add(new File(arg).toURI().toURL());
break;
- case 'L':
+ case 'L' :
arg = getopt.getOptarg();
- extraLibraries.add(arg);
+ extraLibraries.add(new File(arg).toURI().toURL());
break;
- case 'C':
- {
+ case 'C' : {
URL url = makeURL(getopt.getOptarg());
extraClasspath.add(url);
break;
}
- case 'P':
- {
+ case 'P' : {
// Set system properties from url/file
URL url = makeURL(getopt.getOptarg());
Properties props = System.getProperties();
props.load(url.openConnection().getInputStream());
break;
}
- case 'b':
+ case 'b' :
arg = getopt.getOptarg();
- props.put(ServerConfig.SERVER_BIND_ADDRESS, arg);
- System.setProperty(ServerConfig.SERVER_BIND_ADDRESS, arg);
+ final String bindAddressPropName = JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS;
+ props.put(bindAddressPropName, arg);
+ System.setProperty(bindAddressPropName, arg);
// used by JGroups; only set if not set via -D so users
// can use a different interface for cluster communication
// There are 2 versions of this property, deprecated bind.address
@@ -475,49 +655,51 @@
bindAddress = ServerConfigUtil.fixRemoteAddress(arg);
System.setProperty("jgroups.bind_addr", bindAddress);
}
-
+
// Set the java.rmi.server.hostname if not set
String rmiHost = System.getProperty("java.rmi.server.hostname");
- if( rmiHost == null )
+ if (rmiHost == null)
{
rmiHost = ServerConfigUtil.fixRemoteAddress(arg);
System.setProperty("java.rmi.server.hostname", rmiHost);
}
break;
-
- case 'g':
+
+ case 'g' :
arg = getopt.getOptarg();
- props.put(ServerConfig.PARTITION_NAME_PROPERTY, arg);
- System.setProperty(ServerConfig.PARTITION_NAME_PROPERTY, arg);
+ final String partitionNamePropName = JBossASServerConfig.PROP_KEY_JBOSSAS_PARTITION_NAME;
+ props.put(partitionNamePropName, arg);
+ System.setProperty(partitionNamePropName, arg);
break;
-
- case 'u':
+
+ case 'u' :
arg = getopt.getOptarg();
- props.put(ServerConfig.PARTITION_UDP_PROPERTY, arg);
- System.setProperty(ServerConfig.PARTITION_UDP_PROPERTY, arg);
+ final String udpGroupPropName = JBossASServerConfig.PROP_KEY_JBOSSAS_PARTITION_UDP_GROUP;
+ props.put(udpGroupPropName, arg);
+ System.setProperty(udpGroupPropName, arg);
// the new jgroups property name
System.setProperty("jgroups.udp.mcast_addr", arg);
break;
-
- case 'm':
+
+ case 'm' :
arg = getopt.getOptarg();
- props.put(ServerConfig.PARTITION_UDP_PORT_PROPERTY, arg);
- System.setProperty(ServerConfig.PARTITION_UDP_PORT_PROPERTY, arg);
+ final String udpPortPropName = JBossASServerConfig.PROP_KEY_JBOSSAS_PARTITION_UDP_PORT;
+ props.put(udpPortPropName, arg);
+ System.setProperty(udpPortPropName, arg);
break;
-
- case 'l':
- {
+
+ case 'l' : {
arg = getopt.getOptarg();
String logPlugin = arg;
- if( arg.equalsIgnoreCase("log4j") )
+ if (arg.equalsIgnoreCase("log4j"))
logPlugin = "org.jboss.logging.Log4jLoggerPlugin";
- else if( arg.equalsIgnoreCase("jdk") )
+ else if (arg.equalsIgnoreCase("jdk"))
logPlugin = "org.jboss.logging.jdk.JDK14LoggerPlugin";
System.setProperty("org.jboss.logging.Logger.pluginClass", logPlugin);
break;
}
-
- default:
+
+ default :
// this should not happen,
// if it does throw an error so we know about it
throw new Error("unhandled option code: " + code);
@@ -525,12 +707,12 @@
}
// Fix up other bind addresses
- String bindAddress = System.getProperty(ServerConfig.SERVER_BIND_ADDRESS);
+ String bindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
if (System.getProperty("java.rmi.server.hostname") == null)
System.setProperty("java.rmi.server.hostname", bindAddress);
if (System.getProperty("jgroups.bind_addr") == null)
System.setProperty("jgroups.bind_addr", bindAddress);
-
+
// Enable jboss.vfs.forceCopy by default, if unspecified
if (System.getProperty("jboss.vfs.forceCopy") == null)
System.setProperty("jboss.vfs.forceCopy", "true");
@@ -547,22 +729,23 @@
*/
public static void main(final String[] args) throws Exception
{
- Runnable worker = new Runnable() {
- public void run()
+ Runnable worker = new Runnable()
+ {
+ public void run()
+ {
+ try
{
- try
- {
- Main main = new Main();
- main.boot(args);
- }
- catch (Exception e)
- {
- System.err.println("Failed to boot JBoss:");
- e.printStackTrace();
- }
+ Main main = new Main();
+ main.boot(args);
}
+ catch (Exception e)
+ {
+ System.err.println("Failed to boot JBoss:");
+ e.printStackTrace();
+ }
+ }
- };
+ };
ThreadGroup threads = new ThreadGroup("jboss");
new Thread(threads, worker, "main").start();
@@ -587,4 +770,185 @@
return name.endsWith(".jar");
}
}
+
+ /**
+ * ServerConfigUtil
+ *
+ * Utilities for accessing server configuration
+ *
+ * @author Adrian Brock
+ * @author ALR Maintained only
+ * @version $Revision$
+ * @deprecated Moved from jboss-bootstrap Legacy as a transition class;
+ * will be removed once we move entirely to a new Main
+ */
+ @Deprecated
+ private static class ServerConfigUtil
+ {
+ /**
+ * Retrieve the default bind address for the server
+ *
+ * @return the default bind adress
+ */
+ public static String getDefaultBindAddress()
+ {
+ return System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
+ }
+
+ /**
+ * Fix the remote inet address.
+ *
+ * If we pass the address to the client we don't want to
+ * tell it to connect to 0.0.0.0, use our host name instead
+ * @param address the passed address
+ * @return the fixed address
+ */
+ public static InetAddress fixRemoteAddress(InetAddress address)
+ {
+ try
+ {
+ if (address == null
+ || InetAddress.getByName(JBossASConfigurationInitializer.VALUE_BIND_ADDRESS_ANY).equals(address))
+ return InetAddress.getLocalHost();
+ }
+ catch (UnknownHostException ignored)
+ {
+ }
+ return address;
+ }
+
+ /**
+ * Fix the remote address.
+ *
+ * If we pass the address to the client we don't want to
+ * tell it to connect to 0.0.0.0, use our host name instead
+ * @param address the passed address
+ * @return the fixed address
+ */
+ public static String fixRemoteAddress(String address)
+ {
+ try
+ {
+ if (address == null || JBossASConfigurationInitializer.VALUE_BIND_ADDRESS_ANY.equals(address))
+ return InetAddress.getLocalHost().getHostName();
+ }
+ catch (UnknownHostException ignored)
+ {
+ }
+ return address;
+ }
+
+ /**
+ * Get the default partition name
+ *
+ * @return the default partition name
+ */
+ public static String getDefaultPartitionName()
+ {
+ return System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_PARTITION_NAME,
+ JBossASConfigurationInitializer.VALUE_PARTITION_NAME_DEFAULT);
+ }
+
+ }
+
+ /**
+ * ShutdownHook
+ *
+ * @author ALR
+ * @version $Revision$
+ */
+ private static class ShutdownHook extends Thread
+ {
+
+ /**
+ * Underlying server instance
+ */
+ private Server, ?> server;
+
+ /**
+ * ClassLoader used to start/init the server
+ */
+ private ClassLoader serverCl;
+
+ /**
+ * Constructor
+ *
+ * @param server
+ * @param serverCl The ClassLoader to be optionally closed upon shutdown
+ * @throws IllegalArgumentException If any argument is not supplied (null)
+ */
+ ShutdownHook(final Server, ?> server,final ClassLoader serverCl) throws IllegalArgumentException
+ {
+ // Precondition checks
+ if(server==null)
+ {
+ throw new IllegalArgumentException("server must be specified");
+ }
+ if(serverCl==null)
+ {
+ throw new IllegalArgumentException("server ClassLoader must be specified");
+ }
+
+ // Set properties
+ this.server = server;
+ this.serverCl = serverCl;
+ }
+
+ /**
+ * Shuts down the server if running
+ */
+ @Override
+ public void run()
+ {
+ // If we have a server
+ if (server != null)
+ {
+ // Log out
+ System.out.println("Posting Shutdown Request to the server...");
+
+ // If we're started or starting
+ final LifecycleState currentState = server.getState();
+ if (currentState.equals(LifecycleState.STARTED) || currentState.equals(LifecycleState.STARTING))
+ {
+ // start in new thread to give positive
+ // feedback to requesting client of success.
+ new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ // just run the hook, don't call System.exit, as we may
+ // be embeded in a vm that would not like that very much
+ server.shutdown();
+
+ /*
+ * Close the Loading CL, if URLCL and JDK7+
+ * JBBOOT-23
+ */
+ if (serverCl != null && serverCl instanceof Closeable)
+ {
+ try
+ {
+ ((Closeable) serverCl).close();
+ }
+ catch (IOException ioe)
+ {
+ // Swallow
+ }
+ }
+ }
+ // In case of any Exception thrown up the chain, let us know
+ catch (final Exception e)
+ {
+ throw new RuntimeException("Exception encountered in shutting down the server", e);
+ }
+ }
+ }.start();
+ }
+
+ }
+ }
+ }
+
}
Index: main/src/resources/log4j-trace.properties
===================================================================
--- main/src/resources/log4j-trace.properties (revision 89343)
+++ main/src/resources/log4j-trace.properties (working copy)
@@ -10,7 +10,7 @@
### A bootstrap file appender
log4j.appender.FILE=org.jboss.logging.appender.FileAppender
-log4j.appender.FILE.File=${jboss.server.log.dir}/boot.log
+log4j.appender.FILE.File=${jboss.boot.server.log.dir}/boot.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
log4j.appender.FILE.Append=false
Index: main/src/resources/log4j.properties
===================================================================
--- main/src/resources/log4j.properties (revision 89343)
+++ main/src/resources/log4j.properties (working copy)
@@ -10,7 +10,7 @@
### A bootstrap file appender
log4j.appender.FILE=org.jboss.logging.appender.FileAppender
-log4j.appender.FILE.File=${jboss.server.log.dir}/boot.log
+log4j.appender.FILE.File=${jboss.boot.server.log.dir}/boot.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
log4j.appender.FILE.Append=false
Index: main/src/resources/log4j-debug.properties
===================================================================
--- main/src/resources/log4j-debug.properties (revision 89343)
+++ main/src/resources/log4j-debug.properties (working copy)
@@ -10,7 +10,7 @@
### A bootstrap file appender
log4j.appender.FILE=org.jboss.logging.appender.FileAppender
-log4j.appender.FILE.File=${jboss.server.log.dir}/boot.log
+log4j.appender.FILE.File=${jboss.boot.server.log.dir}/boot.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n
log4j.appender.FILE.Append=false
Index: main/pom.xml
===================================================================
--- main/pom.xml (revision 89343)
+++ main/pom.xml (working copy)
@@ -55,7 +55,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
gnu-getopt
Index: main/build.xml
===================================================================
--- main/build.xml (revision 89343)
+++ main/build.xml (working copy)
@@ -78,7 +78,10 @@
-
+
+
+
+
@@ -154,13 +157,27 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -172,14 +189,17 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Index: testsuite/.classpath
===================================================================
--- testsuite/.classpath (revision 89343)
+++ testsuite/.classpath (working copy)
@@ -51,8 +51,10 @@
-
+
+
+
Index: testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java
===================================================================
--- testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java (revision 89343)
+++ testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java (working copy)
@@ -55,7 +55,7 @@
protected void startService()
throws Exception
{
- File tmpDir = ServerConfigLocator.locate().getServerTempDir();
+ File tmpDir = new File(ServerConfigLocator.locate().getServerTempLocation().toURI());
boolean result;
// Get a temporary file in the server tmp dir, with a space in its name
Index: testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java
===================================================================
--- testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java (revision 89343)
+++ testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java (working copy)
@@ -21,21 +21,9 @@
*/
package org.jboss.test.jmx.mbean;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeMBeanException;
-import javax.management.loading.MLet;
-
import java.io.File;
-import org.jboss.system.Service;
import org.jboss.system.ServiceMBeanSupport;
-
import org.jboss.system.server.ServerConfigLocator;
/**
@@ -55,7 +43,7 @@
{
public String getBaseDir() throws Exception
{
- File file = ServerConfigLocator.locate().getServerHomeDir();
+ File file = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI());
return file.getCanonicalPath();
}
Index: testsuite/build.xml
===================================================================
--- testsuite/build.xml (revision 89343)
+++ testsuite/build.xml (working copy)
@@ -243,7 +243,9 @@
-
+
+
+
Index: connector/.classpath
===================================================================
--- connector/.classpath (revision 89343)
+++ connector/.classpath (working copy)
@@ -19,6 +19,5 @@
-
Index: connector/src/main/org/jboss/resource/deployment/RARDeployment.java
===================================================================
--- connector/src/main/org/jboss/resource/deployment/RARDeployment.java (revision 89343)
+++ connector/src/main/org/jboss/resource/deployment/RARDeployment.java (working copy)
@@ -39,7 +39,7 @@
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.WorkManager;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployment.DeploymentInfo;
import org.jboss.resource.metadata.ConfigPropertyMetaData;
Index: connector/src/main/org/jboss/resource/deployers/RARDeployment.java
===================================================================
--- connector/src/main/org/jboss/resource/deployers/RARDeployment.java (revision 89343)
+++ connector/src/main/org/jboss/resource/deployers/RARDeployment.java (working copy)
@@ -41,7 +41,7 @@
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.resource.spi.work.WorkManager;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.resource.deployment.ActivationSpecFactory;
import org.jboss.resource.deployment.ResourceAdapterFactory;
Index: connector/build.xml
===================================================================
--- connector/build.xml (revision 89343)
+++ connector/build.xml (working copy)
@@ -111,7 +111,7 @@
-
+
Index: build/build-distr.xml
===================================================================
--- build/build-distr.xml (revision 89343)
+++ build/build-distr.xml (working copy)
@@ -1947,8 +1947,18 @@
-
+
+
+
+
+
Index: build/pom.xml
===================================================================
--- build/pom.xml (revision 89343)
+++ build/pom.xml (working copy)
@@ -22,7 +22,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
Index: iiop/.classpath
===================================================================
--- iiop/.classpath (revision 89343)
+++ iiop/.classpath (working copy)
@@ -7,6 +7,5 @@
-
Index: iiop/src/main/org/jboss/iiop/CorbaORBService.java
===================================================================
--- iiop/src/main/org/jboss/iiop/CorbaORBService.java (revision 89343)
+++ iiop/src/main/org/jboss/iiop/CorbaORBService.java (working copy)
@@ -33,7 +33,7 @@
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.iiop.naming.ORBInitialContextFactory;
import org.jboss.metadata.MetaData;
import org.jboss.proxy.ejb.handle.HandleDelegateImpl;
Index: iiop/build.xml
===================================================================
--- iiop/build.xml (revision 89343)
+++ iiop/build.xml (working copy)
@@ -97,7 +97,6 @@
-
Index: aspects/.classpath
===================================================================
--- aspects/.classpath (revision 89343)
+++ aspects/.classpath (working copy)
@@ -43,6 +43,5 @@
-
Index: console/.classpath
===================================================================
--- console/.classpath (revision 89343)
+++ console/.classpath (working copy)
@@ -11,6 +11,8 @@
-
+
+
+
Index: console/src/main/org/jboss/console/manager/DeploymentFileRepository.java
===================================================================
--- console/src/main/org/jboss/console/manager/DeploymentFileRepository.java (revision 89343)
+++ console/src/main/org/jboss/console/manager/DeploymentFileRepository.java (working copy)
@@ -29,7 +29,7 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.system.server.ServerConfigLocator;
@@ -131,8 +131,8 @@
{
// get server's home for relative paths, need this for setting
// attribute final values, so we need to do it here
- ServerConfig serverConfig = ServerConfigLocator.locate();
- serverHome = serverConfig.getServerHomeDir();
+ JBossASServerConfig serverConfig = ServerConfigLocator.locate();
+ serverHome = new File(serverConfig.getServerHomeLocation().toURI());
return super.preRegister(server, name);
}
Index: console/pom.xml
===================================================================
--- console/pom.xml (revision 89343)
+++ console/pom.xml (working copy)
@@ -108,7 +108,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
org.jboss.jbossas
Index: console/build.xml
===================================================================
--- console/build.xml (revision 89343)
+++ console/build.xml (working copy)
@@ -99,7 +99,9 @@
-
+
+
+
Index: management/.classpath
===================================================================
--- management/.classpath (revision 89343)
+++ management/.classpath (working copy)
@@ -5,6 +5,8 @@
-
+
+
+
Index: management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java
===================================================================
--- management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java (revision 89343)
+++ management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java (working copy)
@@ -45,7 +45,7 @@
import javax.management.QueryExp;
import javax.management.ReflectionException;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
import org.jboss.ha.framework.interfaces.HAPartition;
import org.jboss.management.j2ee.J2EEDomain;
import org.jboss.mx.util.ObjectNameFactory;
@@ -79,7 +79,7 @@
private ObjectName mHAManagementName;
private ObjectName mClusterPartitionName;
- private String mBackgroundPartition = ServerConfigUtil.getDefaultPartitionName();
+ private String mBackgroundPartition = JBossASConfigurationInitializer.VALUE_PARTITION_NAME_DEFAULT;
private HAPartition mPartition;
// Static --------------------------------------------------------
Index: management/pom.xml
===================================================================
--- management/pom.xml (revision 89343)
+++ management/pom.xml (working copy)
@@ -105,7 +105,7 @@
org.jboss.bootstrap
- jboss-bootstrap
+ jboss-bootstrap-impl-as
oswego-concurrent
Index: management/build.xml
===================================================================
--- management/build.xml (revision 89343)
+++ management/build.xml (working copy)
@@ -112,7 +112,9 @@
-
+
+
+