[jboss-cvs] JBossAS SVN: r90659 - in branches/dml-log-service-integration: cluster and 48 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jun 26 17:47:24 EDT 2009
Author: ALRubinger
Date: 2009-06-26 17:47:23 -0400 (Fri, 26 Jun 2009)
New Revision: 90659
Added:
branches/dml-log-service-integration/main/src/main/org/jboss/SecurityActions.java
branches/dml-log-service-integration/server/src/main/org/jboss/config/
branches/dml-log-service-integration/server/src/main/org/jboss/config/ServerConfigUtil.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConstants.java
Removed:
branches/dml-log-service-integration/main/src/main/org/jboss/system/server/
Modified:
branches/dml-log-service-integration/build/build.xml
branches/dml-log-service-integration/build/pom.xml
branches/dml-log-service-integration/cluster/pom.xml
branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java
branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java
branches/dml-log-service-integration/cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java
branches/dml-log-service-integration/component-matrix/pom.xml
branches/dml-log-service-integration/connector/src/main/org/jboss/resource/deployers/RARDeployment.java
branches/dml-log-service-integration/console/pom.xml
branches/dml-log-service-integration/console/src/main/org/jboss/console/manager/DeploymentFileRepository.java
branches/dml-log-service-integration/iiop/src/main/org/jboss/iiop/CorbaORBService.java
branches/dml-log-service-integration/main/pom.xml
branches/dml-log-service-integration/main/src/assembly/run.xml
branches/dml-log-service-integration/main/src/main/org/jboss/Main.java
branches/dml-log-service-integration/management/pom.xml
branches/dml-log-service-integration/management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java
branches/dml-log-service-integration/profileservice/src/resources/hdscanner-jboss-beans.xml
branches/dml-log-service-integration/server/pom.xml
branches/dml-log-service-integration/server/src/etc/conf/all/bootstrap/profile.xml
branches/dml-log-service-integration/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml
branches/dml-log-service-integration/server/src/main/org/jboss/Shutdown.java
branches/dml-log-service-integration/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java
branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpInvoker.java
branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java
branches/dml-log-service-integration/server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java
branches/dml-log-service-integration/server/src/main/org/jboss/naming/NamingProviderURLWriter.java
branches/dml-log-service-integration/server/src/main/org/jboss/web/WebService.java
branches/dml-log-service-integration/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
branches/dml-log-service-integration/system-jmx/pom.xml
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/deployment/MainDeployer.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java
branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
branches/dml-log-service-integration/system/pom.xml
branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java
branches/dml-log-service-integration/system/src/main/org/jboss/system/tools/DeploymentScanner.java
branches/dml-log-service-integration/testsuite/build.xml
branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java
branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java
branches/dml-log-service-integration/thirdparty/pom.xml
branches/dml-log-service-integration/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java
branches/dml-log-service-integration/varia/pom.xml
branches/dml-log-service-integration/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java
branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java
branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java
branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java
branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/DeploymentManager.java
branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/LibraryManager.java
branches/dml-log-service-integration/varia/src/main/org/jboss/varia/property/SystemPropertiesService.java
Log:
[JBAS-6856] Upgrade jboss-bootstrap to new implementation in DML Log Service Integration branch
Modified: branches/dml-log-service-integration/build/build.xml
===================================================================
--- branches/dml-log-service-integration/build/build.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/build/build.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -2043,7 +2043,12 @@
<copy todir="${install.lib}" filtering="no">
<fileset refid="javassist:javassist:jar"/>
<fileset refid="org.jboss.aop:jboss-aop:jar"/>
- <fileset refid="org.jboss.bootstrap:jboss-bootstrap:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-spi:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-spi-mc:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-spi-as:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-impl-base:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-impl-mc:jar"/>
+ <fileset refid="org.jboss.bootstrap:jboss-bootstrap-impl-as:jar"/>
<fileset refid="org.jboss:jboss-common-core:jar"/>
<fileset refid="org.jboss.logging:jboss-logging-spi:jar"/>
<fileset refid="org.jboss.logging:jboss-logging-logmanager:jar"/>
Modified: branches/dml-log-service-integration/build/pom.xml
===================================================================
--- branches/dml-log-service-integration/build/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/build/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -28,10 +28,6 @@
<artifactId>jboss-aop-deployers</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
- </dependency>
- <dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-cluster</artifactId>
</dependency>
Modified: branches/dml-log-service-integration/cluster/pom.xml
===================================================================
--- branches/dml-log-service-integration/cluster/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/cluster/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -204,7 +204,7 @@
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
Modified: branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
===================================================================
--- branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -41,7 +41,15 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.Name;
+import javax.naming.NameNotFoundException;
+import javax.naming.Reference;
+import javax.naming.StringRefAddr;
+
+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;
@@ -84,13 +92,6 @@
import org.jgroups.util.Rsp;
import org.jgroups.util.RspList;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NameNotFoundException;
-import javax.naming.Reference;
-import javax.naming.StringRefAddr;
-
/**
* {@link HAPartition} implementation based on a
* <a href="http://www.jgroups.com/">JGroups</a> <code>RpcDispatcher</code>
@@ -203,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;
Modified: branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java
===================================================================
--- branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/JChannelFactory.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -43,7 +43,7 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
+import org.jboss.config.ServerConfigUtil;
import org.jboss.ha.framework.server.managed.OpenChannelsMapper;
import org.jboss.ha.framework.server.managed.ProtocolStackConfigurationsMapper;
import org.jboss.logging.Logger;
Modified: branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java
===================================================================
--- branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/cluster/src/main/org/jboss/ha/framework/server/util/TopologyMonitorService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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;
Modified: branches/dml-log-service-integration/cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java
===================================================================
--- branches/dml-log-service-integration/cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/cluster/src/main/org/jboss/invocation/http/server/HttpProxyFactoryHA.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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;
Modified: branches/dml-log-service-integration/component-matrix/pom.xml
===================================================================
--- branches/dml-log-service-integration/component-matrix/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/component-matrix/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -55,7 +55,12 @@
<version.org.jboss.aspects.remoting>1.0.1.GA</version.org.jboss.aspects.remoting>
<version.org.jboss.aspects.security>1.0.0.GA</version.org.jboss.aspects.security>
<version.org.jboss.aspects.transaction>1.0.0.GA</version.org.jboss.aspects.transaction>
- <version.org.jboss.bootstrap>1.0.0-Beta-2</version.org.jboss.bootstrap>
+ <version.org.jboss.bootstrap.impl.as>2.0.0-alpha-2</version.org.jboss.bootstrap.impl.as>
+ <version.org.jboss.bootstrap.impl.base>2.0.0-alpha-1</version.org.jboss.bootstrap.impl.base>
+ <version.org.jboss.bootstrap.impl.mc>2.0.0-alpha-1</version.org.jboss.bootstrap.impl.mc>
+ <version.org.jboss.bootstrap.spi>2.0.0-alpha-1</version.org.jboss.bootstrap.spi>
+ <version.org.jboss.bootstrap.spi.as>2.0.0-alpha-1</version.org.jboss.bootstrap.spi.as>
+ <version.org.jboss.bootstrap.spi.mc>2.0.0-alpha-1</version.org.jboss.bootstrap.spi.mc>
<version.org.jboss.cache.core>3.1.0.GA</version.org.jboss.cache.core>
<version.org.jboss.cache.pojo>3.0.0.GA</version.org.jboss.cache.pojo>
<version.org.jboss.cl>2.0.6.GA</version.org.jboss.cl>
@@ -1761,9 +1766,39 @@
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
- <version>${version.org.jboss.bootstrap}</version>
+ <artifactId>jboss-bootstrap-impl-as</artifactId>
+ <version>${version.org.jboss.bootstrap.impl.as}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-base</artifactId>
+ <version>${version.org.jboss.bootstrap.impl.base}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-mc</artifactId>
+ <version>${version.org.jboss.bootstrap.impl.mc}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi</artifactId>
+ <version>${version.org.jboss.bootstrap.spi}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
+ <version>${version.org.jboss.bootstrap.spi.as}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-mc</artifactId>
+ <version>${version.org.jboss.bootstrap.spi.mc}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.javaee</groupId>
@@ -2221,6 +2256,7 @@
<!-- JBAS-6904: use org.hibernate:hibernate-core -->
<exclude>org.hibernate:hibernate</exclude>
<exclude>org.jboss.jbossas:jboss-as-bootstrap</exclude> <!-- org.jboss.bootstrap:jboss-bootstrap JBAS-6171 -->
+ <exclude>org.jboss.jbossas:jboss-bootstrap</exclude> <!-- org.jboss.bootstrap:jboss-bootstrap-impl-as JBAS-6856 -->
<exclude>wutka-dtdparser:dtdparser121</exclude>
</excludes>
</bannedDependencies>
Modified: branches/dml-log-service-integration/connector/src/main/org/jboss/resource/deployers/RARDeployment.java
===================================================================
--- branches/dml-log-service-integration/connector/src/main/org/jboss/resource/deployers/RARDeployment.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/connector/src/main/org/jboss/resource/deployers/RARDeployment.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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;
Modified: branches/dml-log-service-integration/console/pom.xml
===================================================================
--- branches/dml-log-service-integration/console/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/console/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -180,7 +180,7 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
Modified: branches/dml-log-service-integration/console/src/main/org/jboss/console/manager/DeploymentFileRepository.java
===================================================================
--- branches/dml-log-service-integration/console/src/main/org/jboss/console/manager/DeploymentFileRepository.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/console/src/main/org/jboss/console/manager/DeploymentFileRepository.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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);
}
Modified: branches/dml-log-service-integration/iiop/src/main/org/jboss/iiop/CorbaORBService.java
===================================================================
--- branches/dml-log-service-integration/iiop/src/main/org/jboss/iiop/CorbaORBService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/iiop/src/main/org/jboss/iiop/CorbaORBService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -33,13 +33,13 @@
import javax.naming.Reference;
import javax.naming.spi.ObjectFactory;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
import org.jboss.iiop.naming.ORBInitialContextFactory;
import org.jboss.metadata.MetaData;
import org.jboss.proxy.ejb.handle.HandleDelegateImpl;
import org.jboss.security.SecurityDomain;
import org.jboss.system.Registry;
import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.config.ServerConfigUtil;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
import org.omg.PortableServer.IdAssignmentPolicy;
Modified: branches/dml-log-service-integration/main/pom.xml
===================================================================
--- branches/dml-log-service-integration/main/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/main/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -144,7 +144,7 @@
<!-- Compile (global dependencies) -->
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
<groupId>gnu-getopt</groupId>
Modified: branches/dml-log-service-integration/main/src/assembly/run.xml
===================================================================
--- branches/dml-log-service-integration/main/src/assembly/run.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/main/src/assembly/run.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -28,18 +28,39 @@
<unpack>true</unpack>
<unpackOptions>
<includes>
- <include>org/jboss/bootstrap/spi/Server.class</include>
- <include>org/jboss/bootstrap/spi/ServerConfig.class</include>
- <include>org/jboss/bootstrap/spi/util/ServerConfigUtil.class</include>
+ <include>org/jboss/bootstrap/spi/**</include>
</includes>
</unpackOptions>
<includes>
- <include>org.jboss.bootstrap:jboss-bootstrap</include>
+ <include>org.jboss.bootstrap:jboss-bootstrap-spi</include>
</includes>
</dependencySet>
<dependencySet>
<unpack>true</unpack>
+ <unpackOptions>
+ <includes>
+ <include>org/jboss/bootstrap/spi/as/config/JBossASServerConfig.class</include>
+ <include>org/jboss/bootstrap/spi/as/config/JBossASConfigurationInitializer.class</include>
+ </includes>
+ </unpackOptions>
<includes>
+ <include>org.jboss.bootstrap:jboss-bootstrap-spi-as</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <unpack>true</unpack>
+ <unpackOptions>
+ <includes>
+ <include>org/jboss/bootstrap/spi/mc/config/MCBasedServerConfig.class</include>
+ </includes>
+ </unpackOptions>
+ <includes>
+ <include>org.jboss.bootstrap:jboss-bootstrap-spi-mc</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <unpack>true</unpack>
+ <includes>
<include>gnu-getopt:getopt</include>
</includes>
</dependencySet>
Modified: branches/dml-log-service-integration/main/src/main/org/jboss/Main.java
===================================================================
--- branches/dml-log-service-integration/main/src/main/org/jboss/Main.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/main/src/main/org/jboss/Main.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -21,22 +21,34 @@
*/
package org.jboss;
+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 gnu.getopt.Getopt;
-import gnu.getopt.LongOpt;
-import org.jboss.bootstrap.spi.Server;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
-import org.jboss.system.server.ServerLoader;
+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.
*
@@ -65,41 +77,104 @@
/** 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<String> bootLibraries = new LinkedList<String>();
+ classpath. This can be used to override jboss /lib boot classes.
+ */
+ private List<URL> bootLibraries = new LinkedList<URL>();
/** Extra libraries to load the server with .*/
- private List<String> extraLibraries = new LinkedList<String>();
+ private List<URL> extraLibraries = new LinkedList<URL>();
/** Extra classpath URLS to load the server with .*/
private List<URL> extraClasspath = new LinkedList<URL>();
+
+ /**
+ * 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
+ "jboss-logging-spi.jar",
+ "jboss-logmanager.jar",
+ "jboss-logging-logmanager.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<String, String> props = new HashMap<String, String>();
- /** The booted server instance */
- private Server server;
+ /**
+ * 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 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.
*/
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;
}
@@ -121,10 +196,29 @@
// First process the command line to pickup custom props/settings
processCommandLine(args);
- // 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
@@ -133,22 +227,49 @@
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);
- // XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
- // THIS WILL BE REPLACED WITH THE BOOTSTRAP REWORK, JUST TEMP TO MAKE LOGGING WORK UNTIL THEN
- // Set up the boot log directory
- String serverName = props.getProperty(ServerConfig.SERVER_NAME, "default");
- String logDir = props.getProperty("jboss.boot.server.log.dir");
- if (logDir == null) {
- logDir = homeDir + "/server/" + serverName + "/log";
+ // Get Library URL
+ String libUrlFromProp = props.get(JBossASServerConfig.PROP_KEY_JBOSSAS_BOOT_LIBRARY_URL);
+ URL libUrl = null;
+ if (libUrlFromProp != null)
+ {
+ libUrl = new URL(libUrlFromProp);
}
- props.setProperty("jboss.boot.server.log.dir", logDir);
- System.setProperty("jboss.boot.server.log.dir", logDir); // especially hacky
- // XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX
+ 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);
+ }
+
// Initialize the JDK logmanager
String name = System.getProperty("java.util.logging.manager");
if (name == null) {
@@ -159,19 +280,13 @@
System.setProperty("org.jboss.logging.Logger.pluginClass", "org.jboss.logging.logmanager.LoggerPluginImpl");
}
}
+
+ // Get TCCL
+ final ClassLoader tccl = SecurityActions.getThreadContextClassLoader();
- // Setup HOME_URL too, ServerLoader needs this
- String homeURL = props.getProperty(ServerConfig.HOME_URL);
- if (homeURL == null)
- {
- File file = new File(homeDir);
- homeURL = file.toURI().toURL().toString();
- props.setProperty(ServerConfig.HOME_URL, homeURL);
- }
+ // Define a Set URLs to have visible to the CL loading the Server
+ final Set<URL> urls = new HashSet<URL>();
- // Load the server instance
- ServerLoader loader = new ServerLoader(props);
-
/* 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
add the dir and its contents.
@@ -184,63 +299,109 @@
if (dir.exists())
{
// Add the local file patch directory
- loader.addURL(dir.toURL());
+ urls.add(dir.toURI().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().toURI().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);
+// // jmx UnifiedLoaderRepository needs a concurrent class...
+// loader.addLibrary(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
+ // This cast to object first is to workaround the JDK Bug: http://bugs.sun.com/view_bug.do?bug_id=6548436
+ final Object jdk6Bug6548436Hack = (Object) server.getConfiguration();
+ JBossASServerConfig config = (JBossASServerConfig) jdk6Bug6548436Hack;
- // Start 'er up mate!
- server.start();
+ // Set JBOSS_HOME and properties
+ config.properties(props).jbossHome(jbossHome);
+
+ // Make a shutdown hook
+ SecurityActions.addShutdownHook(new ShutdownHook(server, loadingCl));
+
+ 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 Exception
{
server.shutdown();
}
@@ -285,54 +446,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();
@@ -341,7 +500,8 @@
System.out.println(" -V, --version Show version information");
System.out.println(" -- Stop processing options");
System.out.println(" -D<name>[=<value>] Set a system property");
- System.out.println(" -d, --bootdir=<dir> Set the boot patch directory; Must be absolute or url");
+ System.out
+ .println(" -d, --bootdir=<dir> Set the boot patch directory; Must be absolute or url");
System.out.println(" -p, --patchdir=<dir> Set the patch directory; Must be absolute or url");
System.out.println(" -n, --netboot=<url> Boot from net with the given url as base");
System.out.println(" -c, --configuration=<name> Set the server configuration name");
@@ -353,13 +513,12 @@
System.out.println(" -g, --partition=<name> HA Partition name (default=DefaultDomain)");
System.out.println(" -m, --mcast_port=<ip> UDP multicast port; only used by JGroups");
System.out.println(" -u, --udp=<ip> UDP multicast address");
- System.out.println(" -l, --log=<jboss|log4j|jdk> Specify the logger plugin type");
+ System.out.println(" -l, --log=<log4j|jdk> Specify the logger plugin type");
System.out.println();
System.exit(0);
break; // for completeness
- case 'D':
- {
+ case 'D' : {
// set a system property
arg = getopt.getOptarg();
String name, value;
@@ -392,38 +551,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");
@@ -437,41 +596,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
@@ -490,51 +648,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("jboss") )
- logPlugin = "org.jboss.logmanager.LoggerPluginImpl";
- else 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);
@@ -542,12 +700,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");
@@ -604,4 +762,231 @@
return name.endsWith(".jar");
}
}
+
+ /**
+ * ServerConfigUtil
+ *
+ * Utilities for accessing server configuration
+ *
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a> 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 <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @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...");
+
+
+ // start in new thread to give positive
+ // feedback to requesting client of success.
+ final Thread shutdownThread = new Thread()
+ {
+ public void run()
+ {
+ try
+ {
+ // Flag if we've got a clean shutdown (ie. server had completely started)
+ boolean cleanShutdown = false;
+
+ /*
+ * This bit is a hack.
+ *
+ * It's in place because AS does not presently respond to Thread
+ * interruption. If it did, then the start lifecycle would
+ * attempt to cleanly finish in expedient fashion such that the shutdown
+ * lifecycle could take over.
+ *
+ * Until the server is able to have start() get interrupted, we'd be
+ * blocking on a complete startup before shutdown could continue.
+ * We don't want to wait for full startup, so this hack only triggers
+ * shutdown if fully started. If still starting, we prematurely
+ * halt the VM.
+ *
+ * JBBOOT-75
+ * JBAS-6974
+ */
+ // Shutdown if started only
+ if (server.getState().equals(LifecycleState.STARTED))
+ {
+ cleanShutdown = true;
+ 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
+ }
+ }
+
+ /*
+ * Part of the halt hack as explained above
+ *
+ * JBBOOT-75
+ * JBAS-6974
+ */
+ // If the server's not fully started, we're not going to block on it
+ // before calling shutdown, so just kill the VM
+ if (!cleanShutdown)
+ {
+ System.out.println("Server startup has not completed, so halting the process");
+ Runtime.getRuntime().halt(-1);
+ }
+
+ }
+ // 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);
+ }
+ }
+ };
+
+ // Run
+ shutdownThread.start();
+
+ // Block until done
+ try
+ {
+ shutdownThread.join();
+ }
+ catch (final InterruptedException ie)
+ {
+ // Clear the flag
+ Thread.interrupted();
+ }
+ }
+ }
+ }
}
Added: branches/dml-log-service-integration/main/src/main/org/jboss/SecurityActions.java
===================================================================
--- branches/dml-log-service-integration/main/src/main/org/jboss/SecurityActions.java (rev 0)
+++ branches/dml-log-service-integration/main/src/main/org/jboss/SecurityActions.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * SecurityActions
+ *
+ * Collection of tasks to be run under a security manager,
+ * package-private so we don't leak out.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+class SecurityActions
+{
+
+ //-------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * No external instanciation
+ */
+ private SecurityActions()
+ {
+
+ }
+
+ //-------------------------------------------------------------------------------||
+ // Utility Methods --------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * Sets the specified property with key and value
+ */
+ static void setSystemProperty(final String key, final String value)
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ System.setProperty(key, value);
+ return null;
+ }
+ });
+ }
+
+ /**
+ * Obtains the system property with the specified key
+ *
+ * @param key
+ * @return
+ * @throws IllegalArgumentException If the key is null
+ */
+ static String getSystemProperty(final String key) throws IllegalArgumentException
+ {
+ // Precondition check
+ if (key == null)
+ {
+ throw new IllegalArgumentException("key was null");
+ }
+
+ // Get sysprop
+ return AccessController.doPrivileged(new PrivilegedAction<String>()
+ {
+ public String run()
+ {
+ return System.getProperty(key);
+ }
+ });
+ }
+
+ /**
+ * Obtains the Thread Context ClassLoader
+ */
+ static ClassLoader getThreadContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+
+ /**
+ * Sets the specified CL upon the current Thread's Context
+ *
+ * @param cl
+ * @throws IllegalArgumentException If the CL was null
+ */
+ static void setThreadContextClassLoader(final ClassLoader cl) throws IllegalArgumentException
+ {
+ if (cl == null)
+ {
+ throw new IllegalArgumentException("ClassLoader was null");
+ }
+
+ AccessController.doPrivileged(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ Thread.currentThread().setContextClassLoader(cl);
+ return null;
+ };
+ });
+ }
+
+ /**
+ * Adds the specified shutdown hook
+ *
+ * @param shutdownHook
+ */
+ static void addShutdownHook(final Thread shutdownHook)
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Void>()
+ {
+ public Void run()
+ {
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
+ return null;
+ }
+ });
+
+ }
+}
Modified: branches/dml-log-service-integration/management/pom.xml
===================================================================
--- branches/dml-log-service-integration/management/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/management/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -133,7 +133,7 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
<groupId>oswego-concurrent</groupId>
Modified: branches/dml-log-service-integration/management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java
===================================================================
--- branches/dml-log-service-integration/management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/management/src/main/org/jboss/management/j2ee/cluster/HAManagementService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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 --------------------------------------------------------
Modified: branches/dml-log-service-integration/profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- branches/dml-log-service-integration/profileservice/src/resources/hdscanner-jboss-beans.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/profileservice/src/resources/hdscanner-jboss-beans.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -19,7 +19,7 @@
<constructor>
<parameter><inject bean="ProfileServiceDeploymentRepositoryAdapter"/></parameter>
</constructor>
- <property name="serverConfig"><inject bean="JBossServer" property="config"/></property>
+ <property name="serverConfig"><inject bean="JBossServer" property="configuration"/></property>
</bean>
<bean name="ProfileServiceDeploymentRepositoryAdapter" class="org.jboss.system.tools.ProfileServiceDeploymentRepositoryAdapter">
Modified: branches/dml-log-service-integration/server/pom.xml
===================================================================
--- branches/dml-log-service-integration/server/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -302,7 +302,7 @@
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
Modified: branches/dml-log-service-integration/server/src/etc/conf/all/bootstrap/profile.xml
===================================================================
--- branches/dml-log-service-integration/server/src/etc/conf/all/bootstrap/profile.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/etc/conf/all/bootstrap/profile.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -151,7 +151,7 @@
<!-- Here we use the constructor version that takes the Server impl and
uses it to find the data dir. You could alternatively use a version
that takes a URI or a File. -->
- <parameter class="org.jboss.bootstrap.spi.Server"><inject bean="JBossServer"/></parameter>
+ <parameter class="org.jboss.bootstrap.spi.as.server.JBossASServer"><inject bean="JBossServer"/></parameter>
</constructor>
</bean>
Modified: branches/dml-log-service-integration/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml
===================================================================
--- branches/dml-log-service-integration/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -31,7 +31,7 @@
<attribute access="write-only" setMethod="setServer">
<description>Server object from which the OutputDirURL can be obtained if not directly configured</description>
<name>Server</name>
- <type>org.jboss.bootstrap.spi.Server</type>
+ <type>org.jboss.bootstrap.spi.as.server.JBossASServer</type>
</attribute>
<attribute access="read-write" getMethod="getBootstrapURL" setMethod="setBootstrapURL">
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/Shutdown.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/Shutdown.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/Shutdown.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -38,8 +38,7 @@
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.as.server.JBossASServer;
import org.jboss.naming.HttpNamingContextFactory;
import org.jboss.system.server.ServerImplMBean;
import org.jboss.security.SecurityAssociation;
@@ -225,22 +224,11 @@
MBeanServerConnection adaptor = (MBeanServerConnection) obj;
ServerProxyHandler handler = new ServerProxyHandler(adaptor, serverJMXName);
- Class<?>[] ifaces = {ServerProcess.class};
+ Class<?>[] ifaces = {JBossASServer.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();
- }
+ JBossASServer server = (JBossASServer) 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");
}
Added: branches/dml-log-service-integration/server/src/main/org/jboss/config/ServerConfigUtil.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/config/ServerConfigUtil.java (rev 0)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/config/ServerConfigUtil.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.config;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.jboss.bootstrap.spi.as.config.JBossASConfigurationInitializer;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+
+/**
+ * ServerConfigUtil
+ *
+ * Utilities for accessing server configuration. Moved from
+ * legacy bootstrap implementation and preserved to protect
+ * legacy, working code from being disturbed.
+ *
+ * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a> Maintain only
+ * @version $Revision: $
+ */
+public final class ServerConfigUtil
+{
+ /**
+ * Private constructor
+ */
+ private ServerConfigUtil()
+ {
+ // No external instances
+ }
+
+ /**
+ * Retrieve the default bind address, but only if it is specific
+ *
+ * @return the specific bind address
+ */
+ public 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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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_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;
+ }
+ }
+}
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -23,7 +23,6 @@
import java.net.URL;
-import org.jboss.bootstrap.spi.ServerConfig;
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer;
@@ -32,6 +31,7 @@
import org.jboss.metadata.ejb.spec.EjbJarMetaData;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
/**
* An ObjectModelFactoryDeployer for translating jboss.xml descriptors into
@@ -121,11 +121,12 @@
if(standardJBossXmlPath == null)
{
// Use default server conf/standardjboss.xml location
- String configPath = System.getProperty(ServerConfig.SERVER_CONFIG_URL);
+ final String configPropName = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_CONF_URL;
+ String configPath = System.getProperty(configPropName);
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 "+configPropName+" does not exist");
return null;
}
URL configUrl = new URL(configPath);
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/CMPFilePersistenceManager.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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);
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpInvoker.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpInvoker.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpInvoker.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -31,7 +31,6 @@
import javax.naming.NamingException;
import javax.transaction.Transaction;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.Invoker;
import org.jboss.invocation.MarshalledInvocation;
@@ -39,6 +38,7 @@
import org.jboss.system.Registry;
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.StringPropertyReplacer;
+import org.jboss.config.ServerConfigUtil;
/**
* The HttpInvoker ... into the JMX base.
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/invocation/http/server/HttpProxyFactory.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -28,7 +28,6 @@
import javax.management.ObjectName;
import javax.naming.InitialContext;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
import org.jboss.invocation.Invoker;
import org.jboss.invocation.InvokerInterceptor;
import org.jboss.invocation.http.interfaces.HttpInvokerProxy;
@@ -39,6 +38,7 @@
import org.jboss.system.ServiceMBeanSupport;
import org.jboss.util.StringPropertyReplacer;
import org.jboss.metadata.MetaData;
+import org.jboss.config.ServerConfigUtil;
import org.w3c.dom.Element;
/** Create an interface proxy that uses HTTP to communicate with the server
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/invocation/pooled/server/PooledInvoker.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -38,7 +38,6 @@
import javax.net.SocketFactory;
import javax.net.ServerSocketFactory;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.pooled.interfaces.PooledInvokerProxy;
import org.jboss.invocation.pooled.interfaces.ServerAddress;
@@ -52,6 +51,7 @@
import org.jboss.tm.TransactionPropagationContextUtil;
import org.jboss.security.SecurityDomain;
import org.jboss.net.sockets.DefaultSocketFactory;
+import org.jboss.config.ServerConfigUtil;
/**
* This invoker pools Threads and client connections to one server socket.
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/naming/NamingProviderURLWriter.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/naming/NamingProviderURLWriter.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/naming/NamingProviderURLWriter.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -26,8 +26,8 @@
import java.io.PrintWriter;
import java.net.URI;
-import org.jboss.bootstrap.spi.Server;
import org.jboss.logging.Logger;
+import org.jboss.bootstrap.spi.as.server.JBossASServer;
/**
*
@@ -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();
}
}
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/web/WebService.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/web/WebService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/web/WebService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -27,9 +27,9 @@
import java.util.Enumeration;
import java.util.Properties;
import java.util.concurrent.Executor;
-import org.jboss.bootstrap.spi.ServerConfig;
-import org.jboss.bootstrap.spi.util.ServerConfigUtil;
import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.config.ServerConfigUtil;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -292,7 +292,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)
Modified: branches/dml-log-service-integration/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
===================================================================
--- branches/dml-log-service-integration/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -71,6 +71,7 @@
import org.jboss.web.WebApplication;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.virtual.VFSUtils;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
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_HOME_URL);
if (warUrl == null || serverHomeUrl == null)
return warUrl;
Modified: branches/dml-log-service-integration/system/pom.xml
===================================================================
--- branches/dml-log-service-integration/system/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -114,7 +114,7 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
Modified: branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java
===================================================================
--- branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/ProfileServiceBootstrap.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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,14 @@
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.config.ServerConfig;
+import org.jboss.bootstrap.spi.mc.config.MCServerConfig;
+import org.jboss.bootstrap.spi.mc.server.MCBasedServer;
+import org.jboss.bootstrap.spi.mc.server.MCServer;
+import org.jboss.bootstrap.spi.server.Server;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.deployers.client.spi.IncompleteDeploymentException;
@@ -67,7 +69,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,22 +77,17 @@
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;
import org.jboss.profileservice.spi.ProfileKey;
import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.profileservice.spi.metadata.ProfileMetaData;
import org.jboss.profileservice.spi.types.ControllerStateMetaType;
import org.jboss.system.server.profileservice.repository.AbstractBootstrapProfileFactory;
@@ -103,7 +99,7 @@
* @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
* @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 +227,7 @@
/**
*
*/
- public void start(Server server)
+ public void start(JBossASServer server)
throws Exception
{
shutdown.set(false);
@@ -251,7 +247,7 @@
// Load the profiles
if(this.profileKey == null)
- this.profileKey = new ProfileKey(server.getConfig().getServerName());
+ this.profileKey = new ProfileKey(server.getConfiguration().getServerName());
// TODO check if there is a predetermined ProfileMetaData attachment
// Map<String, Object> metaData = server.getMetaData();
@@ -299,14 +295,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 modification checks on all mutable profiles
for(ProfileKey key : profileService.getActiveProfileKeys())
@@ -418,10 +414,10 @@
}
Map<String, KernelDeployment> 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;
@@ -563,7 +559,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);
Modified: branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java
===================================================================
--- branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/JAXBRepositoryContentMetadataPersister.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -24,11 +24,12 @@
import java.io.File;
import java.net.URI;
+import java.net.URISyntaxException;
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,9 +57,14 @@
resolver.addClassBindingForLocation("repository-content", RepositoryContentMetadata.class);
}
- public JAXBRepositoryContentMetadataPersister(Server server)
+ /**
+ * Constructor
+ * @param server
+ * @throws URISyntaxException If the server's configuration data location could not be represented as a URI
+ */
+ public JAXBRepositoryContentMetadataPersister(final JBossASServer server) throws URISyntaxException
{
- this(server.getConfig().getServerDataDir());
+ this(server.getConfiguration().getServerDataLocation().toURI());
}
public JAXBRepositoryContentMetadataPersister(URI uri)
Modified: branches/dml-log-service-integration/system/src/main/org/jboss/system/tools/DeploymentScanner.java
===================================================================
--- branches/dml-log-service-integration/system/src/main/org/jboss/system/tools/DeploymentScanner.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system/src/main/org/jboss/system/tools/DeploymentScanner.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -28,7 +28,7 @@
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.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
import org.jboss.util.StringPropertyReplacer;
/**
@@ -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;
}
Modified: branches/dml-log-service-integration/system-jmx/pom.xml
===================================================================
--- branches/dml-log-service-integration/system-jmx/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -88,7 +88,7 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.jbossas</groupId>
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/deployment/MainDeployer.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/deployment/MainDeployer.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/deployment/MainDeployer.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -33,11 +33,12 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+
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.deployers.client.spi.DeployerClient;
import org.jboss.deployers.client.spi.Deployment;
import org.jboss.deployers.structure.spi.DeploymentContext;
@@ -207,9 +208,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
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/deployers/SARDeployer.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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);
}
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/pm/XMLAttributePersistenceManager.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -644,7 +644,7 @@
catch(Exception e) {
// Otherwise, try to make it inside the jboss directory hierarchy
- File homeDir = ServerConfigLocator.locate().getServerHomeDir();
+ final File homeDir = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI());
dir = new File(homeDir, baseDir);
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImpl.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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;
}
@@ -57,149 +58,374 @@
{
return config.equals(obj);
}
+
+ /*
+ * All methods below this marker delegate to the underlying config
+ */
- public boolean getBlockingShutdown()
+ 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<String, String> 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<String, String> arg0) throws IllegalArgumentException,
+ IllegalStateException
+ {
+ config.properties(arg0);
+ return this;
+ }
+
+ public JBossASServerConfig properties(Properties arg0) throws IllegalArgumentException, IllegalStateException
+ {
+ config.properties(arg0);
+ return this;
+ }
}
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigImplMBean.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -21,186 +21,16 @@
*/
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() ;
-
}
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConfigLocator.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -21,7 +21,8 @@
*/
package org.jboss.system.server;
-import org.jboss.bootstrap.spi.ServerConfig;
+import org.jboss.bootstrap.spi.as.config.JBossASServerConfig;
+import org.jboss.bootstrap.spi.config.ServerConfig;
import org.jboss.mx.util.MBeanProxyExt;
/**
@@ -33,13 +34,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);
}
Added: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConstants.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConstants.java (rev 0)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerConstants.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.system.server;
+
+import javax.management.ObjectName;
+
+import org.jboss.mx.util.ObjectNameFactory;
+
+/**
+ * ServerConstants
+ *
+ * Holds constants used for the Server MBean. This
+ * class is primarily in place such that we may access
+ * properties without leaking JBossASServer and MC Kernel
+ * references like {@link ServerImplMBean} does.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface ServerConstants
+{
+ /** The default object name */
+ ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.system:type=Server");
+}
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/ServerImplMBean.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -21,21 +21,15 @@
*/
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 ----------------------------------------------------
-
+
/**
* Hint to the JVM to run the garbage collector.
*/
Modified: branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java
===================================================================
--- branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/system-jmx/src/main/org/jboss/system/server/jmx/JMXKernel.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -27,6 +27,7 @@
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;
@@ -38,16 +39,25 @@
import javax.management.NotificationEmitter;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;
-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.logging.Logger;
import org.jboss.mx.loading.RepositoryClassLoader;
import org.jboss.mx.server.ServerConstants;
import org.jboss.mx.util.JMXExceptionDecoder;
@@ -63,7 +73,6 @@
import org.jboss.util.file.FileSuffixFilter;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
-import org.jboss.logging.Logger;
/**
* A pojo that creates a legacy jmx kernel ala the jboss-4.x server bootstrap.
@@ -82,9 +91,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 */
@@ -103,11 +112,11 @@
super(log);
}
- 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;
@@ -159,15 +168,15 @@
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() == true)
{
// jdk1.5+
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- Class clazz = cl.loadClass("java.lang.management.ManagementFactory");
- Class[] sig = null;
+ Class<?> clazz = cl.loadClass("java.lang.management.ManagementFactory");
+ Class<?>[] sig = null;
Method method = clazz.getMethod("getPlatformMBeanServer", sig);
Object[] args = null;
mbeanServer = (MBeanServer) method.invoke(null, args);
@@ -268,25 +277,22 @@
// ServerImplMBean delegation
public void init(Properties props) throws Exception
{
- serverImpl.init(props);
+ serverImpl.initialize();
}
- public void init(Properties props, Map<String, Object> metadata) throws Exception
- {
- serverImpl.init(props);
- }
- 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;
}
/**
@@ -342,24 +348,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()
@@ -384,9 +391,30 @@
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();
}
/**
@@ -434,7 +462,7 @@
try
{
MBeanServer registeredServer = mbeanServer;
- if (serverConfig.getPlatformMBeanServer() == true)
+ if (serverConfig.isUsePlatformMBeanServer() == true)
registeredServer = LazyMBeanServer.getRegisteredMBeanServer(mbeanServer);
MBeanServerFactory.releaseMBeanServer(registeredServer);
}
@@ -459,7 +487,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"))
@@ -468,14 +496,14 @@
if (dir.exists())
{
// Add the local file patch directory
- list.add(dir.toURL());
+ list.add(dir.toURI().toURL());
// Add the contents of the directory too
File[] jars = dir.listFiles(new FileSuffixFilter(new String[] { ".jar", ".zip" }, true));
for (int j = 0; jars != null && j < jars.length; j++)
{
- list.add(jars[j].getCanonicalFile().toURL());
+ list.add(jars[j].getCanonicalFile().toURI().toURL());
}
}
}
@@ -486,7 +514,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;
@@ -546,45 +574,118 @@
bootstrapUCLName = ((RealClassLoader) classLoader).getObjectName();
return classLoader;
}
+
+ /*
+ * Below this line are delegate methods only to
+ * fulfill the contract of JBossASServer
+ */
- /**
- * Instantiate and register a service for the given classname into the MBean mbeanServer.
- *
- * @param classname the mbean class name
- * @param name the obejct name
- * @return the object name
- * @throws Exception for any error
- */
- private ObjectName createMBean(final String classname, String name)
- throws Exception
+ public Map<String, KernelDeployment> getDeployments()
{
- ObjectName mbeanName = null;
- if( name != null )
- mbeanName = new ObjectName(name);
- try
- {
- // See if there is an xmbean descriptor for the bootstrap mbean
- URL xmbeanDD = new URL("resource:xmdesc/"+classname+"-xmbean.xml");
- Object resource = mbeanServer.instantiate(classname);
- // Create the XMBean
- Object[] args = {resource, xmbeanDD};
- String[] sig = {Object.class.getName(), URL.class.getName()};
- ObjectInstance instance = mbeanServer.createMBean("org.jboss.mx.modelmbean.XMBean",
- mbeanName,
- bootstrapUCLName,
- args,
- sig);
- mbeanName = instance.getObjectName();
- log.debug("Created system XMBean: "+mbeanName);
- }
- catch(Exception e)
- {
- log.debug("Failed to create xmbean for: "+classname);
- mbeanName = mbeanServer.createMBean(classname, mbeanName).getObjectName();
- log.debug("Created system MBean: " + mbeanName);
- }
+ return serverImpl.getDeployments();
+ }
- return mbeanName;
+ public Kernel getKernel()
+ {
+ return serverImpl.getKernel();
}
+
+ public void addBootstrap(final Bootstrap<JBossASServer, JBossASServerConfig> arg0) throws IllegalArgumentException
+ {
+ serverImpl.addBootstrap(arg0);
+ }
+
+ public ConfigurationInitializer<JBossASServerConfig> getConfigInitializer()
+ {
+ return serverImpl.getConfigInitializer();
+ }
+
+ public JBossASServerConfig getConfiguration()
+ {
+ return serverImpl.getConfiguration();
+ }
+
+ public ServerInitializer<JBossASServer, JBossASServerConfig> getServerInitializer()
+ {
+ return serverImpl.getServerInitializer();
+ }
+
+ public LifecycleState getState()
+ {
+ return serverImpl.getState();
+ }
+
+ public ConfigurationValidator<JBossASServerConfig> getValidator()
+ {
+ return serverImpl.getValidator();
+ }
+
+ public void initialize() throws IllegalStateException, InvalidConfigurationException, LifecycleEventException
+ {
+ serverImpl.initialize();
+ }
+
+ public void registerEventHandler(final LifecycleEventHandler arg0, final EnumSet<LifecycleState> 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<JBossASServer, JBossASServerConfig> arg0)
+ throws IllegalArgumentException
+ {
+ serverImpl.removeBootstrap(arg0);
+
+ }
+
+ public void setConfigInitializer(final ConfigurationInitializer<JBossASServerConfig> arg0)
+ throws IllegalStateException
+ {
+ serverImpl.setConfigInitializer(arg0);
+
+ }
+
+ public void setConfiguration(final JBossASServerConfig arg0)
+ {
+ serverImpl.setConfiguration(arg0);
+ }
+
+ public void setServerInitializer(final ServerInitializer<JBossASServer, JBossASServerConfig> arg0)
+ throws IllegalStateException
+ {
+ serverImpl.setServerInitializer(arg0);
+
+ }
+
+ public void setValidator(final ConfigurationValidator<JBossASServerConfig> arg0) throws IllegalStateException
+ {
+ serverImpl.setValidator(arg0);
+
+ }
+
+ public boolean unregisterEventHandler(final LifecycleEventHandler arg0, final LifecycleState arg1)
+ throws IllegalArgumentException
+ {
+ return serverImpl.unregisterEventHandler(arg0, arg1);
+ }
}
Modified: branches/dml-log-service-integration/testsuite/build.xml
===================================================================
--- branches/dml-log-service-integration/testsuite/build.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/testsuite/build.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -241,7 +241,12 @@
<path refid="jboss.security.int.classpath"/>
<path refid="jboss.server.classpath"/>
<path refid="jboss.main.classpath"/>
- <path refid="jboss.jboss.bootstrap.classpath"/>
+ <path refid="jboss.jboss.bootstrap.spi.classpath"/>
+ <path refid="jboss.jboss.bootstrap.spi.as.classpath"/>
+ <path refid="jboss.jboss.bootstrap.spi.mc.classpath"/>
+ <path refid="jboss.jboss.bootstrap.impl.base.classpath"/>
+ <path refid="jboss.jboss.bootstrap.impl.as.classpath"/>
+ <path refid="jboss.jboss.bootstrap.impl.mc.classpath"/>
<path refid="jboss.system.classpath"/>
<path refid="jboss.systemjmx.classpath"/>
<path refid="jboss.test.classpath"/>
Modified: branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java
===================================================================
--- branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/mbean/TestDeployer.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -55,7 +55,7 @@
{
public String getBaseDir() throws Exception
{
- File file = ServerConfigLocator.locate().getServerHomeDir();
+ File file = new File(ServerConfigLocator.locate().getServerHomeLocation().toURI());
return file.getCanonicalPath();
}
Modified: branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java
===================================================================
--- branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/testsuite/src/main/org/jboss/test/jmx/xmbean/XMLAttributePersistenceManagerTestService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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
Modified: branches/dml-log-service-integration/thirdparty/pom.xml
===================================================================
--- branches/dml-log-service-integration/thirdparty/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/thirdparty/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -629,12 +629,47 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-impl-as</artifactId>
<mapping>
- <componentId>jboss.jboss-bootstrap</componentId>
+ <componentId>jboss.jboss-bootstrap-impl-as</componentId>
</mapping>
</dependency>
<dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-base</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-bootstrap-impl-base</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-mc</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-bootstrap-impl-mc</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-bootstrap-spi</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-bootstrap-spi-as</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-mc</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-bootstrap-spi-mc</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
<groupId>org.jboss.jpa</groupId>
<artifactId>jboss-jpa-deployers</artifactId>
<mapping>
@@ -1488,9 +1523,29 @@
</dependency>
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-impl-as</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-base</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-impl-mc</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap-spi-mc</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-client</artifactId>
</dependency>
Modified: branches/dml-log-service-integration/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java
===================================================================
--- branches/dml-log-service-integration/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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;
@@ -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
Modified: branches/dml-log-service-integration/varia/pom.xml
===================================================================
--- branches/dml-log-service-integration/varia/pom.xml 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/pom.xml 2009-06-26 21:47:23 UTC (rev 90659)
@@ -180,7 +180,7 @@
<!-- Compile (global dependencies) -->
<dependency>
<groupId>org.jboss.bootstrap</groupId>
- <artifactId>jboss-bootstrap</artifactId>
+ <artifactId>jboss-bootstrap-spi-as</artifactId>
</dependency>
<dependency>
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/jdbc/HypersonicDatabase.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -35,7 +35,7 @@
/**
* Integration with <a href="http://sourceforge.net/projects/hsqldb">HSQLDB</a>
*
- * @author <a href="mailto:rickard.oberg at telkel.com">Rickard Öberg</a>
+ * @author <a href="mailto:rickard.oberg at telkel.com">Rickard �berg</a>
* @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
* @author <a href="mailto:pf at iprobot.com">Peter Fagerlund</a>
* @author <a href="mailto:jason at planet57.com">Jason Dillon</a>
@@ -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,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
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/SnmpAgentService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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);
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/TrapEmitter.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -30,7 +30,7 @@
import javax.management.Notification;
-import org.jboss.bootstrap.spi.ServerConfig;
+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,7 +299,7 @@
{
if (host == null || host.length() == 0) {
- String defaultBindAddress = System.getProperty(ServerConfig.SERVER_BIND_ADDRESS);
+ String defaultBindAddress = System.getProperty(JBossASServerConfig.PROP_KEY_JBOSSAS_BIND_ADDRESS);
if (defaultBindAddress != null && !defaultBindAddress.equals("0.0.0.0"))
return InetAddress.getByName(defaultBindAddress);
else
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/jmx/adaptor/snmp/trapd/TrapdService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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,7 @@
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);
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/DeploymentManager.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/DeploymentManager.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/DeploymentManager.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -546,7 +546,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);
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/LibraryManager.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/LibraryManager.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/services/deployment/LibraryManager.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -24,8 +24,9 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
+import java.net.URISyntaxException;
-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,21 @@
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 (final URISyntaxException urise)
+ {
+ throw new RuntimeException("Error in initialization", urise);
+ }
+
log.debug("Using serverLibDir: " + this.serverLibDir);
log.debug("Using serverTmpDir: " + this.serverTmpDir);
}
Modified: branches/dml-log-service-integration/varia/src/main/org/jboss/varia/property/SystemPropertiesService.java
===================================================================
--- branches/dml-log-service-integration/varia/src/main/org/jboss/varia/property/SystemPropertiesService.java 2009-06-26 20:39:55 UTC (rev 90658)
+++ branches/dml-log-service-integration/varia/src/main/org/jboss/varia/property/SystemPropertiesService.java 2009-06-26 21:47:23 UTC (rev 90659)
@@ -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);
}
More information about the jboss-cvs-commits
mailing list