modules/enterprise/server/ear/pom.xml
| 101 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
| 7
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/mbean/AlertConditionCacheMonitor.java
| 49 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
| 47 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
| 81 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/ShutdownListener.java
| 27
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
| 68 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsServiceMBean.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
| 34
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
| 49 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
| 46
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/mbean/GroupDefinitionRecalculationThreadMonitor.java
| 49 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/SchedulerService.java
| 98 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/JMXUtil.java
| 61 +
modules/enterprise/server/jar/src/main/resources/quartz.properties
| 28
modules/enterprise/server/jar/src/main/resources/server-comm-configuration-overrides.properties
| 42
modules/enterprise/server/jar/src/main/resources/server-comm-configuration.xml
| 468 ++++++++++
modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
| 96 +-
modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties
| 42
modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration.xml
| 468 ----------
modules/enterprise/server/startup-subsystem/pom.xml
| 5
modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupExtension.java
| 8
modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupSubsystemAdd.java
| 38
modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqDeploymentMarker.java
| 49 +
modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqInitializationProcessor.java
| 53 +
modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqShutdownBeanDependenciesProcessor.java
| 94 ++
modules/enterprise/server/startup-subsystem/src/main/resources/module/main/module.xml
| 1
pom.xml
| 7
28 files changed, 1279 insertions(+), 845 deletions(-)
New commits:
commit adedcb46e352d6fb08a43352447b748b9459c899
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jun 6 22:56:11 2013 +0200
Bug 957689 - Unable to complete tasks when server is shutdown
Inject the NoTxRHQDS as a @Resource in the ShutdownListener
Convert SAR services into @Singleton beans
Tweak RHQ EAR deployment with a set of DeploymentUnitProcessor classes
EAR modules now deployed in order
RHQ Startup Subsystem installs a DUP which make the ShutdownListener bean
automatically depend on all other session beans.
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index ff4c171..a0e00f6 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -243,53 +243,15 @@
<filtering>true</filtering>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
<unpackTypes>war,ejb</unpackTypes>
+ <initializeInOrder>true</initializeInOrder>
<modules>
- <!-- ** WARs -->
- <webModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-coregui</artifactId>
- <bundleFileName>coregui.war</bundleFileName>
- <contextRoot>/coregui</contextRoot>
- </webModule>
-
- <webModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-portal</artifactId>
- <bundleFileName>rhq-portal.war</bundleFileName>
- <contextRoot>/</contextRoot>
- </webModule>
-
- <!-- used to expose content through http -->
- <webModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-content_http</artifactId>
- <excluded>${exclude-content_http}</excluded>
-
<bundleFileName>rhq-content_http.war</bundleFileName>
- <contextRoot>/content</contextRoot>
- </webModule>
-
- <webModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-rest</artifactId>
- <bundleFileName>rhq-rest.war</bundleFileName>
- <contextRoot>/rest</contextRoot>
- </webModule>
-
- <webModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-rest-examples</artifactId>
-
<bundleFileName>rhq-rest-examples.war</bundleFileName>
- <contextRoot>/rest-examples</contextRoot>
- </webModule>
-
- <webModule>
+ <!-- ** EJB-JARs -->
+ <ejbModule>
<groupId>${project.groupId}</groupId>
- <artifactId>rhq-remoting-war</artifactId>
-
<bundleFileName>rhq-remoting.war</bundleFileName>
-
<contextRoot>/jboss-remoting-servlet-invoker</contextRoot>
- </webModule>
+ <artifactId>rhq-core-domain</artifactId>
+
<bundleFileName>rhq-core-domain-ejb3.jar</bundleFileName>
+ </ejbModule>
- <!-- ** EJB-JARs -->
<ejbModule>
<groupId>${project.groupId}</groupId>
<artifactId>rhq-enterprise-server</artifactId>
@@ -302,12 +264,6 @@
<excluded>true</excluded>
</ejbClientModule>
- <ejbModule>
- <groupId>${project.groupId}</groupId>
- <artifactId>rhq-core-domain</artifactId>
-
<bundleFileName>rhq-core-domain-ejb3.jar</bundleFileName>
- </ejbModule>
-
<!-- ** SARs -->
<!-- AS7 allows for SARs embedded in an EAR without anything
in application.xml -->
@@ -339,6 +295,51 @@
<includeInApplicationXml>false</includeInApplicationXml>
</jarModule>
+ <!-- ** WARs -->
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-coregui</artifactId>
+ <bundleFileName>coregui.war</bundleFileName>
+ <contextRoot>/coregui</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-portal</artifactId>
+ <bundleFileName>rhq-portal.war</bundleFileName>
+ <contextRoot>/</contextRoot>
+ </webModule>
+
+ <!-- used to expose content through http -->
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-content_http</artifactId>
+ <excluded>${exclude-content_http}</excluded>
+
<bundleFileName>rhq-content_http.war</bundleFileName>
+ <contextRoot>/content</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-rest</artifactId>
+ <bundleFileName>rhq-rest.war</bundleFileName>
+ <contextRoot>/rest</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-rest-examples</artifactId>
+
<bundleFileName>rhq-rest-examples.war</bundleFileName>
+ <contextRoot>/rest-examples</contextRoot>
+ </webModule>
+
+ <webModule>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>rhq-remoting-war</artifactId>
+
<bundleFileName>rhq-remoting.war</bundleFileName>
+
<contextRoot>/jboss-remoting-servlet-invoker</contextRoot>
+ </webModule>
+
</modules>
</configuration>
</plugin>
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
index ca8dda4..e1cd145 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server;
@@ -31,6 +31,7 @@ public class RHQConstants {
public static final String EAR_FILE_NAME = EAR_NAME + ".ear";
public static final String ENTITY_MANAGER_JNDI_NAME =
"java:jboss/RHQEntityManagerFactory";
public static final String DATASOURCE_JNDI_NAME =
"java:jboss/datasources/RHQDS";
+ public static final String NO_TX_DATASOURCE_JNDI_NAME =
"java:jboss/datasources/NoTxRHQDS";
public static final String PERSISTENCE_UNIT_NAME = "rhqpu";
public static final String TRANSACTION_MANAGER_JNDI_NAME =
"java:jboss/TransactionManager";
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/mbean/AlertConditionCacheMonitor.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/mbean/AlertConditionCacheMonitor.java
index 812e2a6..069e002 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/mbean/AlertConditionCacheMonitor.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/mbean/AlertConditionCacheMonitor.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,21 +13,32 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
package org.rhq.enterprise.server.alert.engine.mbean;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-import javax.management.MBeanRegistration;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
+import org.rhq.core.util.ObjectNameFactory;
import org.rhq.enterprise.server.alert.engine.internal.AlertConditionCacheCoordinator;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -35,7 +46,13 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author Joseph Marques
*/
-public class AlertConditionCacheMonitor implements AlertConditionCacheMonitorMBean,
MBeanRegistration {
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class AlertConditionCacheMonitor implements AlertConditionCacheMonitorMBean {
+ private static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("rhq:service=AlertConditionCacheMonitor");
public AtomicInteger availabilityCacheElementMatches = new AtomicInteger();
public AtomicInteger availabilityDurationCacheElementMatches = new AtomicInteger();
@@ -286,20 +303,18 @@ public class AlertConditionCacheMonitor implements
AlertConditionCacheMonitorMBe
LookupUtil.getAlertConditionCacheManager().reloadAllCaches();
}
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- objectName = name;
- mbeanServer = server;
- return name;
- }
-
- public void postRegister(Boolean registrationDone) {
- }
-
- public void preDeregister() throws Exception {
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+ mbeanServer = JMXUtil.getPlatformMBeanServer();
+ objectName = OBJECT_NAME;
}
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
mbeanServer = null;
+ objectName = null;
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
index b74b704..edeb264 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServer.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,22 +13,29 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.management.ManagementFactory;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Date;
import java.util.HashMap;
import java.util.Properties;
-import javax.management.MBeanServer;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.management.ObjectName;
import org.apache.commons.logging.Log;
@@ -41,15 +48,21 @@ import org.rhq.core.domain.common.ProductInfo;
import org.rhq.core.util.ObjectNameFactory;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.core.service.ManagementService;
+import org.rhq.enterprise.server.util.JMXUtil;
/**
* Get information about RHQ's underlying AS Server.
*/
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class CoreServer implements CoreServerMBean {
private static final String PRODUCT_INFO_PROPERTIES_RESOURCE_PATH =
"org/rhq/enterprise/server/core/ProductInfo.properties";
- private final Log log = LogFactory.getLog(CoreServer.class);
+ private static final Log LOG = LogFactory.getLog(CoreServer.class);
/**
* The name of the version file as found in this class's classloader
@@ -93,7 +106,10 @@ public class CoreServer implements CoreServerMBean {
private Date bootTime;
- protected void start() throws Exception {
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+
this.buildProps = loadBuildProperties();
this.bootTime = new Date();
@@ -101,7 +117,12 @@ public class CoreServer implements CoreServerMBean {
String version = getVersion();
String buildNumber = getBuildNumber();
String buildDate = this.buildProps.getProperty(PROP_BUILD_DATE, "?");
- log.info("Version=[" + version + "], Build Number=[" +
buildNumber + "], Build Date=[" + buildDate + "]");
+ LOG.info("Version=[" + version + "], Build Number=[" +
buildNumber + "], Build Date=[" + buildDate + "]");
+ }
+
+ @PreDestroy
+ private void destroy() {
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
}
public String getName() {
@@ -220,16 +241,10 @@ public class CoreServer implements CoreServerMBean {
}
}
- private MBeanServer getMBeanServer() {
- MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
- return mbs;
- }
-
private String getServerEnvironmentAttribute(String attributeName) {
try {
- MBeanServer mbs = getMBeanServer();
ObjectName name =
ObjectNameFactory.create("jboss.as:core-service=server-environment");
- Object value = mbs.getAttribute(name, attributeName);
+ Object value = JMXUtil.getPlatformMBeanServer().getAttribute(name,
attributeName);
return (value != null) ? value.toString() : null;
} catch (Exception e) {
throw new RuntimeException(e);
@@ -247,7 +262,7 @@ public class CoreServer implements CoreServerMBean {
stream.close();
}
} catch (Exception e) {
- log.fatal("Failed to load [" + VERSION_FILE + "] via class
loader [" + classLoader + "]");
+ LOG.fatal("Failed to load [" + VERSION_FILE + "] via class
loader [" + classLoader + "]");
}
return buildProps;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
index 73eeca5..5025044 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CustomJaasDeploymentService.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core;
@@ -24,9 +24,15 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.naming.AuthenticationException;
import javax.naming.Context;
import javax.naming.NamingException;
@@ -47,6 +53,7 @@ import org.rhq.enterprise.server.core.jaas.JDBCLoginModule;
import org.rhq.enterprise.server.core.jaas.JDBCPrincipalCheckLoginModule;
import org.rhq.enterprise.server.core.jaas.LdapLoginModule;
import org.rhq.enterprise.server.core.service.ManagementService;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
@@ -54,27 +61,26 @@ import
org.rhq.enterprise.server.util.security.UntrustedSSLSocketFactory;
* Deploy the JAAS login modules that are configured. The JDBC login module is always
deployed, however, the LDAP login
* module is only deployed if LDAP is enabled in the RHQ configuration.
*/
-public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceMBean,
MBeanRegistration {
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class CustomJaasDeploymentService implements CustomJaasDeploymentServiceMBean {
- private Log log = LogFactory.getLog(CustomJaasDeploymentService.class.getName());
-
- /**
- * Constructor for {@link CustomJaasDeploymentService}.
- */
- public CustomJaasDeploymentService() {
- }
+ private static final Log LOG =
LogFactory.getLog(CustomJaasDeploymentService.class.getName());
/**
* @see
org.rhq.enterprise.server.core.CustomJaasDeploymentServiceMBean#installJaasModules()
*/
public void installJaasModules() {
try {
- log.info("Updating RHQ Server's JAAS login modules");
+ LOG.info("Updating RHQ Server's JAAS login modules");
Properties systemConfig =
LookupUtil.getSystemManager().getSystemConfiguration(
LookupUtil.getSubjectManager().getOverlord());
updateJaasModules(systemConfig);
} catch (Exception e) {
- log.fatal("Error deploying JAAS login modules", e);
+ LOG.fatal("Error deploying JAAS login modules", e);
throw new RuntimeException(e);
}
}
@@ -99,40 +105,25 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
if (!ldapModulesPresent) {
- log.info("Updating RHQ Server's JAAS login modules with LDAP
support");
+ LOG.info("Updating RHQ Server's JAAS login modules with LDAP
support");
updateJaasModules(systemConfig);
}
}
} catch (Exception e) {
- log.fatal("Error deploying JAAS login modules", e);
+ LOG.fatal("Error deploying JAAS login modules", e);
throw new RuntimeException(e);
}
}
- /**
- * @see
javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer,javax.management.ObjectName)
- */
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- return name;
- }
-
- /**
- * @see javax.management.MBeanRegistration#postRegister(java.lang.Boolean)
- */
- public void postRegister(Boolean registrationDone) {
- }
-
- /**
- * @see javax.management.MBeanRegistration#preDeregister()
- */
- public void preDeregister() {
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
}
- /**
- * @see javax.management.MBeanRegistration#postDeregister()
- */
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
}
/**
@@ -150,7 +141,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
final SecurityDomainJBossASClient client = new
SecurityDomainJBossASClient(mcc);
if (client.isSecurityDomain(RHQ_USER_SECURITY_DOMAIN)) {
- log.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN +
"] already exists, it will be replaced.");
+ LOG.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN +
"] already exists, it will be replaced.");
}
List<LoginModuleRequest> loginModules = new
ArrayList<LoginModuleRequest>(3);
@@ -188,7 +179,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
descriptiveMessage = "Problems encountered when
communicating with LDAP server."
+ " Contact the Administrator:" + e;
}
- this.log.error(descriptiveMessage, e);
+ this.LOG.error(descriptiveMessage, e);
}
// Enable the login module even if the LDAP properties have issues
@@ -200,7 +191,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
client.createNewSecurityDomain(RHQ_USER_SECURITY_DOMAIN,
loginModules.toArray(new LoginModuleRequest[loginModules.size()]));
client.flushSecurityDomainCache("RHQRESTSecurityDomain");
- log.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN + "]
re-created with login modules " + loginModules);
+ LOG.info("Security domain [" + RHQ_USER_SECURITY_DOMAIN + "]
re-created with login modules " + loginModules);
} catch (Exception e) {
throw new Exception("Error registering RHQ JAAS modules", e);
@@ -278,7 +269,7 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
try {
bindPW = Obfuscator.decode(bindPW);
} catch (Exception e) {
- log.debug("Failed to decode bindPW, binding using undecoded value
[" + bindPW + "]", e);
+ LOG.debug("Failed to decode bindPW, binding using undecoded value
[" + bindPW + "]", e);
}
if ((bindDN != null) && (bindDN.length() != 0) && (bindPW !=
null) && (bindPW.length() != 0)) {
env.setProperty(Context.SECURITY_PRINCIPAL, bindDN);
@@ -286,9 +277,9 @@ public class CustomJaasDeploymentService implements
CustomJaasDeploymentServiceM
env.setProperty(Context.SECURITY_AUTHENTICATION, "simple");
}
- log.debug("Validating LDAP properties. Initializing context...");
+ LOG.debug("Validating LDAP properties. Initializing context...");
new InitialLdapContext(env, null).close();
return;
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/ShutdownListener.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/ShutdownListener.java
index dd2e244..585dbaf 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/ShutdownListener.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/ShutdownListener.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core;
@@ -47,8 +47,15 @@ import org.rhq.enterprise.server.scheduler.SchedulerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
- * This listens for the RHQ server's shutdown notification and when it hears it, will
start shutting down RHQ components
- * that need to clean up.
+ * <p>This listens for the RHQ server's shutdown notification and when it hears
it, will start shutting down RHQ
+ * components that need to clean up.</p>
+ *
+ * <p>This session bean will depend on every over session bean in the deployment.
Its class name is processed by the
+ * org.rhq.enterprise.startup.deployment.RhqShutdownDependenciesProcessor which is
installed by the RHQ Startup
+ * Subsystem. This is completely AS7 specific and is a work around AS7 shutting down
session beans in parallel.</p>
+ *
+ * <p><strong>DO NOT CHANGE THIS CLASS FULLY QUALIFIED NAME</strong>
org.rhq.enterprise.server.core.ShutdownListener
+ * or make the change in the DUP accordingly.</p>
*
* @author John Mazzitelli
* @author Jay Shaughnessy
@@ -75,13 +82,17 @@ public class ShutdownListener {
@Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME)
private DataSource dataSource;
+ @Resource(name = "NoTx_RHQ_DS", mappedName =
RHQConstants.NO_TX_DATASOURCE_JNDI_NAME)
+ @SuppressWarnings("unused")
+ // Prevent the server from closing the NoTx datasource before RHQ EAR
+ // NoTxDS is used by the Quartz scheduler
+ private DataSource noTxDataSource;
+
private File shutdownTimeLogFile;
/**
* This is called when the shutdown notification is received from the JBoss server.
This gives a chance for us to
* cleanly shutdown our application in an orderly fashion.
- *
- * @see javax.management.NotificationListener#handleNotification(Notification,
Object)
*/
@PreDestroy
public void handleNotification() {
@@ -219,4 +230,4 @@ public class ShutdownListener {
}
return identity.toLowerCase().indexOf("h2") != -1;
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
index a609a55..13bd6c0 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core.comm;
@@ -35,10 +35,17 @@ import java.util.prefs.BackingStoreException;
import java.util.prefs.InvalidPreferencesFormatException;
import java.util.prefs.Preferences;
-import javax.management.MBeanRegistration;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
import mazz.i18n.Logger;
@@ -70,6 +77,7 @@ import org.rhq.enterprise.server.agentclient.AgentClient;
import org.rhq.enterprise.server.agentclient.impl.AgentClientImpl;
import org.rhq.enterprise.server.cloud.instance.ServerManagerLocal;
import org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -79,12 +87,17 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author John Mazzitelli
*/
-public class ServerCommunicationsService implements ServerCommunicationsServiceMBean,
MBeanRegistration {
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class ServerCommunicationsService implements ServerCommunicationsServiceMBean {
/**
* A log for subclasses to be able to use.
*/
- private static Logger LOG =
ServerI18NFactory.getLogger(ServerCommunicationsService.class);
+ private static final Logger LOG =
ServerI18NFactory.getLogger(ServerCommunicationsService.class);
private static final String DEFAULT_OVERRIDES_PROPERTIES_FILE =
"server-comm-configuration-overrides.properties";
@@ -158,26 +171,6 @@ public class ServerCommunicationsService implements
ServerCommunicationsServiceM
private RemoteSafeInvocationHandler m_remoteApiHandler;
/**
- * Sets up some internal state.
- *
- * @see MBeanRegistration#preRegister(MBeanServer, ObjectName)
- */
- public ObjectName preRegister(MBeanServer mbs, ObjectName name) throws Exception {
- m_mbs = mbs;
-
- return name;
- }
-
- /**
- * This method does nothing - it is a no-op.
- *
- * @see javax.management.MBeanRegistration#postRegister(java.lang.Boolean)
- */
- public void postRegister(Boolean arg0) {
- return; // NO-OP
- }
-
- /**
* Actually starts the communications services. Once this returns, agents can
communicate with the server. This
* method exists (as opposed to "start()") because we do not want these
communications services initialized until
* after we are assured the EJBs are all deployed and we are ready to begin
processing incoming agent messages.
@@ -258,21 +251,18 @@ public class ServerCommunicationsService implements
ServerCommunicationsServiceM
return m_started;
}
- /**
- * This method does nothing - it is a no-op.
- *
- * @see javax.management.MBeanRegistration#preDeregister()
- */
- public void preDeregister() throws Exception {
- return; // NO-OP
+ @PostConstruct
+ private void init() {
+ m_mbs = JMXUtil.getPlatformMBeanServer();
+ JMXUtil.registerMBean(this, OBJECT_NAME);
}
/**
* Cleans up the internal state of this service.
- *
- * @see javax.management.MBeanRegistration#postDeregister()
*/
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
m_mbs = null;
m_container = null;
m_configuration = null;
@@ -283,8 +273,6 @@ public class ServerCommunicationsService implements
ServerCommunicationsServiceM
m_knownAgents.removeAllAgents();
m_knownAgentClients.clear();
m_started = false;
-
- return;
}
@Override
@@ -1069,4 +1057,4 @@ public class ServerCommunicationsService implements
ServerCommunicationsServiceM
}
return newValue;
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsServiceMBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsServiceMBean.java
index 5d4c319..36bbf9f 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsServiceMBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsServiceMBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core.comm;
@@ -83,7 +83,7 @@ public interface ServerCommunicationsServiceMBean extends
ServiceContainerMetric
* set, then the settings specified by the configuration preferences file take effect
as-is. If this is set,
* this file is a properties file whose values will override the config file prefs.
*
- * @param overrides configuration settings file that override the configuration
preferences (may be<code>null</code>)
+ * @param overridesFile configuration settings file that override the configuration
preferences (may be<code>null</code>)
*/
void setConfigurationOverridesFile(String overridesFile);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
index 202459a..0162de7 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,14 +13,24 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.core.plugin;
import java.io.File;
import java.util.Date;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -31,6 +41,7 @@ import org.rhq.core.clientapi.descriptor.AgentPluginDescriptorUtil;
import org.rhq.core.util.MessageDigestGenerator;
import org.rhq.core.util.exception.ThrowableUtil;
import org.rhq.core.util.file.FileUtil;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorUtil;
@@ -42,6 +53,11 @@ import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorUtil;
*
* @author John Mazzitelli
*/
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class PluginDeploymentScanner implements PluginDeploymentScannerMBean {
private Log log = LogFactory.getLog(PluginDeploymentScanner.class);
@@ -333,4 +349,16 @@ public class PluginDeploymentScanner implements
PluginDeploymentScannerMBean {
return;
}
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+ setScanPeriod("${rhq.server.plugin-scan-period-ms:300000}");
+ }
+
+ @PreDestroy
+ private void destroy() {
+ stop();
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
+ }
+
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
index 3ff3a17..93feca3 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/instrumentation/MeasurementMonitor.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,24 +13,41 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.measurement.instrumentation;
import java.util.concurrent.atomic.AtomicLong;
-import javax.management.MBeanRegistration;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
+import org.rhq.core.util.ObjectNameFactory;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
* @author Greg Hinkle
*/
-public class MeasurementMonitor implements MeasurementMonitorMBean, MBeanRegistration {
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class MeasurementMonitor implements MeasurementMonitorMBean {
+ private static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("rhq:service=MeasurementMonitor");
+
private AtomicLong measurementInsertTime = new AtomicLong();
private AtomicLong measurementsInserted = new AtomicLong();
@@ -241,19 +258,17 @@ public class MeasurementMonitor implements MeasurementMonitorMBean,
MBeanRegistr
this.purgedMeasurementTraits.set(delta);
}
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- objectName = name;
- mbeanServer = server;
- return name;
- }
-
- public void postRegister(Boolean registrationDone) {
- }
-
- public void preDeregister() throws Exception {
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+ mbeanServer = JMXUtil.getPlatformMBeanServer();
+ objectName = OBJECT_NAME;
}
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
mbeanServer = null;
+ objectName = null;
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
index 2bd3b2b..a0cfe2d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,16 +13,27 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.plugin.pc;
import java.io.File;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -32,14 +43,19 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author John Mazzitelli
*/
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class ServerPluginService implements ServerPluginServiceMBean {
- private static final Log log = LogFactory.getLog(ServerPluginService.class);
+ private static final Log LOG = LogFactory.getLog(ServerPluginService.class);
private boolean started;
private MasterServerPluginContainer masterPluginContainer;
public synchronized void start() {
- log.debug("The server plugin service has been deployed (but master plugin
container will not be started yet)");
+ LOG.debug("The server plugin service has been deployed (but master plugin
container will not be started yet)");
this.started = true;
return;
}
@@ -52,7 +68,7 @@ public class ServerPluginService implements ServerPluginServiceMBean {
// only initialize if not already started; if already started/initialized, just
ignore
if (this.masterPluginContainer == null) {
- log.debug("The server plugin service is now starting the master server
plugin container");
+ LOG.debug("The server plugin service is now starting the master server
plugin container");
this.masterPluginContainer = createMasterPluginContainer();
this.masterPluginContainer.scheduleAllPluginJobs();
}
@@ -62,7 +78,7 @@ public class ServerPluginService implements ServerPluginServiceMBean {
public synchronized void stopMasterPluginContainer() {
if (this.started && (this.masterPluginContainer != null)) {
- log.info("The server plugin service is now stopping - the master plugin
container will be shutdown now");
+ LOG.info("The server plugin service is now stopping - the master plugin
container will be shutdown now");
this.masterPluginContainer.shutdown();
this.masterPluginContainer = null;
@@ -93,7 +109,7 @@ public class ServerPluginService implements ServerPluginServiceMBean {
// only initialize if not already started; if already started/initialized, just
ignore
if (this.masterPluginContainer == null) {
- log.debug("The server plugin service is now starting the master server
plugin container!");
+ LOG.debug("The server plugin service is now starting the master server
plugin container!");
this.masterPluginContainer = createMasterPluginContainer();
}
@@ -146,4 +162,16 @@ public class ServerPluginService implements ServerPluginServiceMBean
{
pc.initialize(config);
return pc;
}
-}
\ No newline at end of file
+
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+ start();
+ }
+
+ @PreDestroy
+ private void destroy() {
+ stop();
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
+ }
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/mbean/GroupDefinitionRecalculationThreadMonitor.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/mbean/GroupDefinitionRecalculationThreadMonitor.java
index ed030c2..d47f2a1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/mbean/GroupDefinitionRecalculationThreadMonitor.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/mbean/GroupDefinitionRecalculationThreadMonitor.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.resource.group.definition.mbean;
@@ -24,13 +24,23 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
-import javax.management.MBeanRegistration;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import javax.management.MBeanServer;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.group.GroupDefinition;
+import org.rhq.core.util.ObjectNameFactory;
+import org.rhq.enterprise.server.util.JMXUtil;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -39,8 +49,13 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author Joseph Marques
*/
-public class GroupDefinitionRecalculationThreadMonitor implements
GroupDefinitionRecalculationThreadMonitorMBean,
- MBeanRegistration {
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class GroupDefinitionRecalculationThreadMonitor implements
GroupDefinitionRecalculationThreadMonitorMBean {
+ private static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("rhq:service=GroupDefinitionRecalculationThreadMonitor");
/*
* synchronization policy: all private attributes of this statistics object are meant
to be read and written
@@ -106,12 +121,6 @@ public class GroupDefinitionRecalculationThreadMonitor implements
GroupDefinitio
return proxy;
}
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- objectName = name;
- mbeanServer = server;
- return name;
- }
-
public void clear() {
statistics.clear();
}
@@ -156,14 +165,18 @@ public class GroupDefinitionRecalculationThreadMonitor implements
GroupDefinitio
return results;
}
- public void postRegister(Boolean registrationDone) {
- }
-
- public void preDeregister() throws Exception {
+ @PostConstruct
+ private void init() {
+ JMXUtil.registerMBean(this, OBJECT_NAME);
+ mbeanServer = JMXUtil.getPlatformMBeanServer();
+ objectName = OBJECT_NAME;
}
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
mbeanServer = null;
+ objectName = null;
+ JMXUtil.unregisterMBeanQuietly(OBJECT_NAME);
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/SchedulerService.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/SchedulerService.java
index a550362..2a3c1ef 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/SchedulerService.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/scheduler/SchedulerService.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,20 +13,27 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.server.scheduler;
+import java.io.InputStream;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.ejb.ConcurrencyManagement;
+import javax.ejb.ConcurrencyManagementType;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -47,19 +54,22 @@ import org.quartz.spi.JobFactory;
import org.jboss.util.StringPropertyReplacer;
+import org.rhq.core.util.stream.StreamUtil;
+import org.rhq.enterprise.server.util.JMXUtil;
+
/**
* Scheduler MBean service that simply wraps the Quartz scheduler.
*/
-public class SchedulerService implements SchedulerServiceMBean, MBeanRegistration {
- // for why we need this in RHQ - see
https://issues.jboss.org/browse/AS7-5336
- static {
- java.beans.PropertyEditorManager.registerEditor(Properties.class,
- org.jboss.util.propertyeditor.PropertiesEditor.class);
- }
+@Singleton
+@Startup
+@LocalBean
+(a)ConcurrencyManagement(ConcurrencyManagementType.BEAN)
+(a)TransactionAttribute(TransactionAttributeType.SUPPORTS)
+public class SchedulerService implements SchedulerServiceMBean {
- private Log log = LogFactory.getLog(SchedulerService.class);
+ private static final Log LOG = LogFactory.getLog(SchedulerService.class);
- private String TIMEOUT_PROPERTY_NAME = "rhq.server.operation-timeout";
+ private static final String TIMEOUT_PROPERTY_NAME =
"rhq.server.operation-timeout";
/**
* The configuration properties for Quartz.
@@ -70,15 +80,11 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
private StdSchedulerFactory schedulerFactory = new StdSchedulerFactory();
private Scheduler scheduler;
- public SchedulerService() {
- }
-
public Properties getQuartzProperties() {
return quartzProperties;
}
public void setQuartzProperties(Properties quartzProps) throws SchedulerException {
- // we need to replace ${var} notations because AS7 doesn't - see
https://issues.jboss.org/browse/AS7-5343
if (quartzProps != null) {
Properties overrides = new Properties();
for (Map.Entry<Object, Object> entry : quartzProps.entrySet()) {
@@ -93,7 +99,7 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
this.quartzProperties = quartzProps;
schedulerFactory.initialize(quartzProps);
- log.info("Scheduler has a default operation timeout of [" +
getDefaultOperationTimeout() + "] seconds.");
+ LOG.info("Scheduler has a default operation timeout of [" +
getDefaultOperationTimeout() + "] seconds.");
}
public Integer getDefaultOperationTimeout() {
@@ -105,7 +111,7 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
try {
timeout = Integer.valueOf(timeoutStr);
} catch (Exception e) {
- log.warn("Invalid operation timeout value specified in the quartz
properties: " + TIMEOUT_PROPERTY_NAME
+ LOG.warn("Invalid operation timeout value specified in the quartz
properties: " + TIMEOUT_PROPERTY_NAME
+ "=" + timeoutStr);
}
}
@@ -116,16 +122,16 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
public void initQuartzScheduler() throws SchedulerException {
if (scheduler == null) {
// TODO: if we are running in a server cluster, make sure we are using
Quartz's clustering capability
- log.debug("Scheduler service will initialize Quartz scheduler
now.");
+ LOG.debug("Scheduler service will initialize Quartz scheduler
now.");
scheduler = schedulerFactory.getScheduler();
} else {
- log.debug("Quartz scheduler is initialized and can be started");
+ LOG.debug("Quartz scheduler is initialized and can be started");
}
}
public void startQuartzScheduler() throws SchedulerException {
initQuartzScheduler();
- log.info("Scheduler service will start Quartz scheduler now - jobs will
begin executing.");
+ LOG.info("Scheduler service will start Quartz scheduler now - jobs will
begin executing.");
scheduler.start();
return;
@@ -138,7 +144,7 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
*/
public synchronized void stop() throws SchedulerException {
if ((scheduler != null) && !scheduler.isShutdown()) {
- log.info("Stopping " + scheduler);
+ LOG.info("Stopping " + scheduler);
shutdown();
scheduler = null;
}
@@ -165,7 +171,7 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
}
public void start() {
- log.debug("Scheduler Service has started - however, Quartz is not going to
be starting yet");
+ LOG.debug("Scheduler Service has started - however, Quartz is not going to
be starting yet");
}
/**
@@ -374,30 +380,28 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
return scheduler.getSchedulerListeners();
}
- public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
{
- return name;
- }
-
- public void postRegister(Boolean registrationDone) {
- }
-
- /**
- * Ensures that the Quartz scheduler is shutdown.
- *
- * @see javax.management.MBeanRegistration#preDeregister()
- */
- public void preDeregister() throws Exception {
- if (scheduler != null) {
- shutdown();
+ @PostConstruct
+ private void init() {
+ Properties properties = new Properties();
+ InputStream propertiesStream =
getClass().getClassLoader().getResourceAsStream("quartz.properties");
+ try {
+ properties.load(propertiesStream);
+ setQuartzProperties(properties);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ StreamUtil.safeClose(propertiesStream);
}
+ JMXUtil.registerMBean(this, SCHEDULER_MBEAN_NAME);
}
- /**
- * Delegates to the Quartz scheduler.
- *
- * @see javax.management.MBeanRegistration#postDeregister()
- */
- public void postDeregister() {
+ @PreDestroy
+ private void destroy() {
+ try {
+ stop();
+ } catch (SchedulerException ignore) {
+ }
+ JMXUtil.unregisterMBeanQuietly(SCHEDULER_MBEAN_NAME);
}
// Quartz methods that are new in 1.5.1 that were not in 1.0.7
@@ -475,4 +479,4 @@ public class SchedulerService implements SchedulerServiceMBean,
MBeanRegistratio
public void startDelayed(int delay) throws SchedulerException {
scheduler.startDelayed(delay);
}
-}
\ No newline at end of file
+}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/JMXUtil.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/JMXUtil.java
new file mode 100644
index 0000000..6404b40
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/JMXUtil.java
@@ -0,0 +1,61 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+package org.rhq.enterprise.server.util;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Thomas Segismont
+ */
+public class JMXUtil {
+
+ private static final Log LOG = LogFactory.getLog(JMXUtil.class);
+
+ private JMXUtil() {
+ // Defensive
+ }
+
+ public static void registerMBean(Object bean, ObjectName objectName) {
+ try {
+ getPlatformMBeanServer().registerMBean(bean, objectName);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public static void unregisterMBeanQuietly(ObjectName objectName) {
+ try {
+ getPlatformMBeanServer().unregisterMBean(objectName);
+ } catch (Exception e) {
+ LOG.error("Exception on " + objectName + " unregister",
e);
+ }
+ }
+
+ public static MBeanServer getPlatformMBeanServer() {
+ return ManagementFactory.getPlatformMBeanServer();
+ }
+
+}
diff --git a/modules/enterprise/server/jar/src/main/resources/quartz.properties
b/modules/enterprise/server/jar/src/main/resources/quartz.properties
new file mode 100644
index 0000000..4b1b904
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/resources/quartz.properties
@@ -0,0 +1,28 @@
+# RHQ custom property that defines the default timeout for all operations.
+# This is specified in seconds. If any operation takes longer than this, it is assumed
to have failed.
+rhq.server.operation-timeout = ${rhq.server.operation-timeout:600}
+
+# scheduler factory config
+org.quartz.scheduler.instanceName = RHQScheduler
+org.quartz.scheduler.instanceId = AUTO
+
+# thread pool config
+org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
+org.quartz.threadPool.threadCount = 5
+
+# database config
+# note that the delegate class property should be set at build/installation time
+org.quartz.jobStore.class =
org.quartz.impl.jdbcjobstore.JobStoreCMT
+org.quartz.jobStore.driverDelegateClass =
${rhq.server.quartz.driverDelegateClass}
+org.quartz.jobStore.isClustered = true
+org.quartz.jobStore.clusterCheckinInterval = 30000
+org.quartz.jobStore.tablePrefix = RHQ_QRTZ_
+org.quartz.jobStore.useProperties = true
+org.quartz.jobStore.selectWithLockSQL = ${rhq.server.quartz.selectWithLockSQL}
+org.quartz.jobStore.dataSource = RHQDS
+org.quartz.dataSource.RHQDS.jndiURL = java:jboss/datasources/RHQDS
+org.quartz.dataSource.RHQDS.maxConnections = 10
+org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.jndiURL = java:jboss/datasources/NoTxRHQDS
+org.quartz.dataSource.NoTxRHQDS.maxConnections = 10
+org.quartz.jobStore.lockHandler.class = ${rhq.server.quartz.lockHandlerClass}
diff --git
a/modules/enterprise/server/jar/src/main/resources/server-comm-configuration-overrides.properties
b/modules/enterprise/server/jar/src/main/resources/server-comm-configuration-overrides.properties
new file mode 100644
index 0000000..91ccc85
--- /dev/null
+++
b/modules/enterprise/server/jar/src/main/resources/server-comm-configuration-overrides.properties
@@ -0,0 +1,42 @@
+# location of the plugin jars and other files agents can download directly from sever
+rhq.server.agent-files-directory=${rhq.server.home}/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads
+# location where data files can be stored
+rhq.communications.data-directory=${jboss.server.data.dir}
+# global limit on number of concurrent incoming messages allowed
+rhq.communications.global-concurrency-limit=${rhq.communications.global-concurrency-limit:200}
+# Server's remote endpoint for agents to talk to
+rhq.communications.connector.transport=${rhq.communications.connector.transport:servlet}
+rhq.communications.connector.bind-address=${rhq.communications.connector.bind-address}
+rhq.communications.connector.bind-port=${rhq.communications.connector.bind-port:7080}
+rhq.communications.connector.transport-params=${rhq.communications.connector.transport-params:/jboss-remoting-servlet-invoker/ServerInvokerServlet}
+# Multicast detector configuration for auto-discovery
+rhq.communications.multicast-detector.enabled=${rhq.communications.multicast-detector.enabled:false}
+rhq.communications.multicast-detector.multicast-address=${rhq.communications.multicast-detector.multicast-address:224.16.16.16}
+rhq.communications.multicast-detector.bind-address=${rhq.communications.multicast-detector.bind-address}
+rhq.communications.multicast-detector.port=${rhq.communications.multicast-detector.port:16162}
+# Server-side SSL Security Configuration (for incoming messages from agents)
+rhq.communications.connector.security.secure-socket-protocol=${rhq.communications.connector.security.secure-socket-protocol:TLS}
+rhq.communications.connector.security.keystore.file=${rhq.communications.connector.security.keystore.file}
+rhq.communications.connector.security.keystore.algorithm=${rhq.communications.connector.security.keystore.algorithm}
+rhq.communications.connector.security.keystore.type=${rhq.communications.connector.security.keystore.type:JKS}
+rhq.communications.connector.security.keystore.password=${rhq.communications.connector.security.keystore.password:rhqpwd}
+rhq.communications.connector.security.keystore.key-password=${rhq.communications.connector.security.keystore.key-password:rhqpwd}
+rhq.communications.connector.security.keystore.alias=${rhq.communications.connector.security.keystore.alias:rhq}
+rhq.communications.connector.security.truststore.file=${rhq.communications.connector.security.truststore.file}
+rhq.communications.connector.security.truststore.algorithm=${rhq.communications.connector.security.truststore.algorithm}
+rhq.communications.connector.security.truststore.type=${rhq.communications.connector.security.truststore.type:JKS}
+rhq.communications.connector.security.truststore.password=${rhq.communications.connector.security.truststore.password}
+rhq.communications.connector.security.client-auth-mode=${rhq.communications.connector.security.client-auth-mode:none}
+# Client-side SSL Security Configuration (for outgoing messages to agents)
+rhq.server.client.security.secure-socket-protocol=${rhq.server.client.security.secure-socket-protocol:TLS}
+rhq.server.client.security.keystore.file=${rhq.server.client.security.keystore.file}
+rhq.server.client.security.keystore.algorithm=${rhq.server.client.security.keystore.algorithm}
+rhq.server.client.security.keystore.type=${rhq.server.client.security.keystore.type:JKS}
+rhq.server.client.security.keystore.password=${rhq.server.client.security.keystore.password:rhqpwd}
+rhq.server.client.security.keystore.key-password=${rhq.server.client.security.keystore.key-password:rhqpwd}
+rhq.server.client.security.keystore.alias=${rhq.server.client.security.keystore.alias:rhq}
+rhq.server.client.security.truststore.file=${rhq.server.client.security.truststore.file}
+rhq.server.client.security.truststore.algorithm=${rhq.server.client.security.truststore.algorithm}
+rhq.server.client.security.truststore.type=${rhq.server.client.security.truststore.type:JKS}
+rhq.server.client.security.truststore.password=${rhq.server.client.security.truststore.password}
+rhq.server.client.security.server-auth-mode-enabled=${rhq.server.client.security.server-auth-mode-enabled:false}
diff --git
a/modules/enterprise/server/jar/src/main/resources/server-comm-configuration.xml
b/modules/enterprise/server/jar/src/main/resources/server-comm-configuration.xml
new file mode 100644
index 0000000..7f30276
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/resources/server-comm-configuration.xml
@@ -0,0 +1,468 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
+
+<!--
+==============================================================================
+RHQ Server Communications Configuration
+==============================================================================
+-->
+
+<preferences EXTERNAL_XML_VERSION="1.0">
+ <root type="user">
+ <map />
+ <node name="rhq-server">
+ <map />
+ <node name="default">
+ <map>
+ <!--
+ _______________________________________________________________
+ rhq.server.configuration-schema-version
+
+ Defines what version of the server configuration schema this
+ file conforms to. This is the schema for the rhq.server
+ preferences.
+ -->
+ <entry key="rhq.server.configuration-schema-version"
value="1" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.agent-files-directory
+
+ This defines the directory location that contains all the files
+ that can be sent remotely to agents. If this is not defined,
+ this effectively disables the server's ability to remotely
+ send files to agents. If deploying within a JBossAS instance,
+ leave this undefined, and set this as a configuration override
+ property in the server-comm-service.xml
+ deployment configuration file. This will allow you to use the
+ ${jboss.server.home.dir} replacement variable expression
+ as part of the directory location, for example.
+ -->
+ <!--
+ <entry key="rhq.server.agent-files-directory"
value="conf" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.queue-size
+
+ The maximum size of the client command queue - this is the
+ maximum number of commands that can be queued for sending to
+ an agent. If this is 0, then the queue is unbounded.
+ WARNING! Setting this to 0 could lead to resources being used
+ up if for some reason commands keep getting queued but are
+ not getting sent.
+ -->
+ <entry key="rhq.server.client.queue-size"
value="50000" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.max-concurrent
+
+ The maximum number of concurrent commands that can be in the
+ process of being sent to an agent at any one time.
+ -->
+ <entry key="rhq.server.client.max-concurrent"
value="1" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.command-timeout-msecs
+
+ The time in milliseconds that the client sender will wait
+ before aborting a command. This is the amount of time in
+ milliseconds that the agent has in order to process commands.
+ This value is only the default if a command has not specified
+ its own timeout. A command can override this by setting its
+ own timeout in the command's configuration, so this value may
+ not be used for all commands that are sent. If this value is
+ less than or equal to 0, there will be no default timeout
+ and commands will therefore be allowed to take as long as they
+ need (again, this is the default, individual commands may
+ override this and set their own timeout). While this infinite
+ timeout default could conceivably cause a thread to hang
+ waiting for a rogue command that never finishes, it also reduces
+ the amount of short-lived threads created by the system
+ and will increase throughput, dramatically in some cases.
+ -->
+ <entry key="rhq.server.client.command-timeout-msecs"
value="600000" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.retry-interval-msecs
+
+ This is the minimum amount of time, in milliseconds, the client
+ sender will wait before trying to resend a guaranteed command
+ that previously failed. This is not a guarantee of when
+ a command is retried - all that can be inferred is that a
+ command that fails to be sent will not be retried until at
+ least this amount of time passes.
+ Note: if the sender is currently waiting in this retry pause
+ period, the server will not be able to be shutdown until that
+ retry period is over. In other words, if the server is asked
+ to shutdown, it will wait for those commands waiting in this
+ retry interval to wake up. This is to help ensure those
+ commands are not lost.
+ -->
+ <entry key="rhq.server.client.retry-interval-msecs"
value="15000" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.max-retries
+
+ If a guaranteed delivery message is sent, but the server fails
+ to connect to the agent and deliver the message, it will
+ always be retried. However, if the error was something other
+ than a "cannot connect" error, the command will only be retried
+ this amount of times before the command is dropped. When this
+ happens, the guaranteed command will never be delivered. This
+ will normally happen under very odd and rare circumstances.
+ Also, this setting only effects asynchronous messages that
+ are sent with guaranteed delivery. This setting has no effect
+ on other messages.
+ -->
+ <entry key="rhq.server.client.max-retries"
value="10" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.command-spool-file.name
+
+ This defines the name of the command spool file. This
+ file must be located in the data directory (if one does not
+ exist, it will be created). Note that if you do not define
+ this setting, the default is to not spool commands to disk
+ and thus implicitly disable guaranteed delivery.
+ -->
+ <!--
+ <entry key="rhq.server.client.command-spool-file.name"
value="command-spool.dat" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.command-spool-file.params
+
+ This defines the parameters for the command spool file.
+ The spool file is where the server persists commands that
+ are flagged for guaranteed delivery and need to be sent.
+ The format is defined as "max-file-size:purge-percentage".
+ The first number is the size, in bytes, of the maximum file
+ size threshold. If the spool file grows larger than this, a
+ "purge" will be triggered in order to shrink the file.
+ The second number is the purge percentage which indicates how
+ large the file is allowed to be after a purge. This is
+ specified as a percentage of the first parameter - the max
+ file size threshold. For example, if the max file size is
+ 100000 (i.e. 100KB) and the purge percentage is 90, then when
+ the spool file grows larger than 100KB, a purge will be
+ triggered and the file will be shrunk to no more than
+ 90% of 100KB - which is 90KB. In effect, 10KB will be freed
+ to allow room for new commands to be spooled. When this
+ occurs, unused space is freed first and if that does not
+ free up enough space, the oldest commands in the spool file
+ will be sacrificed in order to make room for the newer
+ commands.
+ -->
+ <entry key="rhq.server.client.command-spool-file.params"
value="1000000:75" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.command-spool-file.compressed
+
+ If this flag is true, the commands stored in the spool file
+ will be compressed. This can potentially save about 30%-40% in
+ disk space (give or take), however, it slows down the
+ persistence mechanism considerably. Recommended setting for
+ this should be false unless something on the server deployment
+ box warrants disk-saving over persistence performance.
+ -->
+ <entry key="rhq.server.client.command-spool-file.compressed"
value="false" />
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.send-throttling
+
+ If this setting is defined, it will enable send throttling to
+ occur while sending commands to an agent. The format is
+ defined as "max-commands:quiet-period-milliseconds"
+ where the maximum commands defines the maximum number
+ of commands that will be sent before the start of a quiet
+ period. The quiet period defines the number of milliseconds
+ in which no commands should be sent. After this duration
+ expires, commands can again be sent, up to the maximum defined.
+ Note that send throttling only affects those commands that
+ are "throttle-able". Some commands are sent as soon as
+ possible, regardless of the throttling settings.
+
+ This affects sending commands synchronously and asynchronously.
+ -->
+ <!--
+ <entry key="rhq.server.client.send-throttling"
value="100:1000" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.server.client.queue-throttling
+
+ If this setting is defined, it will enable queue throttling to
+ occur while sending commands to an agent. The format is
+ defined as "max-commands-per-burst:burst-period-milliseconds"
+ where the maximum commands per burst defines the maximum number
+ of commands that can be dequeued within a burst period. The
+ burst period defines the number of milliseconds in which the
+ defined maximum number of commands can be dequeued. If more
+ than the maximum number of commands are queued within this
+ time period, they will wait until the next burst period starts
+ before being able to be dequeued.
+
+ This does not affect sending commands synchronously. It only
+ effects commands queued to be sent asynchronously.
+ -->
+ <!--
+ <entry key="rhq.server.client.queue-throttling"
value="50:3000" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.configuration-schema-version
+
+ Defines what version of the configuration schema this
+ file conforms to. This is the schema for the
+ rhq.communications preferences.
+ -->
+ <entry key="rhq.communications.configuration-schema-version"
value="1" />
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.service-container.mbean-server-name
+
+ Name of the MBean Server that houses the communications MBean
+ services. This is actually the default domain name of the
+ MBean Server and if an MBean Server has already been registered
+ with this name, it will be used to house the communications
+ services. If an MBean Server has not yet been registered with
+ this name as its default domain, one will be created.
+ If deploying within a JBossAS instance, the JBoss MBeanServer
+ will be used, so this value can be left undefined since it
+ will be unused.
+ -->
+ <!--
+ <entry
key="rhq.communications.service-container.mbean-server-name"
value="jboss-on" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.data-directory
+
+ The location where the communication services write internal
+ data files. If deploying within a JBossAS instance, leave
+ this undefined, and set this as a configuration override
+ property in the server-comm-service.xml deployment
+ configuration file. This will allow you to use the
+ ${jboss.server.data.dir} replacement variable as the data
+ directory location.
+ -->
+ <!--
+ <entry key="rhq.communications.data-directory"
value="data" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.global-concurrency-limit
+
+ The maximum number of incoming commands that are allowed to be
+ received concurrently. Any extra commands received over this
+ amount will be dropped and the client will be asked to
+ resend it later.
+ -->
+ <entry key="rhq.communications.global-concurrency-limit"
value="200" />
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.multicast-detector.enabled
+ rhq.communications.multicast-detector.multicast-address
+ rhq.communications.multicast-detector.bind-address
+ rhq.communications.multicast-detector.port
+ rhq.communications.multicast-detector.default-time-delay
+ rhq.communications.multicast-detector.heartbeat-time-delay
+
+ The multicast detector configuration. This is the service that
+ listens for new remote servers/agents coming on and going offline
+ and is required if you want agent auto-detection. If you do not
+ have auto-detection enabled or your network will not
+ support multicast traffic, you should disable the multicast
+ detector.
+
+ The multicast-address is used to broadcast detection messages.
+ To be more specific, it is the IP address of the
+ multicast group the detector will join. The bind-address
+ is the IP that is bound by the network interface.
+
+ The detector will send heartbeat messages every X milliseconds
+ (this is the heartbeat-time-delay). If external servers'
+ detectors do not send their heartbeat messages within the
+ default-time-delay, our detector will assume that external
+ server has gone down. These settings affect the timeliness
+ of our auto-detection mechanism.
+ -->
+ <entry key="rhq.communications.multicast-detector.enabled"
value="false" />
+ <entry
key="rhq.communications.multicast-detector.multicast-address"
value="224.16.16.16" />
+ <entry
key="rhq.communications.multicast-detector.bind-address"
value="0.0.0.0" />
+ <entry key="rhq.communications.multicast-detector.port"
value="16162" />
+ <entry
key="rhq.communications.multicast-detector.default-time-delay"
value="5000" />
+ <entry
key="rhq.communications.multicast-detector.heartbeat-time-delay"
value="1000" />
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.connector.rhqtype
+ rhq.communications.connector.transport
+ rhq.communications.connector.bind-port
+ rhq.communications.connector.bind-address
+ rhq.communications.connector.transport-params
+ rhq.communications.connector.lease-period
+
+ The server connector configuration. This is the service that
+ listens for incoming agent requests and passes them to the
+ appropriate server-side components for processing. See the
+ JBoss/Remoting documentation for a full list of options
+ that can be specified. Note that because this is an XML file,
+ you must specify "&" in the transport-params value
+ when needing an ampersand to separate the parameters.
+ -->
+ <entry key="rhq.communications.connector.rhqtype"
value="server" />
+ <entry key="rhq.communications.connector.transport"
value="servlet" />
+ <entry key="rhq.communications.connector.bind-port"
value="7080" />
+ <entry key="rhq.communications.connector.transport-params"
value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
+ <!--
+ <entry key="rhq.communications.connector.bind-address"
value="127.0.0.1" />
+ <entry key="rhq.communications.connector.lease-period"
value="5000" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.connector.security.secure-socket-protocol
+ rhq.communications.connector.security.keystore.file
+ rhq.communications.connector.security.keystore.algorithm
+ rhq.communications.connector.security.keystore.type
+ rhq.communications.connector.security.keystore.password
+ rhq.communications.connector.security.keystore.key-password
+ rhq.communications.connector.security.keystore.alias
+ rhq.communications.connector.security.truststore.file
+ rhq.communications.connector.security.truststore.algorithm
+ rhq.communications.connector.security.truststore.type
+ rhq.communications.connector.security.truststore.password
+ rhq.communications.connector.security.client-auth-mode
+
+ rhq.server.client.security.secure-socket-protocol
+ rhq.server.client.security.keystore.file
+ rhq.server.client.security.keystore.algorithm
+ rhq.server.client.security.keystore.type
+ rhq.server.client.security.keystore.password
+ rhq.server.client.security.keystore.key-password
+ rhq.server.client.security.keystore.alias
+ rhq.server.client.security.truststore.file
+ rhq.server.client.security.truststore.algorithm
+ rhq.server.client.security.truststore.type
+ rhq.server.client.security.truststore.password
+ rhq.server.client.security.server-auth-mode-enabled
+
+ These are the settings that are used if SSL is to be used for
+ either the server or client communications. These can be left
+ unset since the defaults will normally suffice. These
+ properties are here just in case some use case occurs that
+ require one or more of these settings to be customized.
+
+ Note that if client-auth-mode is specified, it must be one of:
+ "none", "want", "need". To support Tomcat
syntax, "true" can be used
+ in place of "need" and "false" can be used in place of
"none".
+ -->
+ <!--
+ <entry
key="rhq.communications.connector.security.secure-socket-protocol"
value="TLS" />
+ <entry
key="rhq.communications.connector.security.keystore.file"
value="data/keystore.dat" />
+ <entry
key="rhq.communications.connector.security.keystore.algorithm"
value="SunX509" />
+ <entry
key="rhq.communications.connector.security.keystore.type"
value="JKS" />
+ <entry
key="rhq.communications.connector.security.keystore.password"
value="rhqpwd" />
+ <entry
key="rhq.communications.connector.security.keystore.key-password"
value="rhqpwd" />
+ <entry
key="rhq.communications.connector.security.keystore.alias"
value="rhq" />
+ <entry
key="rhq.communications.connector.security.truststore.file"
value="data/truststore.dat" />
+ <entry
key="rhq.communications.connector.security.truststore.algorithm"
value="SunX509" />
+ <entry
key="rhq.communications.connector.security.truststore.type"
value="JKS" />
+ <entry
key="rhq.communications.connector.security.truststore.password"
value="" />
+ <entry
key="rhq.communications.connector.security.client-auth-mode"
value="none" />
+
+ <entry
key="rhq.server.client.security.secure-socket-protocol" value="TLS"
/>
+ <entry key="rhq.server.client.security.keystore.file"
value="data/keystore.dat" />
+ <entry key="rhq.server.client.security.keystore.algorithm"
value="SunX509" />
+ <entry key="rhq.server.client.security.keystore.type"
value="JKS" />
+ <entry key="rhq.server.client.security.keystore.password"
value="rhqpwd" />
+ <entry key="rhq.server.client.security.keystore.alias"
value="rhq" />
+ <entry key="rhq.server.client.security.keystore.key-password"
value="rhqpwd" />
+ <entry key="rhq.server.client.security.truststore.file"
value="data/truststore.dat" />
+ <entry key="rhq.server.client.security.truststore.algorithm"
value="SunX509" />
+ <entry key="rhq.server.client.security.truststore.type"
value="JKS" />
+ <entry key="rhq.server.client.security.truststore.password"
value="" />
+ <entry
key="rhq.server.client.security.server-auth-mode-enabled"
value="false" />
+ -->
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.remote-stream-max-idle-time-msecs
+
+ The maximum amount of milliseconds a remoted stream
+ is allowed to be idle before it is automatically closed and
+ removed from the server. This means that a client must
+ attempt to access the remoted stream every X milliseconds
+ (where X is the value of this setting) or that stream will no
+ longer be available. Note that this does not mean a client
+ must read or write the entire stream in this amount of time,
+ it only means a client must make a request on the stream every
+ X milliseconds (be it to read or write one byte, see how many
+ bytes are available to be read, etc).
+ -->
+ <entry
key="rhq.communications.remote-stream-max-idle-time-msecs"
value="300000" />
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.command-service-directory.allow-dynamic-discovery
+
+ Flag to allow new command services to be added to the command
+ services directory during runtime. If this is false, only
+ those services defined in the
+ rhq.communications.command-services preference will be available
+ during the lifetime of the command service directory.
+ -->
+ <entry
key="rhq.communications.command-service-directory.allow-dynamic-discovery"
value="true" />
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.command-services
+
+ Command Services that are to be added immediately at startup.
+ -->
+ <entry key="rhq.communications.command-services"
value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService,
org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService"
/>
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.remote-pojos
+
+ Objects that are to be created and their remote interfaces
+ deployed immediately at startup. The format of the value is
+ a comma separated list of implementation/interface names:
+ class.to.instantiate.via.noarg.constructor:interface.to.expose
+ -->
+ <entry key="rhq.communications.remote-pojos"
+
value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping,org.rhq.enterprise.server.core.CoreServerServiceImpl:org.rhq.core.clientapi.server.core.CoreServerService,org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl:org.rhq.core.clientapi.server.discovery.DiscoveryServerService,org.rhq.enterprise.server.measurement.MeasurementServerServiceImpl:org.rhq.core.clientapi.server.measurement.MeasurementServerService,org.rhq.enterprise.server.operation.OperationServerServiceImpl:org.rhq.core.clientapi.server.operation.OperationServerService,org.rhq.enterprise.server.configuration.ConfigurationServerServiceImpl:org.rhq.core.clientapi.server.configuration.ConfigurationServerService,org.rhq.enterprise.server.resource.ResourceFactoryServerServiceImpl:org.rhq.core.clientapi.server.inventory.ResourceFactoryServerService,org.rhq.enterprise.server.content.ContentServerServiceImpl:org.rhq.core.clientapi.server.content.ContentSer
verService,org.rhq.enterprise.server.event.EventServerServiceImpl:org.rhq.core.clientapi.server.event.EventServerService,org.rhq.enterprise.server.bundle.BundleServerServiceImpl:org.rhq.core.clientapi.server.bundle.BundleServerService,org.rhq.enterprise.server.drift.DriftServerServiceImpl:org.rhq.core.clientapi.server.drift.DriftServerService"
/>
+
+ <!--
+ _______________________________________________________________
+ rhq.communications.command-authenticator
+
+ A command authenticator class that will be used to authenticate incoming
commands.
+ -->
+ <entry key="rhq.communications.command-authenticator"
value="org.rhq.enterprise.server.core.comm.SecurityTokenCommandAuthenticator"
/>
+
+ </map>
+ </node>
+ </node>
+ </root>
+</preferences>
+
\ No newline at end of file
diff --git
a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
b/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
index a4b3a9a..c427db8 100644
---
a/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
+++
b/modules/enterprise/server/sars/services-sar/src/main/resources/META-INF/jboss-service.xml
@@ -3,65 +3,65 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
- <mbean
code="org.rhq.enterprise.server.core.CustomJaasDeploymentService"
- name="rhq:service=CustomJaasDeployment" />
+ <!--<mbean
code="org.rhq.enterprise.server.core.CustomJaasDeploymentService"-->
+ <!--name="rhq:service=CustomJaasDeployment" />-->
- <mbean code="org.rhq.enterprise.server.core.CoreServer"
- name="rhq:service=CoreServer" />
+ <!--<mbean code="org.rhq.enterprise.server.core.CoreServer"-->
+ <!--name="rhq:service=CoreServer" />-->
- <mbean
code="org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor"
- name="rhq:service=MeasurementMonitor" />
+ <!--<mbean
code="org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor"-->
+ <!--name="rhq:service=MeasurementMonitor" />-->
- <mbean
code="org.rhq.enterprise.server.alert.engine.mbean.AlertConditionCacheMonitor"
- name="rhq:service=AlertConditionCacheMonitor" />
+ <!--<mbean
code="org.rhq.enterprise.server.alert.engine.mbean.AlertConditionCacheMonitor"-->
+ <!--name="rhq:service=AlertConditionCacheMonitor" />-->
- <mbean
code="org.rhq.enterprise.server.resource.group.definition.mbean.GroupDefinitionRecalculationThreadMonitor"
- name="rhq:service=GroupDefinitionRecalculationThreadMonitor" />
+ <!--<mbean
code="org.rhq.enterprise.server.resource.group.definition.mbean.GroupDefinitionRecalculationThreadMonitor"-->
+ <!--name="rhq:service=GroupDefinitionRecalculationThreadMonitor"
/>-->
- <mbean
code="org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner"
- name="rhq:service=PluginDeploymentScanner">
- <attribute
name="ScanPeriod">${rhq.server.plugin-scan-period-ms:300000}</attribute>
- </mbean>
+ <!--<mbean
code="org.rhq.enterprise.server.core.plugin.PluginDeploymentScanner"-->
+ <!--name="rhq:service=PluginDeploymentScanner">-->
+ <!--<attribute
name="ScanPeriod">${rhq.server.plugin-scan-period-ms:300000}</attribute>-->
+ <!--</mbean>-->
- <mbean code="org.rhq.enterprise.server.scheduler.SchedulerService"
- name="rhq:service=scheduler">
- <attribute name="QuartzProperties">
-# RHQ custom property that defines the default timeout for all operations.
-# This is specified in seconds. If any operation takes longer than this, it is assumed
to have failed.
-rhq.server.operation-timeout = ${rhq.server.operation-timeout:600}
+ <!--<mbean
code="org.rhq.enterprise.server.scheduler.SchedulerService"-->
+ <!--name="rhq:service=scheduler">-->
+ <!--<attribute name="QuartzProperties">-->
+<!--# RHQ custom property that defines the default timeout for all operations.-->
+<!--# This is specified in seconds. If any operation takes longer than this, it is
assumed to have failed.-->
+<!--rhq.server.operation-timeout = ${rhq.server.operation-timeout:600}-->
-# scheduler factory config
-org.quartz.scheduler.instanceName = RHQScheduler
-org.quartz.scheduler.instanceId = AUTO
+<!--# scheduler factory config-->
+<!--org.quartz.scheduler.instanceName = RHQScheduler-->
+<!--org.quartz.scheduler.instanceId = AUTO-->
-# thread pool config
-org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
-org.quartz.threadPool.threadCount = 5
+<!--# thread pool config-->
+<!--org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool-->
+<!--org.quartz.threadPool.threadCount = 5-->
-# database config
-# note that the delegate class property should be set at build/installation time
-org.quartz.jobStore.class =
org.quartz.impl.jdbcjobstore.JobStoreCMT
-org.quartz.jobStore.driverDelegateClass =
${rhq.server.quartz.driverDelegateClass}
-org.quartz.jobStore.isClustered = true
-org.quartz.jobStore.clusterCheckinInterval = 30000
-org.quartz.jobStore.tablePrefix = RHQ_QRTZ_
-org.quartz.jobStore.useProperties = true
-org.quartz.jobStore.selectWithLockSQL = ${rhq.server.quartz.selectWithLockSQL}
-org.quartz.jobStore.dataSource = RHQDS
-org.quartz.dataSource.RHQDS.jndiURL = java:jboss/datasources/RHQDS
-org.quartz.dataSource.RHQDS.maxConnections = 10
-org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS
-org.quartz.dataSource.NoTxRHQDS.jndiURL = java:jboss/datasources/NoTxRHQDS
-org.quartz.dataSource.NoTxRHQDS.maxConnections = 10
-org.quartz.jobStore.lockHandler.class = ${rhq.server.quartz.lockHandlerClass}
- </attribute>
- </mbean>
+<!--# database config-->
+<!--# note that the delegate class property should be set at build/installation
time-->
+<!--org.quartz.jobStore.class =
org.quartz.impl.jdbcjobstore.JobStoreCMT-->
+<!--org.quartz.jobStore.driverDelegateClass =
${rhq.server.quartz.driverDelegateClass}-->
+<!--org.quartz.jobStore.isClustered = true-->
+<!--org.quartz.jobStore.clusterCheckinInterval = 30000-->
+<!--org.quartz.jobStore.tablePrefix = RHQ_QRTZ_-->
+<!--org.quartz.jobStore.useProperties = true-->
+<!--org.quartz.jobStore.selectWithLockSQL =
${rhq.server.quartz.selectWithLockSQL}-->
+<!--org.quartz.jobStore.dataSource = RHQDS-->
+<!--org.quartz.dataSource.RHQDS.jndiURL =
java:jboss/datasources/RHQDS-->
+<!--org.quartz.dataSource.RHQDS.maxConnections = 10-->
+<!--org.quartz.jobStore.nonManagedTXDataSource = NoTxRHQDS-->
+<!--org.quartz.dataSource.NoTxRHQDS.jndiURL =
java:jboss/datasources/NoTxRHQDS-->
+<!--org.quartz.dataSource.NoTxRHQDS.maxConnections = 10-->
+<!--org.quartz.jobStore.lockHandler.class =
${rhq.server.quartz.lockHandlerClass}-->
+ <!--</attribute>-->
+ <!--</mbean>-->
- <mbean
code="org.rhq.enterprise.server.core.comm.ServerCommunicationsService"
- name="rhq:service=ServerCommunications" />
+ <!--<mbean
code="org.rhq.enterprise.server.core.comm.ServerCommunicationsService"-->
+ <!--name="rhq:service=ServerCommunications" />-->
- <mbean code="org.rhq.enterprise.server.plugin.pc.ServerPluginService"
- name="rhq:service=ServerPluginService" />
+ <!--<mbean
code="org.rhq.enterprise.server.plugin.pc.ServerPluginService"-->
+ <!--name="rhq:service=ServerPluginService" />-->
<!-- TODO: first, see if we need this and if so we need to refactor this to work
inside AS7
<mbean
code="org.rhq.jndi.mbean.AccessCheckingInitialContextFactoryBuilderInstaller"
diff --git
a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties
b/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties
deleted file mode 100644
index 91ccc85..0000000
---
a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration-overrides.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-# location of the plugin jars and other files agents can download directly from sever
-rhq.server.agent-files-directory=${rhq.server.home}/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads
-# location where data files can be stored
-rhq.communications.data-directory=${jboss.server.data.dir}
-# global limit on number of concurrent incoming messages allowed
-rhq.communications.global-concurrency-limit=${rhq.communications.global-concurrency-limit:200}
-# Server's remote endpoint for agents to talk to
-rhq.communications.connector.transport=${rhq.communications.connector.transport:servlet}
-rhq.communications.connector.bind-address=${rhq.communications.connector.bind-address}
-rhq.communications.connector.bind-port=${rhq.communications.connector.bind-port:7080}
-rhq.communications.connector.transport-params=${rhq.communications.connector.transport-params:/jboss-remoting-servlet-invoker/ServerInvokerServlet}
-# Multicast detector configuration for auto-discovery
-rhq.communications.multicast-detector.enabled=${rhq.communications.multicast-detector.enabled:false}
-rhq.communications.multicast-detector.multicast-address=${rhq.communications.multicast-detector.multicast-address:224.16.16.16}
-rhq.communications.multicast-detector.bind-address=${rhq.communications.multicast-detector.bind-address}
-rhq.communications.multicast-detector.port=${rhq.communications.multicast-detector.port:16162}
-# Server-side SSL Security Configuration (for incoming messages from agents)
-rhq.communications.connector.security.secure-socket-protocol=${rhq.communications.connector.security.secure-socket-protocol:TLS}
-rhq.communications.connector.security.keystore.file=${rhq.communications.connector.security.keystore.file}
-rhq.communications.connector.security.keystore.algorithm=${rhq.communications.connector.security.keystore.algorithm}
-rhq.communications.connector.security.keystore.type=${rhq.communications.connector.security.keystore.type:JKS}
-rhq.communications.connector.security.keystore.password=${rhq.communications.connector.security.keystore.password:rhqpwd}
-rhq.communications.connector.security.keystore.key-password=${rhq.communications.connector.security.keystore.key-password:rhqpwd}
-rhq.communications.connector.security.keystore.alias=${rhq.communications.connector.security.keystore.alias:rhq}
-rhq.communications.connector.security.truststore.file=${rhq.communications.connector.security.truststore.file}
-rhq.communications.connector.security.truststore.algorithm=${rhq.communications.connector.security.truststore.algorithm}
-rhq.communications.connector.security.truststore.type=${rhq.communications.connector.security.truststore.type:JKS}
-rhq.communications.connector.security.truststore.password=${rhq.communications.connector.security.truststore.password}
-rhq.communications.connector.security.client-auth-mode=${rhq.communications.connector.security.client-auth-mode:none}
-# Client-side SSL Security Configuration (for outgoing messages to agents)
-rhq.server.client.security.secure-socket-protocol=${rhq.server.client.security.secure-socket-protocol:TLS}
-rhq.server.client.security.keystore.file=${rhq.server.client.security.keystore.file}
-rhq.server.client.security.keystore.algorithm=${rhq.server.client.security.keystore.algorithm}
-rhq.server.client.security.keystore.type=${rhq.server.client.security.keystore.type:JKS}
-rhq.server.client.security.keystore.password=${rhq.server.client.security.keystore.password:rhqpwd}
-rhq.server.client.security.keystore.key-password=${rhq.server.client.security.keystore.key-password:rhqpwd}
-rhq.server.client.security.keystore.alias=${rhq.server.client.security.keystore.alias:rhq}
-rhq.server.client.security.truststore.file=${rhq.server.client.security.truststore.file}
-rhq.server.client.security.truststore.algorithm=${rhq.server.client.security.truststore.algorithm}
-rhq.server.client.security.truststore.type=${rhq.server.client.security.truststore.type:JKS}
-rhq.server.client.security.truststore.password=${rhq.server.client.security.truststore.password}
-rhq.server.client.security.server-auth-mode-enabled=${rhq.server.client.security.server-auth-mode-enabled:false}
diff --git
a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration.xml
b/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration.xml
deleted file mode 100644
index 7f30276..0000000
---
a/modules/enterprise/server/sars/services-sar/src/main/resources/server-comm-configuration.xml
+++ /dev/null
@@ -1,468 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
-
-<!--
-==============================================================================
-RHQ Server Communications Configuration
-==============================================================================
--->
-
-<preferences EXTERNAL_XML_VERSION="1.0">
- <root type="user">
- <map />
- <node name="rhq-server">
- <map />
- <node name="default">
- <map>
- <!--
- _______________________________________________________________
- rhq.server.configuration-schema-version
-
- Defines what version of the server configuration schema this
- file conforms to. This is the schema for the rhq.server
- preferences.
- -->
- <entry key="rhq.server.configuration-schema-version"
value="1" />
-
- <!--
- _______________________________________________________________
- rhq.server.agent-files-directory
-
- This defines the directory location that contains all the files
- that can be sent remotely to agents. If this is not defined,
- this effectively disables the server's ability to remotely
- send files to agents. If deploying within a JBossAS instance,
- leave this undefined, and set this as a configuration override
- property in the server-comm-service.xml
- deployment configuration file. This will allow you to use the
- ${jboss.server.home.dir} replacement variable expression
- as part of the directory location, for example.
- -->
- <!--
- <entry key="rhq.server.agent-files-directory"
value="conf" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.server.client.queue-size
-
- The maximum size of the client command queue - this is the
- maximum number of commands that can be queued for sending to
- an agent. If this is 0, then the queue is unbounded.
- WARNING! Setting this to 0 could lead to resources being used
- up if for some reason commands keep getting queued but are
- not getting sent.
- -->
- <entry key="rhq.server.client.queue-size"
value="50000" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.max-concurrent
-
- The maximum number of concurrent commands that can be in the
- process of being sent to an agent at any one time.
- -->
- <entry key="rhq.server.client.max-concurrent"
value="1" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.command-timeout-msecs
-
- The time in milliseconds that the client sender will wait
- before aborting a command. This is the amount of time in
- milliseconds that the agent has in order to process commands.
- This value is only the default if a command has not specified
- its own timeout. A command can override this by setting its
- own timeout in the command's configuration, so this value may
- not be used for all commands that are sent. If this value is
- less than or equal to 0, there will be no default timeout
- and commands will therefore be allowed to take as long as they
- need (again, this is the default, individual commands may
- override this and set their own timeout). While this infinite
- timeout default could conceivably cause a thread to hang
- waiting for a rogue command that never finishes, it also reduces
- the amount of short-lived threads created by the system
- and will increase throughput, dramatically in some cases.
- -->
- <entry key="rhq.server.client.command-timeout-msecs"
value="600000" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.retry-interval-msecs
-
- This is the minimum amount of time, in milliseconds, the client
- sender will wait before trying to resend a guaranteed command
- that previously failed. This is not a guarantee of when
- a command is retried - all that can be inferred is that a
- command that fails to be sent will not be retried until at
- least this amount of time passes.
- Note: if the sender is currently waiting in this retry pause
- period, the server will not be able to be shutdown until that
- retry period is over. In other words, if the server is asked
- to shutdown, it will wait for those commands waiting in this
- retry interval to wake up. This is to help ensure those
- commands are not lost.
- -->
- <entry key="rhq.server.client.retry-interval-msecs"
value="15000" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.max-retries
-
- If a guaranteed delivery message is sent, but the server fails
- to connect to the agent and deliver the message, it will
- always be retried. However, if the error was something other
- than a "cannot connect" error, the command will only be retried
- this amount of times before the command is dropped. When this
- happens, the guaranteed command will never be delivered. This
- will normally happen under very odd and rare circumstances.
- Also, this setting only effects asynchronous messages that
- are sent with guaranteed delivery. This setting has no effect
- on other messages.
- -->
- <entry key="rhq.server.client.max-retries"
value="10" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.command-spool-file.name
-
- This defines the name of the command spool file. This
- file must be located in the data directory (if one does not
- exist, it will be created). Note that if you do not define
- this setting, the default is to not spool commands to disk
- and thus implicitly disable guaranteed delivery.
- -->
- <!--
- <entry key="rhq.server.client.command-spool-file.name"
value="command-spool.dat" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.server.client.command-spool-file.params
-
- This defines the parameters for the command spool file.
- The spool file is where the server persists commands that
- are flagged for guaranteed delivery and need to be sent.
- The format is defined as "max-file-size:purge-percentage".
- The first number is the size, in bytes, of the maximum file
- size threshold. If the spool file grows larger than this, a
- "purge" will be triggered in order to shrink the file.
- The second number is the purge percentage which indicates how
- large the file is allowed to be after a purge. This is
- specified as a percentage of the first parameter - the max
- file size threshold. For example, if the max file size is
- 100000 (i.e. 100KB) and the purge percentage is 90, then when
- the spool file grows larger than 100KB, a purge will be
- triggered and the file will be shrunk to no more than
- 90% of 100KB - which is 90KB. In effect, 10KB will be freed
- to allow room for new commands to be spooled. When this
- occurs, unused space is freed first and if that does not
- free up enough space, the oldest commands in the spool file
- will be sacrificed in order to make room for the newer
- commands.
- -->
- <entry key="rhq.server.client.command-spool-file.params"
value="1000000:75" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.command-spool-file.compressed
-
- If this flag is true, the commands stored in the spool file
- will be compressed. This can potentially save about 30%-40% in
- disk space (give or take), however, it slows down the
- persistence mechanism considerably. Recommended setting for
- this should be false unless something on the server deployment
- box warrants disk-saving over persistence performance.
- -->
- <entry key="rhq.server.client.command-spool-file.compressed"
value="false" />
-
- <!--
- _______________________________________________________________
- rhq.server.client.send-throttling
-
- If this setting is defined, it will enable send throttling to
- occur while sending commands to an agent. The format is
- defined as "max-commands:quiet-period-milliseconds"
- where the maximum commands defines the maximum number
- of commands that will be sent before the start of a quiet
- period. The quiet period defines the number of milliseconds
- in which no commands should be sent. After this duration
- expires, commands can again be sent, up to the maximum defined.
- Note that send throttling only affects those commands that
- are "throttle-able". Some commands are sent as soon as
- possible, regardless of the throttling settings.
-
- This affects sending commands synchronously and asynchronously.
- -->
- <!--
- <entry key="rhq.server.client.send-throttling"
value="100:1000" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.server.client.queue-throttling
-
- If this setting is defined, it will enable queue throttling to
- occur while sending commands to an agent. The format is
- defined as "max-commands-per-burst:burst-period-milliseconds"
- where the maximum commands per burst defines the maximum number
- of commands that can be dequeued within a burst period. The
- burst period defines the number of milliseconds in which the
- defined maximum number of commands can be dequeued. If more
- than the maximum number of commands are queued within this
- time period, they will wait until the next burst period starts
- before being able to be dequeued.
-
- This does not affect sending commands synchronously. It only
- effects commands queued to be sent asynchronously.
- -->
- <!--
- <entry key="rhq.server.client.queue-throttling"
value="50:3000" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.configuration-schema-version
-
- Defines what version of the configuration schema this
- file conforms to. This is the schema for the
- rhq.communications preferences.
- -->
- <entry key="rhq.communications.configuration-schema-version"
value="1" />
-
- <!--
- _______________________________________________________________
- rhq.communications.service-container.mbean-server-name
-
- Name of the MBean Server that houses the communications MBean
- services. This is actually the default domain name of the
- MBean Server and if an MBean Server has already been registered
- with this name, it will be used to house the communications
- services. If an MBean Server has not yet been registered with
- this name as its default domain, one will be created.
- If deploying within a JBossAS instance, the JBoss MBeanServer
- will be used, so this value can be left undefined since it
- will be unused.
- -->
- <!--
- <entry
key="rhq.communications.service-container.mbean-server-name"
value="jboss-on" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.data-directory
-
- The location where the communication services write internal
- data files. If deploying within a JBossAS instance, leave
- this undefined, and set this as a configuration override
- property in the server-comm-service.xml deployment
- configuration file. This will allow you to use the
- ${jboss.server.data.dir} replacement variable as the data
- directory location.
- -->
- <!--
- <entry key="rhq.communications.data-directory"
value="data" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.global-concurrency-limit
-
- The maximum number of incoming commands that are allowed to be
- received concurrently. Any extra commands received over this
- amount will be dropped and the client will be asked to
- resend it later.
- -->
- <entry key="rhq.communications.global-concurrency-limit"
value="200" />
-
- <!--
- _______________________________________________________________
- rhq.communications.multicast-detector.enabled
- rhq.communications.multicast-detector.multicast-address
- rhq.communications.multicast-detector.bind-address
- rhq.communications.multicast-detector.port
- rhq.communications.multicast-detector.default-time-delay
- rhq.communications.multicast-detector.heartbeat-time-delay
-
- The multicast detector configuration. This is the service that
- listens for new remote servers/agents coming on and going offline
- and is required if you want agent auto-detection. If you do not
- have auto-detection enabled or your network will not
- support multicast traffic, you should disable the multicast
- detector.
-
- The multicast-address is used to broadcast detection messages.
- To be more specific, it is the IP address of the
- multicast group the detector will join. The bind-address
- is the IP that is bound by the network interface.
-
- The detector will send heartbeat messages every X milliseconds
- (this is the heartbeat-time-delay). If external servers'
- detectors do not send their heartbeat messages within the
- default-time-delay, our detector will assume that external
- server has gone down. These settings affect the timeliness
- of our auto-detection mechanism.
- -->
- <entry key="rhq.communications.multicast-detector.enabled"
value="false" />
- <entry
key="rhq.communications.multicast-detector.multicast-address"
value="224.16.16.16" />
- <entry
key="rhq.communications.multicast-detector.bind-address"
value="0.0.0.0" />
- <entry key="rhq.communications.multicast-detector.port"
value="16162" />
- <entry
key="rhq.communications.multicast-detector.default-time-delay"
value="5000" />
- <entry
key="rhq.communications.multicast-detector.heartbeat-time-delay"
value="1000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.rhqtype
- rhq.communications.connector.transport
- rhq.communications.connector.bind-port
- rhq.communications.connector.bind-address
- rhq.communications.connector.transport-params
- rhq.communications.connector.lease-period
-
- The server connector configuration. This is the service that
- listens for incoming agent requests and passes them to the
- appropriate server-side components for processing. See the
- JBoss/Remoting documentation for a full list of options
- that can be specified. Note that because this is an XML file,
- you must specify "&" in the transport-params value
- when needing an ampersand to separate the parameters.
- -->
- <entry key="rhq.communications.connector.rhqtype"
value="server" />
- <entry key="rhq.communications.connector.transport"
value="servlet" />
- <entry key="rhq.communications.connector.bind-port"
value="7080" />
- <entry key="rhq.communications.connector.transport-params"
value="/jboss-remoting-servlet-invoker/ServerInvokerServlet" />
- <!--
- <entry key="rhq.communications.connector.bind-address"
value="127.0.0.1" />
- <entry key="rhq.communications.connector.lease-period"
value="5000" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.connector.security.secure-socket-protocol
- rhq.communications.connector.security.keystore.file
- rhq.communications.connector.security.keystore.algorithm
- rhq.communications.connector.security.keystore.type
- rhq.communications.connector.security.keystore.password
- rhq.communications.connector.security.keystore.key-password
- rhq.communications.connector.security.keystore.alias
- rhq.communications.connector.security.truststore.file
- rhq.communications.connector.security.truststore.algorithm
- rhq.communications.connector.security.truststore.type
- rhq.communications.connector.security.truststore.password
- rhq.communications.connector.security.client-auth-mode
-
- rhq.server.client.security.secure-socket-protocol
- rhq.server.client.security.keystore.file
- rhq.server.client.security.keystore.algorithm
- rhq.server.client.security.keystore.type
- rhq.server.client.security.keystore.password
- rhq.server.client.security.keystore.key-password
- rhq.server.client.security.keystore.alias
- rhq.server.client.security.truststore.file
- rhq.server.client.security.truststore.algorithm
- rhq.server.client.security.truststore.type
- rhq.server.client.security.truststore.password
- rhq.server.client.security.server-auth-mode-enabled
-
- These are the settings that are used if SSL is to be used for
- either the server or client communications. These can be left
- unset since the defaults will normally suffice. These
- properties are here just in case some use case occurs that
- require one or more of these settings to be customized.
-
- Note that if client-auth-mode is specified, it must be one of:
- "none", "want", "need". To support Tomcat
syntax, "true" can be used
- in place of "need" and "false" can be used in place of
"none".
- -->
- <!--
- <entry
key="rhq.communications.connector.security.secure-socket-protocol"
value="TLS" />
- <entry
key="rhq.communications.connector.security.keystore.file"
value="data/keystore.dat" />
- <entry
key="rhq.communications.connector.security.keystore.algorithm"
value="SunX509" />
- <entry
key="rhq.communications.connector.security.keystore.type"
value="JKS" />
- <entry
key="rhq.communications.connector.security.keystore.password"
value="rhqpwd" />
- <entry
key="rhq.communications.connector.security.keystore.key-password"
value="rhqpwd" />
- <entry
key="rhq.communications.connector.security.keystore.alias"
value="rhq" />
- <entry
key="rhq.communications.connector.security.truststore.file"
value="data/truststore.dat" />
- <entry
key="rhq.communications.connector.security.truststore.algorithm"
value="SunX509" />
- <entry
key="rhq.communications.connector.security.truststore.type"
value="JKS" />
- <entry
key="rhq.communications.connector.security.truststore.password"
value="" />
- <entry
key="rhq.communications.connector.security.client-auth-mode"
value="none" />
-
- <entry
key="rhq.server.client.security.secure-socket-protocol" value="TLS"
/>
- <entry key="rhq.server.client.security.keystore.file"
value="data/keystore.dat" />
- <entry key="rhq.server.client.security.keystore.algorithm"
value="SunX509" />
- <entry key="rhq.server.client.security.keystore.type"
value="JKS" />
- <entry key="rhq.server.client.security.keystore.password"
value="rhqpwd" />
- <entry key="rhq.server.client.security.keystore.alias"
value="rhq" />
- <entry key="rhq.server.client.security.keystore.key-password"
value="rhqpwd" />
- <entry key="rhq.server.client.security.truststore.file"
value="data/truststore.dat" />
- <entry key="rhq.server.client.security.truststore.algorithm"
value="SunX509" />
- <entry key="rhq.server.client.security.truststore.type"
value="JKS" />
- <entry key="rhq.server.client.security.truststore.password"
value="" />
- <entry
key="rhq.server.client.security.server-auth-mode-enabled"
value="false" />
- -->
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-stream-max-idle-time-msecs
-
- The maximum amount of milliseconds a remoted stream
- is allowed to be idle before it is automatically closed and
- removed from the server. This means that a client must
- attempt to access the remoted stream every X milliseconds
- (where X is the value of this setting) or that stream will no
- longer be available. Note that this does not mean a client
- must read or write the entire stream in this amount of time,
- it only means a client must make a request on the stream every
- X milliseconds (be it to read or write one byte, see how many
- bytes are available to be read, etc).
- -->
- <entry
key="rhq.communications.remote-stream-max-idle-time-msecs"
value="300000" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-service-directory.allow-dynamic-discovery
-
- Flag to allow new command services to be added to the command
- services directory during runtime. If this is false, only
- those services defined in the
- rhq.communications.command-services preference will be available
- during the lifetime of the command service directory.
- -->
- <entry
key="rhq.communications.command-service-directory.allow-dynamic-discovery"
value="true" />
-
- <!--
- _______________________________________________________________
- rhq.communications.command-services
-
- Command Services that are to be added immediately at startup.
- -->
- <entry key="rhq.communications.command-services"
value="org.rhq.enterprise.communications.command.impl.echo.server.EchoCommandService,
org.rhq.enterprise.communications.command.impl.identify.server.IdentifyCommandService"
/>
-
- <!--
- _______________________________________________________________
- rhq.communications.remote-pojos
-
- Objects that are to be created and their remote interfaces
- deployed immediately at startup. The format of the value is
- a comma separated list of implementation/interface names:
- class.to.instantiate.via.noarg.constructor:interface.to.expose
- -->
- <entry key="rhq.communications.remote-pojos"
-
value="org.rhq.enterprise.communications.PingImpl:org.rhq.enterprise.communications.Ping,org.rhq.enterprise.server.core.CoreServerServiceImpl:org.rhq.core.clientapi.server.core.CoreServerService,org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl:org.rhq.core.clientapi.server.discovery.DiscoveryServerService,org.rhq.enterprise.server.measurement.MeasurementServerServiceImpl:org.rhq.core.clientapi.server.measurement.MeasurementServerService,org.rhq.enterprise.server.operation.OperationServerServiceImpl:org.rhq.core.clientapi.server.operation.OperationServerService,org.rhq.enterprise.server.configuration.ConfigurationServerServiceImpl:org.rhq.core.clientapi.server.configuration.ConfigurationServerService,org.rhq.enterprise.server.resource.ResourceFactoryServerServiceImpl:org.rhq.core.clientapi.server.inventory.ResourceFactoryServerService,org.rhq.enterprise.server.content.ContentServerServiceImpl:org.rhq.core.clientapi.server.content.ContentSer
verService,org.rhq.enterprise.server.event.EventServerServiceImpl:org.rhq.core.clientapi.server.event.EventServerService,org.rhq.enterprise.server.bundle.BundleServerServiceImpl:org.rhq.core.clientapi.server.bundle.BundleServerService,org.rhq.enterprise.server.drift.DriftServerServiceImpl:org.rhq.core.clientapi.server.drift.DriftServerService"
/>
-
- <!--
- _______________________________________________________________
- rhq.communications.command-authenticator
-
- A command authenticator class that will be used to authenticate incoming
commands.
- -->
- <entry key="rhq.communications.command-authenticator"
value="org.rhq.enterprise.server.core.comm.SecurityTokenCommandAuthenticator"
/>
-
- </map>
- </node>
- </node>
- </root>
-</preferences>
-
\ No newline at end of file
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml
b/modules/enterprise/server/startup-subsystem/pom.xml
index 45d0c15..3b5b2ba 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -92,6 +92,11 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-ejb3</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>staxmapper</artifactId>
<scope>provided</scope>
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupExtension.java
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupExtension.java
index 265625a..5cc063b 100644
---
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupExtension.java
+++
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupExtension.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.startup;
@@ -64,7 +64,7 @@ public class StartupExtension implements Extension {
static final PathElement SUBSYSTEM_PATH = PathElement.pathElement(SUBSYSTEM,
SUBSYSTEM_NAME);
// the deployments we are managing
- static final String DEPLOYMENT_APP_EAR = "rhq.ear";
+ public static final String DEPLOYMENT_APP_EAR = "rhq.ear";
// our management API version
private static final int API_MAJOR_VERSION = 1;
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupSubsystemAdd.java
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupSubsystemAdd.java
index 54d14f4..80515ed 100644
---
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupSubsystemAdd.java
+++
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/StartupSubsystemAdd.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2012 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.startup;
@@ -30,25 +30,37 @@ import static
org.jboss.as.controller.descriptions.ModelDescriptionConstants.URL
import java.io.File;
import java.io.FileNotFoundException;
import java.net.URL;
+import java.util.List;
-import org.jboss.as.controller.AbstractAddStepHandler;
+import org.jboss.as.controller.AbstractBoottimeAddStepHandler;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
+import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.controller.operations.common.Util;
import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration;
import org.jboss.as.controller.registry.Resource;
+import org.jboss.as.server.AbstractDeploymentChainStep;
+import org.jboss.as.server.DeploymentProcessorTarget;
+import org.jboss.as.server.deployment.Phase;
import org.jboss.dmr.ModelNode;
+import org.jboss.logging.Logger;
import org.jboss.modules.Module;
+import org.jboss.msc.service.ServiceController;
+
+import org.rhq.enterprise.startup.deployment.RhqInitializationProcessor;
+import org.rhq.enterprise.startup.deployment.RhqShutdownBeanDependenciesProcessor;
/**
* Handler responsible for adding the subsystem resource to the model
*
* @author John Mazzitelli
*/
-class StartupSubsystemAdd extends AbstractAddStepHandler {
+class StartupSubsystemAdd extends AbstractBoottimeAddStepHandler {
+
+ private static final Logger LOG = Logger.getLogger(StartupSubsystemAdd.class);
static final StartupSubsystemAdd INSTANCE = new StartupSubsystemAdd();
@@ -109,4 +121,20 @@ class StartupSubsystemAdd extends AbstractAddStepHandler {
protected boolean requiresRuntimeVerification() {
return false;
}
+
+ @Override
+ protected void performBoottime(OperationContext context, ModelNode operation,
ModelNode model,
+ ServiceVerificationHandler verificationHandler,
List<ServiceController<?>> newControllers)
+ throws OperationFailedException {
+ LOG.info("Adding RHQ deploymentUnit processors");
+ context.addStep(new AbstractDeploymentChainStep() {
+ public void execute(DeploymentProcessorTarget processorTarget) {
+ processorTarget.addDeploymentProcessor(StartupExtension.SUBSYSTEM_NAME,
Phase.STRUCTURE,
+ Phase.STRUCTURE_EAR + 10, new RhqInitializationProcessor());
+ processorTarget.addDeploymentProcessor(StartupExtension.SUBSYSTEM_NAME,
Phase.INSTALL,
+ Phase.INSTALL_DEPENDS_ON_ANNOTATION + 10, new
RhqShutdownBeanDependenciesProcessor());
+ }
+ }, OperationContext.Stage.RUNTIME);
+ }
+
}
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqDeploymentMarker.java
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqDeploymentMarker.java
new file mode 100644
index 0000000..ff98956
--- /dev/null
+++
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqDeploymentMarker.java
@@ -0,0 +1,49 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+package org.rhq.enterprise.startup.deployment;
+
+import org.jboss.as.server.deployment.AttachmentKey;
+import org.jboss.as.server.deployment.DeploymentUnit;
+
+/**
+ * Marker for RHQ EAR. Deployment Unit Processors will only process RHQ EAR sub
deployments.
+ *
+ * @author Thomas Segismont
+ */
+class RhqDeploymentMarker {
+ private static final AttachmentKey<RhqDeploymentMarker> MARKER =
AttachmentKey.create(RhqDeploymentMarker.class);
+
+ private RhqDeploymentMarker() {
+ // Defensive
+ }
+
+ static void mark(DeploymentUnit unit) {
+ unit.putAttachment(MARKER, new RhqDeploymentMarker());
+ }
+
+ static boolean isRhqDeployment(DeploymentUnit unit) {
+ DeploymentUnit deploymentUnit = unit;
+ if (deploymentUnit.getParent() != null) {
+ do {
+ deploymentUnit = deploymentUnit.getParent();
+ } while (deploymentUnit.getParent() != null);
+ }
+ return deploymentUnit.hasAttachment(MARKER);
+ }
+}
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqInitializationProcessor.java
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqInitializationProcessor.java
new file mode 100644
index 0000000..4e694ae
--- /dev/null
+++
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqInitializationProcessor.java
@@ -0,0 +1,53 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+package org.rhq.enterprise.startup.deployment;
+
+import static org.rhq.enterprise.startup.StartupExtension.DEPLOYMENT_APP_EAR;
+
+import org.jboss.as.ee.structure.DeploymentType;
+import org.jboss.as.ee.structure.DeploymentTypeMarker;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+import org.jboss.logging.Logger;
+
+/**
+ * A DUP which detects RHQ EAR deployment.
+ *
+ * @author Thomas Segismont
+ */
+public class RhqInitializationProcessor implements DeploymentUnitProcessor {
+
+ private static final Logger LOG =
Logger.getLogger(RhqInitializationProcessor.class);
+
+ @Override
+ public void deploy(DeploymentPhaseContext phaseContext) throws
DeploymentUnitProcessingException {
+ DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
+ if (deploymentUnit.getParent() == null &&
DEPLOYMENT_APP_EAR.equals(deploymentUnit.getName())
+ && DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit))
{
+ LOG.info("Found " + DEPLOYMENT_APP_EAR + " deployment");
+ RhqDeploymentMarker.mark(deploymentUnit);
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit context) {
+ }
+}
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqShutdownBeanDependenciesProcessor.java
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqShutdownBeanDependenciesProcessor.java
new file mode 100644
index 0000000..2b88268
--- /dev/null
+++
b/modules/enterprise/server/startup-subsystem/src/main/java/org/rhq/enterprise/startup/deployment/RhqShutdownBeanDependenciesProcessor.java
@@ -0,0 +1,94 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+package org.rhq.enterprise.startup.deployment;
+
+import static org.jboss.msc.service.ServiceBuilder.DependencyType.REQUIRED;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import org.jboss.as.ee.component.Attachments;
+import org.jboss.as.ee.component.ComponentDescription;
+import org.jboss.as.ee.component.EEModuleDescription;
+import org.jboss.as.ejb3.component.session.SessionBeanComponentDescription;
+import org.jboss.as.server.deployment.DeploymentPhaseContext;
+import org.jboss.as.server.deployment.DeploymentUnit;
+import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
+import org.jboss.as.server.deployment.DeploymentUnitProcessor;
+
+/**
+ * A DUP which makes the ShutdownListener session bean automatically depend on all other
sessions beans.
+ *
+ * @author Thomas Segismont
+ */
+public class RhqShutdownBeanDependenciesProcessor implements DeploymentUnitProcessor {
+
+ public static final String SHUTDOWN_LISTENER_CLASS_NAME =
"org.rhq.enterprise.server.core.ShutdownListener";
+
+ @Override
+ public void deploy(DeploymentPhaseContext context) throws
DeploymentUnitProcessingException {
+ DeploymentUnit unit = context.getDeploymentUnit();
+ EEModuleDescription moduleDescription =
unit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
+ Collection<ComponentDescription> componentDescriptions =
moduleDescription.getComponentDescriptions();
+
+ if (componentDescriptions == null || componentDescriptions.isEmpty()
+ || !RhqDeploymentMarker.isRhqDeployment(unit)) {
+ // Only process sub deployments of the RHQ EAR
+ return;
+ }
+
+ Collection<SessionBeanComponentDescription>
sessionBeanComponentDescriptions =
getSessionBeanComponentDescriptions(componentDescriptions);
+
+ SessionBeanComponentDescription shutdownBeanComponentDescription =
extractShutdownBeanDescription(sessionBeanComponentDescriptions);
+
+ for (SessionBeanComponentDescription sessionBeanComponentDescription :
sessionBeanComponentDescriptions) {
+
shutdownBeanComponentDescription.addDependency(sessionBeanComponentDescription.getStartServiceName(),
+ REQUIRED);
+ }
+ }
+
+ private Collection<SessionBeanComponentDescription>
getSessionBeanComponentDescriptions(
+ Collection<ComponentDescription> componentDescriptions) {
+ Collection<SessionBeanComponentDescription>
sessionBeanComponentDescriptions = new
LinkedList<SessionBeanComponentDescription>();
+ for (ComponentDescription componentDescription : componentDescriptions) {
+ if (componentDescription instanceof SessionBeanComponentDescription) {
+ sessionBeanComponentDescriptions.add((SessionBeanComponentDescription)
componentDescription);
+ }
+ }
+ return sessionBeanComponentDescriptions;
+ }
+
+ private SessionBeanComponentDescription extractShutdownBeanDescription(
+ Collection<SessionBeanComponentDescription>
sessionBeanComponentDescriptions) {
+ for (Iterator<SessionBeanComponentDescription> iterator =
sessionBeanComponentDescriptions.iterator(); iterator
+ .hasNext();) {
+ SessionBeanComponentDescription sessionBeanComponentDescription =
iterator.next();
+ if
(sessionBeanComponentDescription.getComponentClassName().equals(SHUTDOWN_LISTENER_CLASS_NAME))
{
+ iterator.remove();
+ return sessionBeanComponentDescription;
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit context) {
+ }
+}
diff --git
a/modules/enterprise/server/startup-subsystem/src/main/resources/module/main/module.xml
b/modules/enterprise/server/startup-subsystem/src/main/resources/module/main/module.xml
index 307029d..33069a1 100644
---
a/modules/enterprise/server/startup-subsystem/src/main/resources/module/main/module.xml
+++
b/modules/enterprise/server/startup-subsystem/src/main/resources/module/main/module.xml
@@ -21,6 +21,7 @@
<!-- additional modules that this subsystem depends on -->
<module name="org.jboss.metadata"/>
<module name="org.jboss.as.ee"/>
+ <module name="org.jboss.as.ejb3"/>
<module name="org.jboss.as.web"/>
</dependencies>
diff --git a/pom.xml b/pom.xml
index 401c7ca..220eb30 100644
--- a/pom.xml
+++ b/pom.xml
@@ -392,6 +392,11 @@
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-ejb3</artifactId>
+ <version>${jboss.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
<artifactId>jboss-as-naming</artifactId>
<version>${jboss.version}</version>
</dependency>
@@ -1004,7 +1009,7 @@
</plugin>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
- <version>2.4.2</version>
+ <version>2.8</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>