[rhq] pom.xml
by Heiko W. Rupp
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit f9f3f712f702058e0d6ef5f1b99dcbe2162e63a9
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 12 11:09:16 2013 +0200
Downgrade to 1.2.3, as the jboss nexus repo does not find 1.2.5. It is more recent than 1.1.1 anyway
diff --git a/pom.xml b/pom.xml
index 6b1d75f..c5cf5a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,7 +151,7 @@
<augeas.zip.mask>*-${augeas.classifier}.zip</augeas.zip.mask>
<ant.contrib.version>1.0b3</ant.contrib.version>
<freemarker.version>2.3.18</freemarker.version>
- <swagger-annotations.version>1.2.5</swagger-annotations.version>
+ <swagger-annotations.version>1.2.3</swagger-annotations.version>
<powermock.version>1.4.12</powermock.version>
<arquillian.version>1.0.3.Final</arquillian.version>
<arquillian.jboss.container.version>7.2.0.Final</arquillian.jboss.container.version>
10 years, 10 months
[rhq] modules/enterprise modules/helpers pom.xml
by Heiko W. Rupp
modules/enterprise/server/jar/pom.xml | 11 +----------
modules/helpers/rest-docs-generator/pom.xml | 12 +-----------
pom.xml | 3 ++-
3 files changed, 4 insertions(+), 22 deletions(-)
New commits:
commit c33f3226056333a1aaaa303306d1ce6dadcefe47
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Fri Jul 12 10:35:44 2013 +0200
Bump swagger annotations version to a stable version and remove the snapshot repo. Thanks gaYak for reminding me.
diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml
index 2127930..7c236c7 100644
--- a/modules/enterprise/server/jar/pom.xml
+++ b/modules/enterprise/server/jar/pom.xml
@@ -439,7 +439,7 @@
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations_2.9.1</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>${swagger-annotations.version}</version>
<scope>provided</scope>
</dependency>
@@ -686,15 +686,6 @@
</build>
- <repositories>
- <repository>
- <!-- TODO change when the annotations are published. This is temporary for the swagger annotations for REST-docu -->
- <id>sonatype-oss-snapshot</id>
- <name>Sonatype OSS Snapshot repository</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- </repository>
-
- </repositories>
<profiles>
diff --git a/modules/helpers/rest-docs-generator/pom.xml b/modules/helpers/rest-docs-generator/pom.xml
index 9cc4fa1..c672abf 100644
--- a/modules/helpers/rest-docs-generator/pom.xml
+++ b/modules/helpers/rest-docs-generator/pom.xml
@@ -122,16 +122,6 @@
</plugins>
</build>
- <repositories>
- <repository>
- <!-- TODO temporary for the swagger annotations -->
- <id>sonatype-oss-snapshot</id>
- <name>Sonatype OSS Snapshot repository</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots</url>
- </repository>
-
- </repositories>
-
<dependencies>
<dependency>
@@ -149,7 +139,7 @@
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-annotations_2.9.1</artifactId>
- <version>1.1.1-SNAPSHOT</version>
+ <version>${swagger-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
diff --git a/pom.xml b/pom.xml
index 26703d1..6b1d75f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -151,6 +151,7 @@
<augeas.zip.mask>*-${augeas.classifier}.zip</augeas.zip.mask>
<ant.contrib.version>1.0b3</ant.contrib.version>
<freemarker.version>2.3.18</freemarker.version>
+ <swagger-annotations.version>1.2.5</swagger-annotations.version>
<powermock.version>1.4.12</powermock.version>
<arquillian.version>1.0.3.Final</arquillian.version>
<arquillian.jboss.container.version>7.2.0.Final</arquillian.jboss.container.version>
@@ -901,7 +902,7 @@
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
-
+
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
10 years, 10 months
[rhq] 2 commits - modules/enterprise modules/plugins
by snegrea
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java | 91 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerLocal.java | 21 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerRemote.java | 22 ++
modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java | 2
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/StorageServiceComponent.java | 26 +-
modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml | 4
6 files changed, 147 insertions(+), 19 deletions(-)
New commits:
commit 524d1b66879fa6d20788505e1c43c0e046e06e48
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Fri Jul 12 00:58:48 2013 -0500
Initial implementation for fetching all the alerts triggered for Storage Nodes resource and sub-sources.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
index 9d073ee..fa51fe1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerBean.java
@@ -28,8 +28,10 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Queue;
import javax.ejb.EJB;
import javax.ejb.Stateless;
@@ -43,6 +45,7 @@ import org.quartz.JobDataMap;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
+import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.cloud.Server;
@@ -51,6 +54,7 @@ import org.rhq.core.domain.cloud.StorageNode.OperationMode;
import org.rhq.core.domain.cloud.StorageNodeLoadComposite;
import org.rhq.core.domain.common.JobTrigger;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.criteria.ResourceGroupCriteria;
import org.rhq.core.domain.criteria.StorageNodeCriteria;
import org.rhq.core.domain.measurement.MeasurementAggregate;
@@ -59,8 +63,11 @@ import org.rhq.core.domain.operation.bean.GroupOperationSchedule;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.resource.group.ResourceGroup;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.RHQConstants;
+import org.rhq.enterprise.server.alert.AlertManagerLocal;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.RequiredPermission;
import org.rhq.enterprise.server.authz.RequiredPermissions;
@@ -110,6 +117,9 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
@EJB
private OperationManagerLocal operationManager;
+ @EJB
+ private AlertManagerLocal alertManager;
+
@Override
public void linkResource(Resource resource) {
List<StorageNode> storageNodes = this.getStorageNodes();
@@ -427,7 +437,7 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
}
entityManager.flush();
}
-
+
private StorageNodeLoadComposite.MeasurementAggregateWithUnits getMeasurementAggregateWithUnits(Subject subject,
int schedId, MeasurementUnits units, long beginTime, long endTime) {
MeasurementAggregate measurementAggregate = measurementManager.getAggregate(subject, schedId, beginTime,
@@ -472,4 +482,81 @@ public class StorageNodeManagerBean implements StorageNodeManagerLocal, StorageN
operationManager.scheduleGroupOperation(subjectManager.getOverlord(), schedule);
}
-}
+
+ @Override
+ public PageList<Alert> findNotAcknowledgedStorageNodeAlerts(Subject subject) {
+ return findStorageNodeAlerts(subject, false);
+ }
+
+ @Override
+ public PageList<Alert> findAllStorageNodeAlerts(Subject subject) {
+ return findStorageNodeAlerts(subject, true);
+ }
+
+ /**
+ * Find the set of alerts related to Storage Node resources and sub-resources.
+ *
+ * @param subject subject
+ * @param allAlerts if [true] then return all alerts; if [false] then return only alerts that are not acknowledged
+ * @return alerts
+ */
+ private PageList<Alert> findStorageNodeAlerts(Subject subject, boolean allAlerts) {
+ Integer[] resouceIdsWithAlertDefinitions = findResourcesWithAlertDefinitions();
+ PageList<Alert> alerts = new PageList<Alert>();
+
+ if( resouceIdsWithAlertDefinitions != null && resouceIdsWithAlertDefinitions.length != 0 ){
+ AlertCriteria criteria = new AlertCriteria();
+ criteria.setPageControl(PageControl.getUnlimitedInstance());
+ criteria.addFilterResourceIds(resouceIdsWithAlertDefinitions);
+ criteria.addSortCtime(PageOrdering.DESC);
+
+ alerts = alertManager.findAlertsByCriteria(subject, criteria);
+
+ if (!allAlerts) {
+ //select on alerts that are not acknowledge
+ PageList<Alert> trimmedAlerts = new PageList<Alert>();
+ for (Alert alert : alerts) {
+ if (alert.getAcknowledgeTime() == null || alert.getAcknowledgeTime() <= 0) {
+ trimmedAlerts.add(alert);
+ }
+ }
+
+ alerts = trimmedAlerts;
+ }
+ }
+
+ return alerts;
+ }
+
+ /**
+ * Return resource Ids for all resources and sub-resources of Storage Nodes that
+ * have alert definitions. This will be used by the resource criteria to find
+ * all alerts triggered for storage nodes.
+ *
+ * @return
+ */
+ private Integer[] findResourcesWithAlertDefinitions() {
+ List<Integer> resourceIdsWithAlertDefinitions = new ArrayList<Integer>();
+ List<StorageNode> test2 = getStorageNodes();
+
+ Queue<Resource> unvisitedResources = new LinkedList<Resource>();
+ for (StorageNode node : test2) {
+ if (node.getResource() != null) {
+ unvisitedResources.add(node.getResource());
+ }
+ }
+
+ while(!unvisitedResources.isEmpty()){
+ Resource resource = unvisitedResources.poll();
+ if (resource.getAlertDefinitions() != null) {
+ resourceIdsWithAlertDefinitions.add(resource.getId());
+ }
+
+ for(Resource child: resource.getChildResources()){
+ unvisitedResources.add(child);
+ }
+ }
+
+ return resourceIdsWithAlertDefinitions.toArray(new Integer[resourceIdsWithAlertDefinitions.size()]);
+ }
+}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerLocal.java
index 5c3f092..a9b2514 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerLocal.java
@@ -22,6 +22,7 @@ import java.util.List;
import javax.ejb.Local;
+import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.cloud.StorageNode;
import org.rhq.core.domain.cloud.StorageNodeLoadComposite;
@@ -65,13 +66,29 @@ public interface StorageNodeManagerLocal {
* @return list of nodes
*/
PageList<StorageNode> findStorageNodesByCriteria(Subject subject, StorageNodeCriteria criteria);
-
+
+ /**
+ * Fetches the list of Storage Node related alerts that have not yet been acknowledged.
+ *
+ * @param subject subject
+ * @return storage nodes alerts not acknowledged
+ */
+ PageList<Alert> findNotAcknowledgedStorageNodeAlerts(Subject subject);
+
+ /**
+ * Fetches all the Storage Node related alerts.
+ *
+ * @param subject subject
+ * @return all storage nodes alerts
+ */
+ PageList<Alert> findAllStorageNodeAlerts(Subject subject);
+
/**
* <p>Prepares the node for subsequent upgrade.</p>
* <p> CAUTION: this method will set the RHQ server to maintenance mode, RHQ storage flushes all the data to disk
* and backup of all the keyspaces is created</p>
* <p>the subject needs to have <code>MANAGE_SETTINGS</code> and <code>MANAGE_INVENTORY</code> permissions.</p>
- *
+ *
* @param subject caller
* @param storageNode storage node on which the prepareForUpgrade operation should be run
*/
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerRemote.java
index d4c9f78..72432db 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerRemote.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/cloud/StorageNodeManagerRemote.java
@@ -20,6 +20,7 @@ package org.rhq.enterprise.server.cloud;
import javax.ejb.Remote;
+import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.cloud.StorageNode;
import org.rhq.core.domain.cloud.StorageNodeLoadComposite;
@@ -28,7 +29,7 @@ import org.rhq.core.domain.util.PageList;
/**
* Remote interface to the manager responsible for creating and managing storage nodes.
- *
+ *
* @author Jirka Kremser
*/
@Remote
@@ -36,9 +37,9 @@ public interface StorageNodeManagerRemote {
/**
* <p>Returns the summary of load of the storage node.</p>
- *
+ *
* <p>the subject needs to have <code>MANAGE_SETTINGS</code> permissions.</p>
- *
+ *
* @param subject user that must have proper permissions
* @param node storage node entity (it can be a new object, but the id should be set properly)
* @param beginTime the start time
@@ -58,4 +59,19 @@ public interface StorageNodeManagerRemote {
*/
PageList<StorageNode> findStorageNodesByCriteria(Subject subject, StorageNodeCriteria criteria);
+ /**
+ * Fetches the list of Storage Node related alerts that have not yet been acknowledged.
+ *
+ * @param subject subject
+ * @return storage nodes alerts not acknowledged
+ */
+ PageList<Alert> findNotAcknowledgedStorageNodeAlerts(Subject subject);
+
+ /**
+ * Fetches all the Storage Node related alerts.
+ *
+ * @param subject subject
+ * @return all storage nodes alerts
+ */
+ PageList<Alert> findAllStorageNodeAlerts(Subject subject);
}
commit 4674c9c66fef570a0abb3961205056fed3e75097
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Jul 11 14:58:52 2013 -0500
Update the calculation for the percentage of disk space used. The percentage now represents the amount of disk used by the Cassandra data files.
diff --git a/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java b/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java
index dcfdc37..8995ec0 100644
--- a/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java
+++ b/modules/enterprise/server/plugins/alertdef-rhq/src/main/java/org/rhq/enterprise/server/plugins/alertdef/AlertDefinitionServerPluginComponent.java
@@ -300,7 +300,7 @@ public class AlertDefinitionServerPluginComponent implements ServerPluginCompone
AlertCondition ac = new AlertCondition();
ac.setCategory(AlertConditionCategory.THRESHOLD);
ac.setComparator(">");
- ac.setThreshold(0.75D);
+ ac.setThreshold(0.5D);
List<Integer> measurementDefinitionIds = new ArrayList<Integer>(1);
for (MeasurementDefinition d : resourceType.getMetricDefinitions()) {
diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/StorageServiceComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/StorageServiceComponent.java
index 7281f9b..e5a2283 100644
--- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/StorageServiceComponent.java
+++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/StorageServiceComponent.java
@@ -60,6 +60,8 @@ public class StorageServiceComponent extends ComplexConfigurationResourceCompone
private static final String OWNERSHIP_METRIC_NAME = "Ownership";
private static final String PARTITION_DISK_USED_PERCENTAGE_METRIC_NAME = "Calculated.PartitionDiskUsedPercentage";
private static final String DATA_FILE_LOCATIONS_NAME = "AllDataFileLocations";
+ private static final String LOAD_NAME = "Load";
+
private Log log = LogFactory.getLog(StorageServiceComponent.class);
private InetAddress host;
@@ -178,23 +180,30 @@ public class StorageServiceComponent extends ComplexConfigurationResourceCompone
}
break;
} else if (PARTITION_DISK_USED_PERCENTAGE_METRIC_NAME.equals(request.getName())) {
- EmsAttribute attribute = bean.getAttribute(DATA_FILE_LOCATIONS_NAME);
- Object valueObject = attribute.refresh();
- if (valueObject instanceof String[]) {
+
+
+ EmsAttribute loadAttribute = bean.getAttribute(LOAD_NAME);
+ Object loadValue = loadAttribute.refresh();
+
+ EmsAttribute dataFileLocationAttribute = bean.getAttribute(DATA_FILE_LOCATIONS_NAME);
+ Object dataFileLocationValue = dataFileLocationAttribute.refresh();
+
+ if (loadValue != null && dataFileLocationValue != null && dataFileLocationValue instanceof String[]) {
//Please visit for details: https://issues.apache.org/jira/browse/CASSANDRA-2749
//The average usage of all partitions with the data will be reported.
//Cassandra selects the partition with most free space for SStable flush and compaction.
- report.addData(new MeasurementDataNumeric(request,
- getPartitionDiskUsedPercentage((String[]) valueObject)));
+ double load = Double.parseDouble(loadValue.toString());
+
+ report.addData(new MeasurementDataNumeric(request, getPartitionDiskUsedPercentage(load,
+ (String[]) dataFileLocationValue)));
}
}
}
}
- private double getPartitionDiskUsedPercentage(String[] paths) {
+ private double getPartitionDiskUsedPercentage(double dataSize, String[] paths) {
List<String> visitedMountPoints = new ArrayList<String>();
long totalDiskSpace = 0;
- long totalUsedDiskSpace = 0;
for (String path : paths) {
try {
@@ -202,7 +211,6 @@ public class StorageServiceComponent extends ComplexConfigurationResourceCompone
if (!visitedMountPoints.contains(fileSystemInfo.getMountPoint())) {
visitedMountPoints.add(fileSystemInfo.getMountPoint());
totalDiskSpace += fileSystemInfo.getFileSystemUsage().getTotal();
- totalUsedDiskSpace += fileSystemInfo.getFileSystemUsage().getUsed();
}
} catch (Exception e) {
log.error("Unable to determine file system usage information for data file location " + path, e);
@@ -210,7 +218,7 @@ public class StorageServiceComponent extends ComplexConfigurationResourceCompone
}
if (totalDiskSpace != 0) {
- double rawPercentage = ((double) totalUsedDiskSpace) / ((double) totalDiskSpace);
+ double rawPercentage = dataSize / ((double) totalDiskSpace);
return Math.round(rawPercentage * 100.0) / 100.0;
}
diff --git a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
index 3aa701b..e6bc1da 100644
--- a/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/cassandra/src/main/resources/META-INF/rhq-plugin.xml
@@ -187,8 +187,8 @@
</operation>
<metric property="CurrentGenerationNumber" dataType="trait" displayType="summary" description="Current generation number"/>
- <metric property="Calculated.PartitionDiskUsedPercentage" dataType="measurement" units="percentage" displayType="summary" description="Percentage of total disk space used for the partition that contains the data files.
- If multiple data locations are specified then this will report the average utilization accross all the partitions."/>
+ <metric property="Calculated.PartitionDiskUsedPercentage" displayName="Data File Disk Used Percentage" dataType="measurement" units="percentage" displayType="summary" description="Percentage of disk space used by the data files. If multiple data locations are specified then this will report
+ the average utilization accross all the partitions that contain data files."/>
<metric property="ExceptionCount" measurementType="trendsup" dataType="measurement" displayType="summary" description="Exception Count"/>
<metric property="Initialized" dataType="trait" displayType="summary" description="Initialized"/>
<metric property="Joined" dataType="trait" displayType="summary" description="Joined"/>
10 years, 10 months
[rhq] Changes to 'mtho11/consolidated-metrics'
by mike thompson
New branch 'mtho11/consolidated-metrics' available with the following commits:
commit 5d9da9ae01c89cd847796d291bb5b2b448ef3ef6
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 11 13:45:51 2013 -0700
Consolidated Metrics sparkline treegrid.
commit 75955e4041caa62fae669379ee0f4dd6bd066ae7
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 11 11:36:22 2013 -0700
CoreGui maven pom.xml made the gwt maven plugin correspond to the gwt.version as the two should always be aligned. This way, any changes in .m2/settings.xml will be set properly.
commit 297f6ff0df17e9fc3edae63fc54de1c9ec677296
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 11 11:12:11 2013 -0700
Remove GFlot from coregui maven pom.
commit 67d21606618c9f1a3ab9e51f3ed1ef3cecaff839
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Thu Jul 11 08:42:51 2013 -0700
Search - remove unnecessary logging.
commit 1e8e2e5c8ad669175ee0dd1b6de703b3baa2b5c2
Merge: 289638f fd4316e
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Wed Jul 10 10:03:04 2013 -0700
Merge master to consolidated-metrics on 7/8/13.
commit 289638fee0f5eb8454c1e7b75d86407273d73cac
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri Jun 28 15:54:06 2013 -0700
Add sparklines to new consolidated metrics tab.
commit 07075035245b52f027b9f8d9a4065a3bfcc16083
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Fri Jun 28 09:45:20 2013 -0700
[BZ 958754] On Multi-resource graph, time units should have minutes when appropriate.
10 years, 10 months
[rhq] etc/scripts
by John Sanda
etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
New commits:
commit a1c2dcac50a7a0df8ab17898952e7fa6270dfc3b
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 11 21:41:34 2013 -0400
use upgradesstables and not scrub command to regenerate sstables
Also execute a drain operation at the end to flush all memtables and commit log
to ensure no data loss prior to upgrade.
diff --git a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
index 8a83320..7c0b88a 100755
--- a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
+++ b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
@@ -30,24 +30,31 @@ cp $PATCH $RHQ_SERVER_DIR/rhq-storage/lib
echo "Starting RHQ Storage node"
$RHQ_SERVER_DIR/bin/rhqctl start --storage
+# sleep for a few seconds while Cassandra starts up
+echo "Waiting for RHQ Storage Node to start up..."
+sleep 3
+
# run the CQL script
echo "Running CQL script to disable table compression"
export CQLSH_HOST=$CQLSH_HOST
export CQL_PORT=$CQL_PORT
$RHQ_SERVER_DIR/rhq-storage/bin/cqlsh -u rhqadmin -p rhqadmin -f ./disable_compression.cql
-# scrub all keyspaces
+# rewrite all sstables
echo "Rebuilding data files for system keyspace"
-$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT scrub system
+$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT upgradesstables --include-all-sstables system
echo "Rebuilding data files for system_traces keyspace"
-$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT scrub system_traces
+$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT upgradesstables --include-all-sstables system_traces
echo "Rebuilding data files for system_auth keyspace"
-$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT scrub system_auth
+$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT upgradesstables --include-all-sstables system_auth
echo "Rebuilding data files for rhq keyspace"
-$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT scrub rhq
+$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT upgradesstables --include-all-sstables rhq
+
+# flush memtables and commit log to ensure no data loss prior to upgrade
+$RHQ_SERVER_DIR/rhq-storage/bin/nodetool -u rhqadmin -pw rhqadmin -p $JMX_PORT drain
echo "Shutting down the RHQ Storage node"
$RHQ_SERVER_DIR/bin/rhqctl stop
10 years, 10 months
[rhq] etc/agent-versioning modules/enterprise pom.xml
by mazz
etc/agent-versioning/build.xml | 2
modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 12 -
modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.bat | 14 -
modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.sh | 14 -
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 4
modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy | 4
modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/LocalClientTest.java | 22 +-
modules/enterprise/server/ear/pom.xml | 4
modules/enterprise/server/ear/src/main/application/META-INF/jboss-deployment-structure.xml | 2
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 2
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/JndiAccessTest.java | 86 +++++-----
modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java | 62 +++----
modules/enterprise/server/itests-2/src/test/resources/application.xml | 4
modules/enterprise/server/itests-2/src/test/resources/jboss-deployment-structure.xml | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteSafeInvocationHandler.java | 10 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java | 10 -
modules/enterprise/server/jar/src/main/resources/server-comm-configuration-overrides.properties | 2
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java | 2
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java | 2
modules/enterprise/server/startup-subsystem/pom.xml | 4
pom.xml | 2
21 files changed, 133 insertions(+), 133 deletions(-)
New commits:
commit 957781e62543ff5023c4b59567ee76c6ab2a9d9a
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 11 17:14:48 2013 -0400
BZ 983552 shorten the deployment names of the ejb3 jar and the startup subsystem
diff --git a/etc/agent-versioning/build.xml b/etc/agent-versioning/build.xml
index d6c18a1..7a60e51 100644
--- a/etc/agent-versioning/build.xml
+++ b/etc/agent-versioning/build.xml
@@ -112,7 +112,7 @@ ant -Dserver.home.dir=/my/server/rhq-agent -Dnew.version=0.0.0.GA -Dnew.build=0
<target name="init-server">
<property name="env.RHQ_SERVER_HOME" location="dev-container"/>
<property name="server.home.dir" location="${env.RHQ_SERVER_HOME}"/>
- <property name="server.download.dir" location="${server.home.dir}/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads/rhq-agent"/>
+ <property name="server.download.dir" location="${server.home.dir}/modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent"/>
<available property="_server.download.dir.exists" file="${server.download.dir}"/>
<fail unless="_server.download.dir.exists" message="Cannot find the server download directory at ${server.download.dir}"/>
diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
index 6d17177..481073e 100644
--- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
+++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-
+
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
@@ -9,7 +9,7 @@
<context-param>
<param-name>resteasy.jndi.resources</param-name>
- <param-value>java:app/rhq-enterprise-server-ejb3/InventorySummaryHandler,java:app/rhq-enterprise-server-ejb3/AlertDefinitionHandler,java:app/rhq-enterprise-server-ejb3/ConfigurationHistoryHandler,java:app/rhq-enterprise-server-ejb3/RecentAlertHandler,java:app/rhq-enterprise-server-ejb3/SuspectMetricHandler,java:app/rhq-enterprise-server-ejb3/DriftComplianceHandler,java:app/rhq-enterprise-server-ejb3/RecentOperationsHandler,java:app/rhq-enterprise-server-ejb3/RecentDriftHandler,java:app/rhq-enterprise-server-ejb3/PlatformUtilizationHandler</param-value>
+ <param-value>java:app/rhq-server/InventorySummaryHandler,java:app/rhq-server/AlertDefinitionHandler,java:app/rhq-server/ConfigurationHistoryHandler,java:app/rhq-server/RecentAlertHandler,java:app/rhq-server/SuspectMetricHandler,java:app/rhq-server/DriftComplianceHandler,java:app/rhq-server/RecentOperationsHandler,java:app/rhq-server/RecentDriftHandler,java:app/rhq-server/PlatformUtilizationHandler</param-value>
<!--<description>List of jndi names of EJBs local interfaces that define REST stuff</description>-->
</context-param>
<context-param>
@@ -192,7 +192,7 @@
<servlet>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl</servlet-class>
- </servlet>
+ </servlet>
<servlet>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PlatformUtilizationGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.PlatformUtilizationGWTServiceImpl</servlet-class>
@@ -205,7 +205,7 @@
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TopologyGWTService</servlet-name>
<servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TopologyGWTServiceImpl</servlet-class>
</servlet>
-
+
<servlet>
<servlet-name>Resteasy</servlet-name>
@@ -373,7 +373,7 @@
<servlet-mapping>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI DriftGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DriftGWTService</url-pattern>
- </servlet-mapping>
+ </servlet-mapping>
<servlet-mapping>
<servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PlatformUtilizationGWTService</servlet-name>
<url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/PlatformUtilizationGWTService</url-pattern>
@@ -398,7 +398,7 @@
</welcome-file-list>
- <!-- Uncomment the below to automatically redirect all HTTP requests to the
+ <!-- Uncomment the below to automatically redirect all HTTP requests to the
corresponding HTTPS URLs. -->
<!--
<security-constraint>
diff --git a/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.bat b/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.bat
index 2f197478..68e8706 100644
--- a/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.bat
+++ b/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.bat
@@ -1,16 +1,16 @@
rem This script should consume all the wsdls and compile the JAXB types all
rem into one directory.
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/RoleManagerBean?wsdl -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/RoleManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/ContentManagerBean?wsdl -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/ContentManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/SubjectManagerBean?wsdl -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/SubjectManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/OperationManagerBean... -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/OperationManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/RepoManagerBean?wsdl -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/RepoManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/ConfigurationManager... -p org.rhq.enterprise.server.ws
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/ConfigurationManagerBean?wsdl -p org.rhq.enterprise.server.ws
-call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/ResourceManagerBean?... -p org.rhq.enterprise.server.ws
\ No newline at end of file
+call ../../../../dev-container/jbossas/bin/wsconsume.bat -k http://127.0.0.1:7080/rhq-rhq-server/ResourceManagerBean?wsdl -p org.rhq.enterprise.server.ws
\ No newline at end of file
diff --git a/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.sh b/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.sh
index e229fb4..f83293b 100644
--- a/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.sh
+++ b/modules/enterprise/remoting/cli/src/etc/generate-jaxb-client-types.sh
@@ -3,16 +3,16 @@
# This script should consume all the wsdls and compile the JAXB types all
# into one directory.
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/RoleManagerBean?wsdl -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/RoleManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/ContentManagerBean?wsdl -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/ContentManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/SubjectManagerBean?wsdl -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/SubjectManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/OperationManagerBean... -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/OperationManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/RepoManagerBean?wsdl -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/RepoManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/ConfigurationManager... -p org.rhq.enterprise.server.ws
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/ConfigurationManagerBean?wsdl -p org.rhq.enterprise.server.ws
-../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-enterprise-server-ejb3/ResourceManagerBean?... -p org.rhq.enterprise.server.ws
\ No newline at end of file
+../../../../dev-container/jbossas/bin/wsconsume.sh -k http://localhost:7080/rhq-rhq-server/ResourceManagerBean?wsdl -p org.rhq.enterprise.server.ws
\ No newline at end of file
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index bf06886..a81b6cd 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -80,7 +80,7 @@
<property name="jboss.modules.dir" location="${project.build.outputDirectory}/modules" />
<mkdir dir="${jboss.modules.dir}" />
- <property name="rhq.ear.dir" location="${jboss.modules.dir}/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/${rhq.earName}" />
+ <property name="rhq.ear.dir" location="${jboss.modules.dir}/org/rhq/server-startup/main/deployments/${rhq.earName}" />
<condition property="use-postgres" value="true">
<contains string="${rhq.server.database.type-mapping}" substring="postgres" casesensitive="false" />
@@ -164,7 +164,7 @@
<fail unless="jboss.home.is.valid" message="${jboss.home} does not contain a valid JBossAS installation - aborting!" />
<echo>Adding main EAR app module to ${jboss.modules.dir} ...</echo>
- <unzip src="${settings.localRepository}/org/rhq/rhq-enterprise-server-startup-subsystem/${project.version}/rhq-enterprise-server-startup-subsystem-${project.version}.zip"
+ <unzip src="${settings.localRepository}/org/rhq/server-startup/${project.version}/server-startup-${project.version}.zip"
dest="${jboss.modules.dir}" />
<echo>Adding installer module to ${jboss.modules.dir} ...</echo>
diff --git a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
index ccb90b9..857c268 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
+++ b/modules/enterprise/server/appserver/src/main/scripts/storage_setup.groovy
@@ -168,11 +168,11 @@ def prepareModulesDir(basedir) {
)
ant.symlink(link: "$modulesDir/org/rhq/rhq-server-control", resource: "$defaultModulesDir/org/rhq/rhq-server-control")
- def downloadsDir = "$modulesDir/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads"
+ def downloadsDir = "$modulesDir/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads"
ant.mkdir(dir: downloadsDir)
ant.symlink(
link: "$downloadsDir/rhq-agent",
- resource: "$defaultModulesDir/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads/rhq-agent"
+ resource: "$defaultModulesDir/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent"
)
}
diff --git a/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/LocalClientTest.java b/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/LocalClientTest.java
index 6e2fcf6..f350843 100644
--- a/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/LocalClientTest.java
+++ b/modules/enterprise/server/client-api/src/test/java/org/rhq/enterprise/client/test/LocalClientTest.java
@@ -47,7 +47,7 @@ import org.rhq.enterprise.client.LocalClient;
import org.rhq.test.JMockTest;
/**
- *
+ *
*
* @author Lukas Krejci
*/
@@ -59,29 +59,29 @@ public class LocalClientTest extends JMockTest {
return CONTEXT_MOCK_FOR_TEST;
}
}
-
+
public static Context CONTEXT_MOCK_FOR_TEST = null;
-
+
@BeforeClass
public void setUpNaming() {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY, FakeContextFactory.class.getName());
}
-
+
/**
* Needs to be called from within a test method so that the "context" variable is available.
- *
+ *
* @throws NamingException
*/
private void setupFakeJndiLookup() throws NamingException {
CONTEXT_MOCK_FOR_TEST = context.mock(Context.class);
-
+
context.checking(new Expectations() {{
allowing(CONTEXT_MOCK_FOR_TEST).lookup(with(any(String.class)));
will(new CustomAction("Fake JNDI lookup") {
@Override
public Object invoke(Invocation invocation) throws Throwable {
- // JNDI name format like: java:global/rhq/rhq-enterprise-server-ejb3/SystemManagerBean!org.rhq.enterprise.server.system.SystemManagerLocal
+ // JNDI name format like: java:global/rhq/rhq-server/SystemManagerBean!org.rhq.enterprise.server.system.SystemManagerLocal
String jndiName = (String) invocation.getParameter(0);
String beanName = jndiName.substring(0,jndiName.indexOf('!'));
beanName = beanName.substring(beanName.lastIndexOf('/') + 1);
@@ -105,7 +105,7 @@ public class LocalClientTest extends JMockTest {
});
}
});
-
+
allowing(CONTEXT_MOCK_FOR_TEST).close();
}});
}
@@ -130,15 +130,15 @@ public class LocalClientTest extends JMockTest {
@Test
public void testResilienceAgainstContextClassloaders() throws Exception {
setupFakeJndiLookup();
-
+
ClassLoader origCl = Thread.currentThread().getContextClassLoader();
try {
ClassLoader differentCl = new URLClassLoader(new URL[0], getClass().getClassLoader());
-
+
Thread.currentThread().setContextClassLoader(differentCl);
LocalClient lc = new LocalClient(null);
-
+
//this call creates the proxy and is theoretically prone to the context classloader
Object am = lc.getScriptingAPI().get(RhqManager.AlertManager);
diff --git a/modules/enterprise/server/ear/pom.xml b/modules/enterprise/server/ear/pom.xml
index 0e4bc83..e2a4cdb 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -238,7 +238,7 @@
<ejbModule>
<groupId>${project.groupId}</groupId>
<artifactId>rhq-enterprise-server</artifactId>
- <bundleFileName>rhq-enterprise-server-ejb3.jar</bundleFileName>
+ <bundleFileName>rhq-server.jar</bundleFileName>
</ejbModule>
<ejbClientModule>
@@ -832,7 +832,7 @@
<rhq.rootDir>../../../..</rhq.rootDir>
<rhq.containerDir>${rhq.rootDir}/${rhq.devContainerServerPath}</rhq.containerDir>
<rhq.deploymentName>${project.build.finalName}.ear</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/${rhq.deploymentName}</rhq.deploymentDir>
+ <rhq.deploymentDir>${rhq.containerDir}/modules/org/rhq/server-startup/main/deployments/${rhq.deploymentName}</rhq.deploymentDir>
</properties>
<build>
diff --git a/modules/enterprise/server/ear/src/main/application/META-INF/jboss-deployment-structure.xml b/modules/enterprise/server/ear/src/main/application/META-INF/jboss-deployment-structure.xml
index d0a665d..80a648f 100644
--- a/modules/enterprise/server/ear/src/main/application/META-INF/jboss-deployment-structure.xml
+++ b/modules/enterprise/server/ear/src/main/application/META-INF/jboss-deployment-structure.xml
@@ -33,7 +33,7 @@
</sub-deployment>
<!-- This corresponds to the Server EJB3 JAR -->
- <sub-deployment name="rhq-enterprise-server-ejb3.jar">
+ <sub-deployment name="rhq-server.jar">
<dependencies>
<module name="org.jboss.msc" export="true" />
<module name="org.jboss.as.controller" export="true" />
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 284ddbd..160b5dd 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -49,7 +49,7 @@ import org.rhq.enterprise.server.installer.ServerInstallUtil.SupportedDatabaseTy
*/
public class InstallerServiceImpl implements InstallerService {
- private static final String RHQ_EXTENSION_NAME = "org.rhq.rhq-enterprise-server-startup-subsystem";
+ private static final String RHQ_EXTENSION_NAME = "org.rhq.server-startup";
private static final String RHQ_SUBSYSTEM_NAME = "rhq-startup";
private static final String EAR_NAME = "rhq.ear";
private static final String SYSPROP_PROPFILE = "rhq.server.properties-file";
diff --git a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/JndiAccessTest.java b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/JndiAccessTest.java
index 334e768..1cdc1d5 100644
--- a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/JndiAccessTest.java
+++ b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/client/security/test/JndiAccessTest.java
@@ -34,7 +34,7 @@ import org.rhq.enterprise.server.system.SystemManagerBean;
import org.rhq.enterprise.server.util.LookupUtil;
/**
- *
+ *
*
* @author Lukas Krejci
*/
@@ -59,21 +59,21 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
public void testEjbsAccessibleThroughPrivilegedCode() {
LookupUtil.getSubjectManager().getOverlord();
}
-
+
public void testEjbsAccessibleThroughLocalClient() throws ScriptException, IOException {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+
ScriptEngine engine = getEngine(overlord);
-
+
engine.eval("SubjectManager.getSubjectByName('rhqadmin');");
}
-
+
public void testLocalEjbsInaccessibleThroughJndiLookup() throws ScriptException, IOException {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+
ScriptEngine engine = getEngine(overlord);
-
- String jndiName = "java:global/rhq/rhq-enterprise-server-ejb3/"
+
+ String jndiName = "java:global/rhq/rhq-server/"
+ SystemManagerBean.class.getSimpleName()
+ "!"
+ SystemManagerBean.class.getName().replace("Bean", "Local");
@@ -85,19 +85,19 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
+ jndiName
+ "');\n"
+ "systemManager.isDebugModeEnabled();");
-
+
Assert.fail("The script shouldn't have been able to call local SLSB method.");
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
}
}
-
+
public void testLocalEjbsInaccessibleThroughJndiLookupWithCustomUrlPackages() throws ScriptException, IOException {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
ScriptEngine engine = getEngine(overlord);
- String jndiName = "java:global/rhq/rhq-enterprise-server-ejb3/"
+ String jndiName = "java:global/rhq/rhq-server/"
+ SystemManagerBean.class.getSimpleName()
+ "!"
+ SystemManagerBean.class.getName().replace("Bean", "Local");
@@ -122,10 +122,10 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
public void testRemoteEjbsInaccessibleThroughJndiLookup() throws ScriptException, IOException {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+
ScriptEngine engine = getEngine(overlord);
- String jndiName = "java:global/rhq/rhq-enterprise-server-ejb3/"
+ String jndiName = "java:global/rhq/rhq-server/"
+ SystemManagerBean.class.getSimpleName()
+ "!"
+ SystemManagerBean.class.getName().replace("Bean", "Remote");
@@ -137,28 +137,28 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
+ jndiName
+ "');\n"
+ "systemManager.getSystemSettings(subject);");
-
+
Assert.fail("The script shouldn't have been able to call remote SLSB method directly.");
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
}
}
-
+
public void testScriptCantUseSessionManagerMethods() throws Exception {
- Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+
final ScriptEngine engine = getEngine(overlord);
-
+
class G {
private String sessionManager = ""
+ "org.rhq.enterprise.server.auth.SessionManager.getInstance().";
-
+
public void testInvoke(String methodCall) throws ScriptException {
String code = sessionManager + methodCall;
try {
- engine.eval(code);
+ engine.eval(code);
Assert.fail("The script shouldn't have been able to call a method on a SessionManager: " + methodCall);
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
@@ -166,7 +166,7 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
}
};
G manager = new G();
-
+
manager.testInvoke("getLastAccess(0);");
manager.testInvoke("getOverlord()");
manager.testInvoke("getSubject(2);");
@@ -175,27 +175,27 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
manager.testInvoke("put(new org.rhq.core.domain.auth.Subject());");
manager.testInvoke("put(new org.rhq.core.domain.auth.Subject(), 0);");
}
-
+
public void testScriptCantObtainRawJDBCConnectionsWithoutCredentials() throws Exception {
Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+
ScriptEngine engine = getEngine(overlord);
-
+
try {
engine.eval(""
+ "var ctx = new javax.naming.InitialContext();\n"
+ "var datasource = ctx.lookup('" + RHQConstants.DATASOURCE_JNDI_NAME + "');\n"
+ "con = datasource.getConnection();");
-
+
Assert.fail("The script shouldn't have been able to obtain the datasource from the JNDI.");
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
}
}
-
+
public void testScriptCantUseEntityManager() throws Exception {
- Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+
ScriptEngine engine = getEngine(overlord);
try {
@@ -204,12 +204,12 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
+ "var entityManagerFactory = ctx.lookup('" + RHQConstants.ENTITY_MANAGER_JNDI_NAME + "');\n"
+ "var entityManager = entityManagerFactory.createEntityManager();\n"
+ "entityManager.find(java.lang.Class.forName('org.rhq.core.domain.resource.Resource'), java.lang.Integer.valueOf('10001'));");
-
+
Assert.fail("The script shouldn't have been able to use the EntityManager.");
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
- }
-
+ }
+
//try harder with manually specifying the initial context factory
try {
engine.eval(""
@@ -220,20 +220,20 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
+ "var entityManagerFactory = ctx.lookup('" + RHQConstants.ENTITY_MANAGER_JNDI_NAME + "');\n"
+ "var entityManager = entityManagerFactory.createEntityManager();\n"
+ "entityManager.find(java.lang.Class.forName('org.rhq.core.domain.resource.Resource'), java.lang.Integer.valueOf('10001'));");
-
+
Assert.fail("The script shouldn't have been able to use the EntityManager even using custom initial context factory.");
} catch (ScriptException e) {
checkIsDesiredSecurityException(e);
- }
+ }
}
public void testProxyFactoryWorksWithSecuredScriptEngine() throws Exception {
- Subject overlord = LookupUtil.getSubjectManager().getOverlord();
-
+ Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+
ScriptEngine engine = getEngine(overlord);
-
+
try {
- engine.eval("var resource = ProxyFactory.getResource(10001);");
+ engine.eval("var resource = ProxyFactory.getResource(10001);");
} catch (ScriptException e) {
//if the script fails (there is no resource with ID 10001)
//it should not be because of an access control exception
@@ -243,10 +243,10 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
//THIS IS A NEW REQUIREMENT THAT DOESN'T CURRENTLY WORK...
// public void testInitialContextFactoryBuilderNotReplaceableUsingScripts() throws Exception {
- // Subject overlord = LookupUtil.getSubjectManager().getOverlord();
- //
+ // Subject overlord = LookupUtil.getSubjectManager().getOverlord();
+ //
// ScriptEngine engine = getEngine(overlord);
- //
+ //
// try {
// engine.eval(""
// + "var mgrCls = java.lang.Class.forName('javax.naming.spi.NamingManager');\n"
@@ -262,11 +262,11 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
// NamingHack.bruteForceInitialContextFactoryBuilder();
// }
// }
-
+
private static void checkIsDesiredSecurityException(ScriptException e) {
String message = e.getMessage();
String permissionTrace = "org.rhq.allow.server.internals.access";
-
+
if (!message.contains(permissionTrace)) {
Assert
.fail(
@@ -278,7 +278,7 @@ public class JndiAccessTest extends ScriptableAbstractEJB3Test {
private static void checkIsNotASecurityException(ScriptException e) {
String message = e.getMessage();
String permissionTrace = "org.rhq.allow.server.internals.access";
-
+
if (message.contains(permissionTrace)) {
Assert
.fail(
diff --git a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
index 9ddba97..4dfbd46 100644
--- a/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
+++ b/modules/enterprise/server/itests-2/src/test/java/org/rhq/enterprise/server/test/AbstractEJB3Test.java
@@ -124,20 +124,20 @@ public abstract class AbstractEJB3Test extends Arquillian {
// we need a way to deploy dependent ears needed to support the server/jar classes. But
// building this jar up (as is done in core/domain) was too difficult due to the huge number
// of dependencies. It was easier, and made sense, to use the already built rhq.ear
- // and run as true integration tests. We do thin rhq.ear by removing all of the WAR files, and
+ // and run as true integration tests. We do thin rhq.ear by removing all of the WAR files, and
// deploy only the EJB jars, and the services, which are really the objects under test.
@Deployment
protected static EnterpriseArchive getBaseDeployment() {
- // Ensure the test working dir exists
+ // Ensure the test working dir exists
tmpdirRoot.mkdirs();
// deploy the test classes in their own jar, under /lib
JavaArchive testClassesJar = ShrinkWrap.create(JavaArchive.class, "test-classes.jar");
testClassesJar = addClasses(testClassesJar, new File("target/test-classes/org"), null);
- // add non itests-2 RHQ classes used by the test classes, as well as needed resources
+ // add non itests-2 RHQ classes used by the test classes, as well as needed resources
testClassesJar.addClass(ThrowableUtil.class);
testClassesJar.addClass(MessageDigestGenerator.class);
testClassesJar.addClass(StreamUtil.class);
@@ -340,22 +340,22 @@ public abstract class AbstractEJB3Test extends Arquillian {
.withoutTransitivity().asSingle(EnterpriseArchive.class);
// merge rhq.ear into testEar but include only the EJB jars and the supporting libraries. Note that we
// don't include the services sar because tests are responsible for prepare/unprepare of all required services,
- // we don't want the production services performing any unexpected work.
+ // we don't want the production services performing any unexpected work.
testEar = testEar.merge(rhqEar, Filters.include("/lib.*|/rhq.*ejb3\\.jar.*"));
// remove startup beans and shutdown listeners, we don't want this to be a full server deployment. The tests
// start/stop what they need, typically with test services or mocks.
testEar.delete(ArchivePaths
- .create("/rhq-enterprise-server-ejb3.jar/org/rhq/enterprise/server/core/StartupBean.class"));
+ .create("/rhq-server.jar/org/rhq/enterprise/server/core/StartupBean.class"));
testEar.delete(ArchivePaths
- .create("/rhq-enterprise-server-ejb3.jar/org/rhq/enterprise/server/core/StartupBean$1.class"));
+ .create("/rhq-server.jar/org/rhq/enterprise/server/core/StartupBean$1.class"));
testEar.delete(ArchivePaths
- .create("/rhq-enterprise-server-ejb3.jar/org/rhq/enterprise/server/core/ShutdownListener.class"));
+ .create("/rhq-server.jar/org/rhq/enterprise/server/core/ShutdownListener.class"));
//replace the above startup beans with stripped down versions
testEar.add(new ClassAsset(StrippedDownStartupBean.class), ArchivePaths
- .create("/rhq-enterprise-server-ejb3.jar/org/rhq/enterprise/server/test/StrippedDownStartupBean.class"));
+ .create("/rhq-server.jar/org/rhq/enterprise/server/test/StrippedDownStartupBean.class"));
testEar.add(new ClassAsset(StrippedDownStartupBeanPreparation.class), ArchivePaths
- .create("/rhq-enterprise-server-ejb3.jar/org/rhq/enterprise/server/test/"
+ .create("/rhq-server.jar/org/rhq/enterprise/server/test/"
+ "StrippedDownStartupBeanPreparation.class"));
testEar.addAsManifestResource(new ByteArrayAsset("<beans/>".getBytes()), ArchivePaths.create("beans.xml"));
@@ -368,7 +368,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
// add the application xml declaring the ejb jars
testEar.setApplicationXML("application.xml");
- // add additional 3rd party dependent jars needed to support test classes
+ // add additional 3rd party dependent jars needed to support test classes
Collection thirdPartyDeps = new ArrayList();
thirdPartyDeps.add("joda-time:joda-time");
thirdPartyDeps.add("org.jboss.shrinkwrap:shrinkwrap-impl-base");
@@ -496,15 +496,15 @@ public abstract class AbstractEJB3Test extends Arquillian {
/**
* <p>DO NOT OVERRIDE.</p>
* <p>DO NOT DEFINE AN @BeforeMethod</p>
- *
+ *
* Instead, override {@link #beforeMethod()}. If you must override, for example, if you
* need to use special attributes on your annotation, then ensure you protect the code with
* and {@link #inContainer()} call.
*/
@BeforeMethod
protected void __beforeMethod(Method method) throws Throwable {
- // Note that Arquillian calls the testng BeforeMethod twice (as of 1.0.2.Final, once
- // out of container and once in container. In general the expectation is to execute it
+ // Note that Arquillian calls the testng BeforeMethod twice (as of 1.0.2.Final, once
+ // out of container and once in container. In general the expectation is to execute it
// one time, and doing it in container allows for the expected injections and context.
if (inContainer()) {
try {
@@ -539,7 +539,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
/**
* <p>DO NOT OVERRIDE.</p>
* <p>DO NOT DEFINE AN @AfterMethod</p>
- *
+ *
* Instead, override {@link #afterMethod()}.
*/
@AfterMethod(alwaysRun = true)
@@ -559,33 +559,33 @@ public abstract class AbstractEJB3Test extends Arquillian {
}
protected boolean inContainer() {
- // If the injection is done we're running in the container.
+ // If the injection is done we're running in the container.
return (null != initialContext);
}
/**
- * Override Point! Do not implement a @BeforeMethod, instead override this method.
+ * Override Point! Do not implement a @BeforeMethod, instead override this method.
*/
protected void beforeMethod() throws Exception {
// do nothing if we're not overridden
}
/**
- * Override Point! Do not implement a @BeforeMethod, instead override this method.
+ * Override Point! Do not implement a @BeforeMethod, instead override this method.
*/
protected void beforeMethod(Method method) throws Exception {
// do nothing if we're not overridden
}
/**
- * Override Point! Do not implement an @AfterMethod, instead override this method. note: alwaysRun=true
+ * Override Point! Do not implement an @AfterMethod, instead override this method. note: alwaysRun=true
*/
protected void afterMethod() throws Exception {
// do nothing if we're not overridden
}
/**
- * Override Point! Do not implement an @AfterMethod, instead override this method. note: alwaysRun=true
+ * Override Point! Do not implement an @AfterMethod, instead override this method. note: alwaysRun=true
*/
protected void afterMethod(ITestResult result, Method meth) throws Exception {
// do nothing if we're not overridden
@@ -706,7 +706,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
}
/* The old AbstractEJB3Test impl extended AssertJUnit. Continue to support the used methods
- * with various call-thru methods.
+ * with various call-thru methods.
*/
protected void assertNotNull(Object o) {
@@ -1020,7 +1020,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
scanner.setAgentPluginDir(pluginDirPath); // we don't want to scan for these
scanner.setServerPluginDir("ignore no plugins here"); // we don't want to scan for these
scanner.setUserPluginDir("ignore no plugins here"); // we don't want to scan for these
- scanner.setScanPeriod("9999999"); // we want to manually scan - don't allow for auto-scan to happen
+ scanner.setScanPeriod("9999999"); // we want to manually scan - don't allow for auto-scan to happen
return preparePluginScannerService(scanner);
}
@@ -1028,7 +1028,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
/**
* Note that the standard plugin scanner service is deployed automatically with the test rhq ear,
* this is only necessary if you want a custom service.
- *
+ *
* @param scannerService
*/
public PluginDeploymentScannerMBean preparePluginScannerService(PluginDeploymentScannerMBean scannerService) {
@@ -1072,7 +1072,7 @@ public abstract class AbstractEJB3Test extends Arquillian {
* annotations by creating sessions for different users with different permissions.
*
* @param subject a JON subject
- * @return the session activated subject, a copy of the subject passed in.
+ * @return the session activated subject, a copy of the subject passed in.
*/
public Subject createSession(Subject subject) {
return SessionManager.getInstance().put(subject);
@@ -1086,9 +1086,9 @@ public abstract class AbstractEJB3Test extends Arquillian {
* A utility for writing out various objects that need to be persisted for use between
* tests. Arquillian (1.0.2) basically "new"s the testng test class on each test, so instance
* variables can not be used between tests. Instead, the db or this mechanism needs to be used.
- *
+ *
* The file will be placed in the standard temp dir. If it already exists it will be replaced.
- *
+ *
* @param filename Do not include the directory. The value will be prepended with the class name.
* @param objects
* @throws Exception
@@ -1106,9 +1106,9 @@ public abstract class AbstractEJB3Test extends Arquillian {
/**
* A utility for reading in objects written with {@link #writeObjects(String, Object...). They are
* placed in the result List in the same order they were written.
- *
+ *
* @param filename The same filename used in the write. Do not include the directory.
- * @param numObjects the number of objects to read out. Can be less than total written, not greater.
+ * @param numObjects the number of objects to read out. Can be less than total written, not greater.
* @throws Exception
*/
protected List<Object> readObjects(String filename, int numObjects) throws Exception {
@@ -1130,16 +1130,16 @@ public abstract class AbstractEJB3Test extends Arquillian {
/**
* A utility for cleaning up files created with {@link #writeObjects(String, Object...).
- *
- * @param filename The same filename used in the write. Do not include the directory.
- * @return true if deleted, false otherwise.
+ *
+ * @param filename The same filename used in the write. Do not include the directory.
+ * @return true if deleted, false otherwise.
*/
protected boolean deleteObjects(String filename) {
File file = new File(getTempDir(), filename);
return file.delete();
}
- /**
+ /**
* @return a temp directory for testing that is specific to this test class. Specifically tmpdirRoot/this.getClass().getSimpleName().
*/
public File getTempDir() {
diff --git a/modules/enterprise/server/itests-2/src/test/resources/application.xml b/modules/enterprise/server/itests-2/src/test/resources/application.xml
index 06b81e6..e28f755 100644
--- a/modules/enterprise/server/itests-2/src/test/resources/application.xml
+++ b/modules/enterprise/server/itests-2/src/test/resources/application.xml
@@ -6,6 +6,6 @@
<ejb>rhq-core-domain-ejb3.jar</ejb>
</module>
<module>
- <ejb>rhq-enterprise-server-ejb3.jar</ejb>
- </module>
+ <ejb>rhq-server.jar</ejb>
+ </module>
</application>
\ No newline at end of file
diff --git a/modules/enterprise/server/itests-2/src/test/resources/jboss-deployment-structure.xml b/modules/enterprise/server/itests-2/src/test/resources/jboss-deployment-structure.xml
index 48a80f2..1b5ceb9 100644
--- a/modules/enterprise/server/itests-2/src/test/resources/jboss-deployment-structure.xml
+++ b/modules/enterprise/server/itests-2/src/test/resources/jboss-deployment-structure.xml
@@ -20,7 +20,7 @@
</deployment>
<!-- This corresponds to the Server EJB3 JAR -->
- <sub-deployment name="rhq-enterprise-server-ejb3.jar">
+ <sub-deployment name="rhq-server.jar">
<dependencies>
<module name="org.jboss.msc" export="true" />
<module name="org.jboss.as.controller" export="true" />
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteSafeInvocationHandler.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteSafeInvocationHandler.java
index 3a435ef..2602cf8 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteSafeInvocationHandler.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteSafeInvocationHandler.java
@@ -44,8 +44,8 @@ import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility;
* Although, we execute only locals to bypass the serialization performed by a remote invocation. Even
* though this handler is co-located, for remotes, remoting will serialize the return data immediately.
* This is bad for us because since we return domain objects we ned to scrub the data, removing
- * hibernate proxies (see {@link HibernateDetachUtility}.
- *
+ * hibernate proxies (see {@link HibernateDetachUtility}.
+ *
* @author Greg Hinkle
* @autor Jay Shaughnessy
*/
@@ -103,7 +103,7 @@ public class RemoteSafeInvocationHandler implements ServerInvocationHandler {
Object target = ic.lookup(jndiName);
Method m = target.getClass().getMethod(methodInfo[1], sig);
- // switch to the local
+ // switch to the local
jndiName = getLocalJNDIName(remoteClass);
target = ic.lookup(jndiName);
@@ -146,12 +146,12 @@ public class RemoteSafeInvocationHandler implements ServerInvocationHandler {
}
private static <T> String getLocalJNDIName(Class<?> remoteClass) {
- return ("java:global/rhq/rhq-enterprise-server-ejb3/" + remoteClass.getSimpleName().replace("Remote", "Bean")
+ return ("java:global/rhq/rhq-server/" + remoteClass.getSimpleName().replace("Remote", "Bean")
+ "!" + remoteClass.getName().replace("Remote", "Local"));
}
private static <T> String getRemoteJNDIName(Class<?> remoteClass) {
- return ("java:global/rhq/rhq-enterprise-server-ejb3/" + remoteClass.getSimpleName().replace("Remote", "Bean")
+ return ("java:global/rhq/rhq-server/" + remoteClass.getSimpleName().replace("Remote", "Bean")
+ "!" + remoteClass.getName());
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 7b60e13..d597363 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -482,7 +482,7 @@ public final class LookupUtil {
public static TopologyManagerLocal getTopologyManager() {
return lookupLocal(TopologyManagerBean.class);
}
-
+
public static StorageNodeManagerLocal getStorageNodeManager() {
return lookupLocal(StorageNodeManagerBean.class);
}
@@ -636,10 +636,10 @@ public final class LookupUtil {
/**
* Generic method to lookup an Ejb bean by name and the interface name
- *
+ *
* @param beanName the name of the EJB bean
* @param interfaceName the full class name of either the remote or local interface
- *
+ *
* @return the bean accessed through specified interface
*/
public static Object getEjb(String beanName, String interfaceName) {
@@ -656,7 +656,7 @@ public final class LookupUtil {
// Private Methods
private static String getLocalJNDIName(String beanName, String interfaceName) {
- return "java:global/rhq/rhq-enterprise-server-ejb3/" + beanName + "!" + interfaceName;
+ return "java:global/rhq/rhq-server/" + beanName + "!" + interfaceName;
}
private static <T> String getLocalJNDIName(@NotNull
@@ -673,7 +673,7 @@ public final class LookupUtil {
*/
private static <T> String getRemoteJNDIName(@NotNull
Class<? extends T> beanClass) {
- return ("java:global/rhq/rhq-enterprise-server-ejb3/" + beanClass.getSimpleName() + "!" + beanClass.getName()
+ return ("java:global/rhq/rhq-server/" + beanClass.getSimpleName() + "!" + beanClass.getName()
.replace("Bean", "Remote"));
}
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
index 91ccc85..f529be9 100644
--- 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
@@ -1,5 +1,5 @@
# 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
+rhq.server.agent-files-directory=${rhq.server.home}/modules/org/rhq/server-startup/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
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index df07b5a..bb6aa40 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -354,7 +354,7 @@ public class Install extends AbstractInstall {
private File getAgentInstaller() {
File agentDownloadDir = new File(getBaseDir(),
- "modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads/rhq-agent");
+ "modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/rhq-agent");
return agentDownloadDir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
diff --git a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
index 37667c6..9245baf 100644
--- a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
+++ b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Upgrade.java
@@ -571,7 +571,7 @@ public class Upgrade extends AbstractInstall {
private File getFileDownload(String directory, final String fileMatch) {
File downloadDir = new File(getBaseDir(),
- "modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/rhq-downloads/"
+ "modules/org/rhq/server-startup/main/deployments/rhq.ear/rhq-downloads/"
+ directory);
return downloadDir.listFiles(new FileFilter() {
@Override
diff --git a/modules/enterprise/server/startup-subsystem/pom.xml b/modules/enterprise/server/startup-subsystem/pom.xml
index 3b5b2ba..e69df2e 100644
--- a/modules/enterprise/server/startup-subsystem/pom.xml
+++ b/modules/enterprise/server/startup-subsystem/pom.xml
@@ -13,7 +13,7 @@
<relativePath>../../../../pom.xml</relativePath>
</parent>
- <artifactId>rhq-enterprise-server-startup-subsystem</artifactId>
+ <artifactId>server-startup</artifactId>
<name>RHQ Server Startup AS7 Subsystem</name>
@@ -106,7 +106,7 @@
<artifactId>jboss-as-ee</artifactId>
<scope>provided</scope>
</dependency>
-
+
<!-- our startup subsystem will be deploying this -->
<dependency>
<groupId>org.rhq</groupId>
diff --git a/pom.xml b/pom.xml
index d52dcc7..26703d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,7 +42,7 @@
<rhq.defaultDevContainerPath>dev-container</rhq.defaultDevContainerPath>
<rhq.devContainerServerPath>${rhq.defaultDevContainerPath}/rhq-server</rhq.devContainerServerPath>
<!-- path relative to under dev container path where the EAR is deployed -->
- <rhq.earDeployDir>modules/org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/${rhq.earName}</rhq.earDeployDir>
+ <rhq.earDeployDir>modules/org/rhq/server-startup/main/deployments/${rhq.earName}</rhq.earDeployDir>
<!-- path relative to under dev container path where other things are stored -->
<rhq.agentPluginDir>${rhq.earDeployDir}/rhq-downloads/rhq-plugins</rhq.agentPluginDir>
<rhq.serverPluginDir>${rhq.earDeployDir}/rhq-serverplugins</rhq.serverPluginDir>
10 years, 10 months
[rhq] .classpath
by mazz
.classpath | 1 +
1 file changed, 1 insertion(+)
New commits:
commit d3336fcd24c36f257a0702b13114b95146d44d83
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 11 14:04:39 2013 -0400
cassandra-installer uses a commons-io 2.1 API, we need to put this up front in classpath in eclipse
diff --git a/.classpath b/.classpath
index f09f8ed..e5e7a21 100644
--- a/.classpath
+++ b/.classpath
@@ -217,6 +217,7 @@
<classpathentry kind="src" path="modules/enterprise/server/data-migration/src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.2.3/httpclient-4.2.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.2.3/httpclient-4.2.3-sources.jar"/>
+ <classpathentry exported="true" kind="var" path="M2_REPO/commons-io/commons-io/2.1/commons-io-2.1.jar" sourcepath="M2_REPO/commons-io/commons-io/2.1/commons-io-2.1-sources.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.2.2/httpcore-4.2.2.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.2.2/httpcore-4.2.2-sources.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/apache/httpcomponents/httpmime/4.2.3/httpmime-4.2.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpmime/4.2.3/httpmime-4.2.3-sources.jar"/>
<classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/integration/jboss-profileservice-spi/5.1.0.SP1/jboss-profileservice-spi-5.1.0.SP1.jar"/>
10 years, 10 months
[rhq] modules/plugins
by Remy Maucherat
modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java | 41 ++++++----
1 file changed, 26 insertions(+), 15 deletions(-)
New commits:
commit 794d564b16b697870ca92040f27acbcdcad63522
Author: Rémy Maucherat <rmaucher(a)redhat.com>
Date: Thu Jul 11 15:33:55 2013 +0200
BZ863502: Fix OOM connecting to Tomcat instance. Patch by Thomas Segismont.
diff --git a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
index f1e2c51..1b595db 100644
--- a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
+++ b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
@@ -1,24 +1,20 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2010 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
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * 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 and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser 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.
+ * 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.jboss.on.plugins.tomcat;
@@ -195,10 +191,9 @@ public class TomcatServerComponent<T extends ResourceComponent<?>> implements JM
// to have a version compatible local install and set the install path to the local path, even though
// the server url was remote.
String catalinaHome = pluginConfig.getSimpleValue(PLUGIN_CONFIG_CATALINA_HOME_PATH, null);
- boolean hasLocalJars = new File(catalinaHome).isDirectory();
-
- if (hasLocalJars) {
- connectionSettings.setLibraryURI(catalinaHome);
+ File libDir = getLibDir(catalinaHome);
+ if (libDir != null) {
+ connectionSettings.setLibraryURI(libDir.getAbsolutePath());
connectionFactory.discoverServerClasses(connectionSettings);
// Tell EMS to make copies of jar files so that the ems classloader doesn't lock
@@ -276,6 +271,22 @@ public class TomcatServerComponent<T extends ResourceComponent<?>> implements JM
return connection;
}
+ private File getLibDir(String catalinaHome) {
+ if (catalinaHome != null) {
+ // Tomcat 6 and Tomcat 7 have Catalina JARS in CATALINA_HOME/lib
+ File libDir = new File(catalinaHome, "lib");
+ if (libDir.isDirectory()) {
+ return libDir;
+ }
+ // Tomcat 5.5 has Catalina JARS in CATALINA_HOME/server/lib
+ libDir = new File(catalinaHome, "server" + File.separator + "lib");
+ if (libDir.isDirectory()) {
+ return libDir;
+ }
+ }
+ return null;
+ }
+
public Configuration getPluginConfiguration() {
return resourceContext.getPluginConfiguration();
}
@@ -485,4 +496,4 @@ public class TomcatServerComponent<T extends ResourceComponent<?>> implements JM
operationParameters.put(shutdownScriptEnv);
}
}
-}
\ No newline at end of file
+}
10 years, 10 months
[rhq] modules/plugins
by Thomas Segismont
modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java | 105 ++++------
1 file changed, 50 insertions(+), 55 deletions(-)
New commits:
commit 6b054aa471107a3894fc45ea2ed97c7f8615562f
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Thu Jul 11 15:29:55 2013 +0200
Improve CassandraNodeComponent availability check performance.
Keep a reference of the ProcessInfo instance and get a new one only if needed.
diff --git a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
index 90afafb..0037bfe 100644
--- a/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
+++ b/modules/plugins/cassandra/src/main/java/org/rhq/plugins/cassandra/CassandraNodeComponent.java
@@ -1,30 +1,25 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-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
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
+ * 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 and the GNU Lesser General Public License
- * for more details.
+ * GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * and the GNU Lesser 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.
+ * 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.plugins.cassandra;
-import static org.rhq.core.domain.measurement.AvailabilityType.DOWN;
-import static org.rhq.core.domain.measurement.AvailabilityType.UNKNOWN;
-import static org.rhq.core.domain.measurement.AvailabilityType.UP;
+import static java.util.concurrent.TimeUnit.NANOSECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.rhq.core.system.OperatingSystemType.WINDOWS;
import java.io.File;
@@ -65,6 +60,7 @@ import org.rhq.core.pluginapi.util.ProcessExecutionUtility;
import org.rhq.core.system.ProcessExecution;
import org.rhq.core.system.ProcessExecutionResults;
import org.rhq.core.system.ProcessInfo;
+import org.rhq.core.system.ProcessInfo.ProcessInfoSnapshot;
import org.rhq.core.system.SystemInfo;
import org.rhq.core.util.StringUtil;
import org.rhq.core.util.exception.ThrowableUtil;
@@ -75,17 +71,19 @@ import org.rhq.plugins.jmx.JMXServerComponent;
* @author John Sanda
*/
public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent<?>> implements OperationFacet {
-
- private Log log = LogFactory.getLog(CassandraNodeComponent.class);
+ private static final Log LOG = LogFactory.getLog(CassandraNodeComponent.class);
private Session cassandraSession;
private String host;
+ private ProcessInfo processInfo;
@SuppressWarnings("rawtypes")
@Override
public void start(ResourceContext context) throws Exception {
super.start(context);
+ processInfo = context.getNativeProcess();
+
host = context.getPluginConfiguration().getSimpleValue("host", "localhost");
String clusterName = context.getPluginConfiguration().getSimpleValue("clusterName", "unknown");
String username = context.getPluginConfiguration().getSimpleValue("username", "cassandra");
@@ -98,7 +96,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
nativePort = Integer.parseInt(context.getPluginConfiguration()
.getSimpleValue("nativeTransportPort", "9042"));
} catch (Exception e) {
- log.debug("Native transport port parsing failed...", e);
+ LOG.debug("Native transport port parsing failed...", e);
}
@@ -115,42 +113,39 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
this.cassandraSession = clusterBuilder.build().connect(clusterName);
} catch (Exception e) {
- log.error("Connect to Cassandra " + host + ":" + nativePort, e);
+ LOG.error("Connect to Cassandra " + host + ":" + nativePort, e);
throw e;
}
};
@Override
public void stop() {
- log.info("Shutting down Cassandra client");
+ processInfo = null;
+ LOG.info("Shutting down Cassandra client");
cassandraSession.getCluster().shutdown();
- log.info("Shutdown is complete");
+ LOG.info("Shutdown is complete");
}
@Override
public AvailabilityType getAvailability() {
- long start = System.currentTimeMillis();
+ long start = System.nanoTime();
try {
- ResourceContext<?> context = getResourceContext();
- ProcessInfo processInfo = context.getNativeProcess();
-
- if (processInfo == null) {
- return UNKNOWN;
- } else {
- // It is safe to read prior snapshot as getNativeProcess always return a fresh instance
- // ProcessInfoSnapshot processInfoSnaphot = processInfo.freshSnapshot();
- if (processInfo.priorSnaphot().isRunning()) {
- return UP;
- } else {
- return DOWN;
- }
+ // Get a fresh snapshot of the process
+ ProcessInfoSnapshot processInfoSnapshot = (processInfo == null) ? null : processInfo.freshSnapshot();
+ if (processInfoSnapshot == null || !processInfoSnapshot.isRunning()) {
+ processInfo = getResourceContext().getNativeProcess();
+ // Safe to get prior snapshot here, we've just recreated the process info instance
+ processInfoSnapshot = (processInfo == null) ? null : processInfo.priorSnaphot();
}
+ return (processInfoSnapshot != null && processInfoSnapshot.isRunning()) ? AvailabilityType.UP
+ : AvailabilityType.DOWN;
} finally {
- long end = System.currentTimeMillis();
- long totalTime = end - start;
- log.debug("Finished availability check in " + totalTime + " ms");
- if (totalTime > (1000 * 5)) {
- log.warn("Availability check exceeded five seconds. Total time was " + totalTime + " ms");
+ long totalTimeMillis = NANOSECONDS.toMillis(System.nanoTime() - start);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Finished availability check in " + totalTimeMillis + " ms");
+ }
+ if (totalTimeMillis > SECONDS.toMillis(5)) {
+ LOG.warn("Availability check exceeded five seconds. Total time was " + totalTimeMillis + " ms");
}
}
}
@@ -175,28 +170,28 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
protected OperationResult shutdownNode() {
ResourceContext<?> context = getResourceContext();
- if (log.isInfoEnabled()) {
- log.info("Starting shutdown operation on " + CassandraNodeComponent.class.getName() +
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Starting shutdown operation on " + CassandraNodeComponent.class.getName() +
" with resource key " + context.getResourceKey());
}
EmsConnection emsConnection = getEmsConnection();
EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
Class[] emptyParams = new Class[0];
- if (log.isDebugEnabled()) {
- log.debug("Disabling thrift...");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Disabling thrift...");
}
EmsOperation operation = storageService.getOperation("stopRPCServer", emptyParams);
operation.invoke((Object[]) emptyParams);
- if (log.isDebugEnabled()) {
- log.debug("Disabling gossip...");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Disabling gossip...");
}
operation = storageService.getOperation("stopGossiping", emptyParams);
operation.invoke((Object[]) emptyParams);
- if (log.isDebugEnabled()) {
- log.debug("Initiating drain...");
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Initiating drain...");
}
operation = storageService.getOperation("drain", emptyParams);
operation.invoke((Object[]) emptyParams);
@@ -207,7 +202,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
process.kill("KILL");
return new OperationResult("Successfully shut down Cassandra daemon with pid " + pid);
} catch (SigarException e) {
- log.warn("Failed to shut down Cassandra node with pid " + pid, e);
+ LOG.warn("Failed to shut down Cassandra node with pid " + pid, e);
OperationResult failure = new OperationResult("Failed to shut down Cassandra node with pid " + pid);
failure.setErrorMessage(ThrowableUtil.getAllMessages(e));
return failure;
@@ -256,7 +251,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
try {
updateSeedsList(addresses);
} catch (Exception e) {
- log.error("An error occurred while updating the seeds list property", e);
+ LOG.error("An error occurred while updating the seeds list property", e);
Throwable rootCause = ThrowableUtil.getRootCause(e);
result.setErrorMessage(ThrowableUtil.getStackAsString(rootCause));
}
@@ -277,7 +272,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
try {
addresses = convertToIPAddresses(seeds);
} catch (UnknownHostException e) {
- log.error("Failed to update seeds list", e);
+ LOG.error("Failed to update seeds list", e);
throw new IOException("Failed to update seeds list. Make sure that " + seeds + " is a list of valid " +
"hostnames or IP addresses that can be resolved.", e);
}
@@ -329,7 +324,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
if (!yamlFile.delete()) {
String msg = "Failed to delete [" + yamlFile + "] in preparation of writing updated configuration. The " +
"changes will be aborted.";
- log.error(msg);
+ LOG.error(msg);
deleteYamlBackupFile(yamlFileBackup);
throw new IOException(msg);
}
@@ -339,8 +334,8 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
yaml.dump(cassandraConfig, writer);
deleteYamlBackupFile(yamlFileBackup);
} catch (Exception e) {
- log.error("An error occurred while trying to write the updated configuration back to " + yamlFile, e);
- log.error("Reverting changes to " + yamlFile);
+ LOG.error("An error occurred while trying to write the updated configuration back to " + yamlFile, e);
+ LOG.error("Reverting changes to " + yamlFile);
if (yamlFile.delete()) {
StreamUtil.copy(new FileInputStream(yamlFileBackup), new FileOutputStream(yamlFile));
@@ -348,7 +343,7 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
} else {
String msg = "Failed updates to " + yamlFile.getName() + " cannot be rolled back. The file cannot be " +
"deleted. " + yamlFile + " should be replaced by " + yamlFileBackup;
- log.error(msg);
+ LOG.error(msg);
throw new IOException(msg);
}
} finally {
@@ -367,8 +362,8 @@ public class CassandraNodeComponent extends JMXServerComponent<ResourceComponent
private void deleteYamlBackupFile(File yamlBackup) {
if (!yamlBackup.delete()) {
- log.warn("Failed to delete Cassandra configuration backup file [" + yamlBackup + "]. This file " +
- "should be deleted.");
+ LOG.warn("Failed to delete Cassandra configuration backup file [" + yamlBackup + "]. This file " +
+ "should be deleted.");
}
}
10 years, 10 months
[rhq] etc/scripts
by John Sanda
etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 3f21a52f2eeef0e5b46f9002980e158ff26f21d9
Author: John Sanda <jsanda(a)redhat.com>
Date: Thu Jul 11 09:18:02 2013 -0400
don't use $TMPDIR since it might not be defined on all platforms
diff --git a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
index 947155f..8a83320 100755
--- a/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
+++ b/etc/scripts/rhq48-storage-patch/rhq48-storage-patch.sh
@@ -23,7 +23,7 @@ PATCH="apache-cassandra-1.2.4-patch-1.jar"
# swap out the Cassandra jar file with the patched version
echo "Copying patch file to $RHQ_SERVER_DIR/rhq-storage/lib"
-mv $RHQ_SERVER_DIR/rhq-storage/lib/apache-cassandra-1.2.4.jar $TMPDIR
+mv $RHQ_SERVER_DIR/rhq-storage/lib/apache-cassandra-1.2.4.jar .
cp $PATCH $RHQ_SERVER_DIR/rhq-storage/lib
# restart the storage node
@@ -54,6 +54,6 @@ $RHQ_SERVER_DIR/bin/rhqctl stop
echo "Removing patch file"
rm $RHQ_SERVER_DIR/rhq-storage/lib/$PATCH
-mv $TMPDIR/apache-cassandra-1.2.4.jar $RHQ_SERVER_DIR/rhq-storage/lib
+mv ./apache-cassandra-1.2.4.jar $RHQ_SERVER_DIR/rhq-storage/lib
echo "Table compression has been disabled for all keyspaces. You are now ready to upgrade your RHQ installation."
10 years, 10 months