Author: ataylor
Date: 2010-03-26 12:19:56 -0400 (Fri, 26 Mar 2010)
New Revision: 8970
Added:
projects/jopr-plugin/trunk/jopr-plugin.iml
projects/jopr-plugin/trunk/pom.xml
projects/jopr-plugin/trunk/src/
projects/jopr-plugin/trunk/src/main/
projects/jopr-plugin/trunk/src/main/java/
projects/jopr-plugin/trunk/src/main/java/org/
projects/jopr-plugin/trunk/src/main/java/org/jboss/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryDiscoveryComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerDiscoveryComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicDiscoveryComponent.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/Operation.java
projects/jopr-plugin/trunk/src/resources/
projects/jopr-plugin/trunk/src/resources/META-INF/
projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
Log:
first cut of hornetq jopr plugin
Added: projects/jopr-plugin/trunk/jopr-plugin.iml
===================================================================
--- projects/jopr-plugin/trunk/jopr-plugin.iml (rev 0)
+++ projects/jopr-plugin/trunk/jopr-plugin.iml 2010-03-26 16:19:56 UTC (rev 8970)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true"
type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5"
inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/resources"
isTestSource="false" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss.integration:jboss-profileservice-spi:6.0.0.Alpha9"
level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss:jboss-common-core:2.2.17.GA" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss.logging:jboss-logging-spi:2.1.0.GA" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss.man:jboss-managed:2.1.1.SP1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss.man:jboss-metatype:2.1.0.SP1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss:jboss-reflect:2.0.2.GA" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss:jboss-mdr:2.0.2.GA" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
sun-jaxb:jaxb-api:2.1.4" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss:jboss-vfs:3.0.0.CR1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss.kernel:jboss-dependency:2.2.0.Alpha6" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.jboss:jbossxb:2.0.2.Beta4" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
apache-xerces:xml-apis:2.9.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
apache-xerces:xercesImpl:2.9.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
wutka-dtdparser:dtdparser121:1.2.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
javax.activation:activation:1.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.rhq:rhq-core-domain:1.4.0.B01" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.rhq:rhq-core-util:1.4.0.B01" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
jdom:jdom:1.0" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
i18nlog:i18nlog:1.0.9" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
javax.xml.bind:jaxb-api:2.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
javax.xml.stream:stax-api:1.0-2" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.rhq:rhq-core-plugin-api:1.4.0.B01" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.rhq:rhq-core-native-system:1.4.0.B01" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.hyperic:sigar:1.6.3.82" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
com.sun.xml.bind:jaxb-impl:2.1.6" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven:
org.rhq:rhq-jmx-plugin:1.4.0.B01" level="project" />
+ <orderEntry type="library" scope="PROVIDED" name="Maven:
mc4j:org-mc4j-ems:1.2.11" level="project" />
+ <orderEntry type="library" name="Maven: com.sun:tools:1.4.2"
level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.0-CR-1"
level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.hibernate:hibernate-annotations:3.5.0-CR-1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.hibernate:hibernate-core:3.5.0-CR-1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
antlr:antlr:2.7.6" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
commons-collections:commons-collections:3.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
dom4j:dom4j:1.6.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
xml-apis:xml-apis:1.0.b2" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
javax.transaction:jta:1.1" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.slf4j:slf4j-api:1.5.8" level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.hibernate:hibernate-commons-annotations:3.2.0.Beta1" level="project"
/>
+ </component>
+</module>
+
Added: projects/jopr-plugin/trunk/pom.xml
===================================================================
--- projects/jopr-plugin/trunk/pom.xml (rev 0)
+++ projects/jopr-plugin/trunk/pom.xml 2010-03-26 16:19:56 UTC (rev 8970)
@@ -0,0 +1,125 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.hornetq</groupId>
+ <artifactId>hornetq-jopr-plugin</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0.0.SNAPSHOT</version>
+ <name>JBoss Application Server JOPR plugin</name>
+ <url>http://hornetq.org</url>
+ <description>HornetQ JOPR plugin</description>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <directory>src/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <!-- Compile (global dependencies) -->
+ <dependency>
+ <groupId>org.jboss.integration</groupId>
+ <artifactId>jboss-profileservice-spi</artifactId>
+ <version>6.0.0.Alpha9</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.man</groupId>
+ <artifactId>jboss-managed</artifactId>
+ <version>2.1.1.SP1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-domain</artifactId>
+ <version>1.4.0.B01</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-core-plugin-api</artifactId>
+ <version>1.4.0.B01</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.rhq</groupId>
+ <artifactId>rhq-jmx-plugin</artifactId>
+ <version>1.4.0.B01</version>
+ <scope>provided</scope>
+ </dependency>
+ <!--we dont compile without these, some strange annotation dependency-->
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.0-CR-1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.5.0-CR-1</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>interval:10080</updatePolicy>
+ </releases>
+ <id>jboss.release</id>
+ <name>JBoss releases</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>interval:10080</updatePolicy>
+ </releases>
+ <id>jboss.release</id>
+ <name>JBoss releases</name>
+ <
url>http://repository.jboss.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <distributionManagement>
+ <repository>
+ <id>repository.jboss.org</id>
+ <
name>JBoss.org Release Distribution Repository</name>
+
<
url>dav:https://svn.jboss.org/repos/repository.jboss.org/maven2</ur...
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <
name>JBoss.org Development Snapshot Repository</name>
+ <
url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.deployers.spi.management.ManagementView;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created: 17-Mar-2010
+ */
+public interface JMSComponent
+{
+ ManagementView getProfileService() throws Exception;
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.ConfigurationUpdateStatus;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+
+import java.util.Map;
+
+import static
org.jboss.as.integration.hornetq.jopr.JMSConstants.ConnectionFactory.COMPONENT_NAME;
+import static
org.jboss.as.integration.hornetq.jopr.JMSConstants.ConnectionFactory.COMPONENT_TYPE;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Mar 19, 2010
+ */
+public class JMSConnectionFactoryComponent extends JMSResourceComponent
+{
+
+ @Override
+ protected String getInvokeOperationSubscriptionMessage()
+ {
+ return null;
+ }
+
+ @Override
+ protected String getInvokeOperationJMSMessage()
+ {
+ return null;
+ }
+
+ @Override
+ protected String getInvokeOperation()
+ {
+ return "";
+ }
+
+ @Override
+ String getComponentName()
+ {
+ return COMPONENT_NAME;
+ }
+
+ @Override
+ ComponentType getComponentType()
+ {
+ return COMPONENT_TYPE;
+ }
+
+ @Override
+ String getConfigurationOperationName()
+ {
+ return "getConfiguration";
+ }
+
+ @Override
+ String getMeasurementsOperationName()
+ {
+ return "getMeasurements";
+ }
+
+ @Override
+ String getDeleteOperationName()
+ {
+ return "deleteConnectionFactory";
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
+ {
+ Map<String, PropertySimple> simpleProps =
configurationUpdateReport.getConfiguration().getSimpleProperties();
+ String name = simpleProps.get("name").getStringValue();
+ long discoveryRefreshTimeout =
simpleProps.get("DiscoveryRefreshTimeout").getLongValue();
+ String clientId = simpleProps.get("ClientID").getStringValue();
+ int dupsOkBatchSize =
simpleProps.get("DupsOKBatchSize").getIntegerValue();
+ int transactionBatchSize =
simpleProps.get("TransactionBatchSize").getIntegerValue();
+ long clientFailureCheckPeriod =
simpleProps.get("ClientFailureCheckPeriod").getLongValue();
+ long connectionTTL = simpleProps.get("ConnectionTTL").getLongValue();
+ long callTimeout = simpleProps.get("CallTimeout").getLongValue();
+ int consumerWindowSize =
simpleProps.get("ConsumerWindowSize").getIntegerValue();
+ int confirmationWindowSize =
simpleProps.get("ConfirmationWindowSize").getIntegerValue();
+ int producerMaxRate =
simpleProps.get("ProducerMaxRate").getIntegerValue();
+ int producerWindowSize =
simpleProps.get("ProducerWindowSize").getIntegerValue();
+ boolean cacheLargeMessageClient =
simpleProps.get("CacheLargeMessagesClient").getBooleanValue();
+ int minLargeMessageSize =
simpleProps.get("MinLargeMessageSize").getIntegerValue();
+ boolean blockOnNonDurableSend =
simpleProps.get("BlockOnNonDurableSend").getBooleanValue();
+ boolean blockOnAcknowledge =
simpleProps.get("BlockOnAcknowledge").getBooleanValue();
+ boolean blockOnDurableSend =
simpleProps.get("BlockOnDurableSend").getBooleanValue();
+ boolean autoGroup = simpleProps.get("AutoGroup").getBooleanValue();
+ boolean preAcknowledge =
simpleProps.get("PreAcknowledge").getBooleanValue();
+ long maxRetryInterval =
simpleProps.get("MaxRetryInterval").getLongValue();
+ double retryIntervalMultiplier =
simpleProps.get("RetryIntervalMultiplier").getDoubleValue();
+ int reconnectAttempts =
simpleProps.get("ReconnectAttempts").getIntegerValue();
+ boolean failoverOnShutdown =
simpleProps.get("FailoverOnServerShutdown").getBooleanValue();
+ int scheduledThreadPoolMaxSize =
simpleProps.get("ScheduledThreadPoolMaxSize").getIntegerValue();
+ int threadPoolMaxSize =
simpleProps.get("ThreadPoolMaxSize").getIntegerValue();
+ String groupId = simpleProps.get("GroupID").getStringValue();
+ int initialMessagePacketSize =
simpleProps.get("InitialMessagePacketSize").getIntegerValue();
+ boolean useGlobalPools =
simpleProps.get("UseGlobalPools").getBooleanValue();
+ long retryInterval = simpleProps.get("RetryInterval").getLongValue();
+ String connectionLoadBalancingPolicyClassName =
simpleProps.get("ConnectionLoadBalancingPolicyClassName").getStringValue();
+
+ try
+ {
+ ManagementView managementView = getProfileService();
+
+ updateConnectionFactory(configurationUpdateReport, managementView, name,
discoveryRefreshTimeout, clientId, dupsOkBatchSize, transactionBatchSize,
clientFailureCheckPeriod, connectionTTL, callTimeout, consumerWindowSize,
confirmationWindowSize, producerMaxRate, producerWindowSize, cacheLargeMessageClient,
minLargeMessageSize, blockOnNonDurableSend, blockOnAcknowledge, blockOnDurableSend,
autoGroup, preAcknowledge, maxRetryInterval, retryIntervalMultiplier, reconnectAttempts,
failoverOnShutdown, scheduledThreadPoolMaxSize, threadPoolMaxSize, groupId,
initialMessagePacketSize, useGlobalPools, retryInterval,
connectionLoadBalancingPolicyClassName);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(e.getMessage());
+ }
+
+ }
+
+ private void updateConnectionFactory(ConfigurationUpdateReport
configurationUpdateReport,
+ ManagementView managementView,
+ String name,
+ long discoveryRefreshTimeout,
+ String clientId,
+ int dupsOkBatchSize,
+ int transactionBatchSize,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ int consumerWindowSize,
+ int confirmationWindowSize,
+ int producerMaxRate,
+ int producerWindowSize,
+ boolean cacheLargeMessageClient,
+ int minLargeMessageSize,
+ boolean blockOnNonDurableSend,
+ boolean blockOnAcknowledge,
+ boolean blockOnDurableSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ long maxRetryInterval,
+ double retryIntervalMultiplier,
+ int reconnectAttempts,
+ boolean failoverOnShutdown,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ String groupId,
+ int initialMessagePacketSize,
+ boolean useGlobalPools,
+ long retryInterval,
+ String connectionLoadBalancingPolicyClassName)
throws Exception
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
COMPONENT_NAME, "updateConnectionFactory", new
ComponentType("JMSManage", "ConnectionFactoryManage"));
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE,
discoveryRefreshTimeout),
+ new SimpleValueSupport(SimpleMetaType.STRING, clientId),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, dupsOkBatchSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
transactionBatchSize),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE,
clientFailureCheckPeriod),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, connectionTTL),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, callTimeout),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
consumerWindowSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
confirmationWindowSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerMaxRate),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
producerWindowSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
cacheLargeMessageClient),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
minLargeMessageSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnNonDurableSend),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnAcknowledge),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnDurableSend),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, autoGroup),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, preAcknowledge),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, maxRetryInterval),
+ new SimpleValueSupport(SimpleMetaType.DOUBLE_PRIMITIVE,
retryIntervalMultiplier),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, reconnectAttempts),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
failoverOnShutdown),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
scheduledThreadPoolMaxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, threadPoolMaxSize),
+ new SimpleValueSupport(SimpleMetaType.STRING, groupId),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
initialMessagePacketSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useGlobalPools),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, retryInterval),
+ new SimpleValueSupport(SimpleMetaType.STRING,
connectionLoadBalancingPolicyClassName));
+
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryDiscoveryComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryDiscoveryComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryDiscoveryComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.values.ArrayValueSupport;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static
org.jboss.as.integration.hornetq.jopr.JMSConstants.ConnectionFactory.COMPONENT_NAME;
+import static
org.jboss.as.integration.hornetq.jopr.JMSConstants.ConnectionFactory.COMPONENT_TYPE;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Mar 19, 2010
+ */
+public class JMSConnectionFactoryDiscoveryComponent implements
ResourceDiscoveryComponent
+{
+
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext
resourceDiscoveryContext) throws InvalidPluginConfigurationException, Exception
+ {
+ Set<DiscoveredResourceDetails> set = new
HashSet<DiscoveredResourceDetails>();
+ JMSComponent context = (JMSComponent)
resourceDiscoveryContext.getParentResourceComponent();
+ ManagementView managementView = context.getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
COMPONENT_NAME, "getJMSConnectionFactories", COMPONENT_TYPE);
+
+ ArrayValueSupport value = (ArrayValueSupport) operation.invoke();
+
+ for (int i = 0; i < value.getLength(); i++)
+ {
+ SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
+ ResourceType resourceType = resourceDiscoveryContext.getResourceType();
+ String queueName = queue.getValue().toString();
+ set.add(new DiscoveredResourceDetails(resourceType,
+ queueName,
+ queueName,
+ "a JMS ConnectionFactory",
+ "",
+ resourceDiscoveryContext.getDefaultPluginConfiguration(),
+ null));
+ }
+ return set;
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConstants.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.managed.api.ComponentType;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Mar 24, 2010
+ */
+public class JMSConstants
+{
+ interface ConnectionFactory
+ {
+ public static final String COMPONENT_NAME =
"JMSConnectionFactoryManageMO";
+
+ public static final ComponentType COMPONENT_TYPE = new
ComponentType("JMSManage", "ConnectionFactoryManage");
+ }
+
+ interface Queue
+ {
+ public static final String COMPONENT_NAME = "JMSQueueManageMO";
+
+ public static final ComponentType COMPONENT_TYPE = new
ComponentType("JMSDestinationManage", "QueueManage");
+ }
+
+ interface Topic
+ {
+ public static final String COMPONENT_NAME = "JMSTopicManageMO";
+
+ public static final ComponentType COMPONENT_TYPE = new
ComponentType("JMSDestinationManage", "TopicManage");
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,423 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementDataTrait;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.pluginapi.inventory.*;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created 11-Mar-2010
+ */
+public class JMSManagerComponent implements ResourceComponent, CreateChildResourceFacet,
MeasurementFacet, JMSComponent
+{
+ private ResourceContext resourceContext;
+
+ public void getValues(MeasurementReport measurementReport,
Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
+ {
+
+ for (MeasurementScheduleRequest measurementScheduleRequest :
measurementScheduleRequests)
+ {
+
+ if("version".equalsIgnoreCase(measurementScheduleRequest.getName()))
+ {
+ ManagementView managementView = getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
"JMSServerMO", "getVersion", new ComponentType("JMSManage",
"ServerManage"));
+ SimpleValueSupport support = (SimpleValueSupport)
operation.invoke();measurementReport.addData(new
MeasurementDataTrait(measurementScheduleRequest, support.getValue().toString()));
+ }
+ else
if("started".equalsIgnoreCase(measurementScheduleRequest.getName()))
+ {
+ ManagementView managementView = getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
"JMSServerMO", "isStarted", new ComponentType("JMSManage",
"ServerManage"));
+ SimpleValueSupport support = (SimpleValueSupport)
operation.invoke();measurementReport.addData(new
MeasurementDataTrait(measurementScheduleRequest, support.getValue().toString()));
+ }
+ }
+
+ }
+
+ public CreateResourceReport createResource(CreateResourceReport createResourceReport)
+ {
+ createResourceReport.setStatus(CreateResourceStatus.IN_PROGRESS);
+ ManagementView managementView = null;
+ try
+ {
+ managementView = getProfileService();
+ }
+ catch (Exception e)
+ {
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ return createResourceReport;
+ }
+ Map<String, PropertySimple> simpleProps =
createResourceReport.getResourceConfiguration().getSimpleProperties();
+
+
+ try
+ {
+ if ("JMS Connection
Factory".equalsIgnoreCase(createResourceReport.getResourceType().getName()))
+ {
+
+ String name = simpleProps.get("name").getStringValue();
+ String liveTransportClassNames =
simpleProps.get("liveTransportClassNames").getStringValue();
+ String liveTransportParams =
simpleProps.get("liveTransportParams").getStringValue();
+ String backupTransportClassNames =
simpleProps.get("backupTransportClassNames").getStringValue();
+ String backupTransportParams =
simpleProps.get("backupTransportParams").getStringValue();
+ String bindings = simpleProps.get("Bindings").getStringValue();
+ String discoveryAddress =
simpleProps.get("DiscoveryAddress").getStringValue();
+ int discoveryPort =
simpleProps.get("DiscoveryPort").getIntegerValue();
+ long discoveryRefreshTimeout =
simpleProps.get("DiscoveryRefreshTimeout").getLongValue();
+ String clientId = simpleProps.get("ClientID").getStringValue();
+ int dupsOkBatchSize =
simpleProps.get("DupsOKBatchSize").getIntegerValue();
+ int transactionBatchSize =
simpleProps.get("TransactionBatchSize").getIntegerValue();
+ long clientFailureCheckPeriod =
simpleProps.get("ClientFailureCheckPeriod").getLongValue();
+ long connectionTTL =
simpleProps.get("ConnectionTTL").getLongValue();
+ long callTimeout = simpleProps.get("CallTimeout").getLongValue();
+ int consumerWindowSize =
simpleProps.get("ConsumerWindowSize").getIntegerValue();
+ int confirmationWindowSize =
simpleProps.get("ConfirmationWindowSize").getIntegerValue();
+ int producerMaxRate =
simpleProps.get("ProducerMaxRate").getIntegerValue();
+ int producerWindowSize =
simpleProps.get("ProducerWindowSize").getIntegerValue();
+ boolean cacheLargeMessageClient =
simpleProps.get("CacheLargeMessagesClient").getBooleanValue();
+ int minLargeMessageSize =
simpleProps.get("MinLargeMessageSize").getIntegerValue();
+ boolean blockOnNonDurableSend =
simpleProps.get("BlockOnNonDurableSend").getBooleanValue();
+ boolean blockOnAcknowledge =
simpleProps.get("BlockOnAcknowledge").getBooleanValue();
+ boolean blockOnDurableSend =
simpleProps.get("BlockOnDurableSend").getBooleanValue();
+ boolean autoGroup =
simpleProps.get("AutoGroup").getBooleanValue();
+ boolean preAcknowledge =
simpleProps.get("PreAcknowledge").getBooleanValue();
+ long maxRetryInterval =
simpleProps.get("MaxRetryInterval").getLongValue();
+ double retryIntervalMultiplier =
simpleProps.get("RetryIntervalMultiplier").getDoubleValue();
+ int reconnectAttempts =
simpleProps.get("ReconnectAttempts").getIntegerValue();
+ boolean failoverOnShutdown =
simpleProps.get("FailoverOnServerShutdown").getBooleanValue();
+ int scheduledThreadPoolMaxSize =
simpleProps.get("ScheduledThreadPoolMaxSize").getIntegerValue();
+ int threadPoolMaxSize =
simpleProps.get("ThreadPoolMaxSize").getIntegerValue();
+ String groupId = simpleProps.get("GroupID").getStringValue();
+ int initialMessagePacketSize =
simpleProps.get("InitialMessagePacketSize").getIntegerValue();
+ boolean useGlobalPools =
simpleProps.get("UseGlobalPools").getBooleanValue();
+ long retryInterval =
simpleProps.get("RetryInterval").getLongValue();
+ String connectionLoadBalancingPolicyClassName =
simpleProps.get("ConnectionLoadBalancingPolicyClassName").getStringValue();
+ createConnectionFactory(createResourceReport, managementView,
name,liveTransportClassNames, liveTransportParams, backupTransportClassNames,
backupTransportParams, bindings, discoveryAddress, discoveryPort, discoveryRefreshTimeout,
clientId, dupsOkBatchSize, transactionBatchSize, clientFailureCheckPeriod, connectionTTL,
callTimeout, consumerWindowSize, confirmationWindowSize, producerMaxRate,
producerWindowSize, cacheLargeMessageClient, minLargeMessageSize, blockOnNonDurableSend,
blockOnAcknowledge, blockOnDurableSend, autoGroup, preAcknowledge, maxRetryInterval,
retryIntervalMultiplier, reconnectAttempts, failoverOnShutdown,
scheduledThreadPoolMaxSize, threadPoolMaxSize, groupId, initialMessagePacketSize,
useGlobalPools, retryInterval, connectionLoadBalancingPolicyClassName);
+ }
+ else
+ {
+ String name = simpleProps.get("name").getStringValue();
+ String jndiName =
simpleProps.get("jndiBindings").getStringValue();
+ String DLA = simpleProps.get("dla").getStringValue();
+ String expiryAddress =
simpleProps.get("expiryAddress").getStringValue();
+ int maxSize = simpleProps.get("maxSize").getIntegerValue();
+ int pageSize = simpleProps.get("pageSize").getIntegerValue();
+ int maxDeliveryAttempts =
simpleProps.get("maxDeliveryAttempts").getIntegerValue();
+ long redeliveryDelay =
simpleProps.get("redeliveryDelay").getLongValue();
+ boolean lastValueQueue =
simpleProps.get("lastValueQueue").getBooleanValue();
+ long redistributionDelay =
simpleProps.get("redistributionDelay").getLongValue();
+ boolean sendToDLAOnNoRoute =
simpleProps.get("sendToDLAOnNoRoute").getBooleanValue();
+ String addressFullMessagePolicy =
simpleProps.get("addressFullMessagePolicy").getStringValue();
+ if ("JMS
Queue".equalsIgnoreCase(createResourceReport.getResourceType().getName()))
+ {
+ createQueue(createResourceReport, managementView, name, jndiName, DLA,
expiryAddress, maxSize, pageSize, maxDeliveryAttempts, redeliveryDelay, lastValueQueue,
redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy);
+ }
+ else if ("JMS
Topic".equalsIgnoreCase(createResourceReport.getResourceType().getName()))
+ {
+ createTopic(createResourceReport, managementView, name, jndiName, DLA,
expiryAddress, maxSize, pageSize, maxDeliveryAttempts, redeliveryDelay, lastValueQueue,
redistributionDelay, sendToDLAOnNoRoute, addressFullMessagePolicy);
+ }
+ }
+
+
+ }
+ catch (Exception e)
+ {
+ createResourceReport.setStatus(CreateResourceStatus.FAILURE);
+ createResourceReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ }
+ return createResourceReport;
+ }
+
+ private void createConnectionFactory(CreateResourceReport createResourceReport,
ManagementView managementView, String name,String liveTransportClassNames, String
liveTransportParams, String backupTransportClassNames, String backupTransportParams,
String bindings, String discoveryAddress, int discoveryPort, long discoveryRefreshTimeout,
String clientId, int dupsOkBatchSize, int transactionBatchSize, long
clientFailureCheckPeriod, long connectionTTL, long callTimeout, int consumerWindowSize,
int confirmationWindowSize, int producerMaxRate, int producerWindowSize, boolean
cacheLargeMessageClient, int minLargeMessageSize, boolean blockOnNonDurableSend, boolean
blockOnAcknowledge, boolean blockOnDurableSend, boolean autoGroup, boolean preAcknowledge,
long maxRetryInterval, double retryIntervalMultiplier, int reconnectAttempts, boolean
failoverOnShutdown, int scheduledThreadPoolMaxSize, int threadPoolMaxSize, String groupId,
int initialMessagePacketSize, boolean useGlobalPool!
s, long retryInterval, String connectionLoadBalancingPolicyClassName)
+ throws Exception
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
JMSConstants.ConnectionFactory.COMPONENT_NAME, "createConnectionFactory",
JMSConstants.ConnectionFactory.COMPONENT_TYPE);
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+ new SimpleValueSupport(SimpleMetaType.STRING, liveTransportClassNames),
+ new SimpleValueSupport(SimpleMetaType.STRING, liveTransportParams),
+ new SimpleValueSupport(SimpleMetaType.STRING, backupTransportClassNames),
+ new SimpleValueSupport(SimpleMetaType.STRING, backupTransportParams),
+ new SimpleValueSupport(SimpleMetaType.STRING, bindings),
+ new SimpleValueSupport(SimpleMetaType.STRING, discoveryAddress),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, discoveryPort),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE,
discoveryRefreshTimeout),
+ new SimpleValueSupport(SimpleMetaType.STRING, clientId),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, dupsOkBatchSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
transactionBatchSize),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE,
clientFailureCheckPeriod),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, connectionTTL),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, callTimeout),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
consumerWindowSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
confirmationWindowSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, producerMaxRate),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
producerWindowSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
cacheLargeMessageClient),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
minLargeMessageSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnNonDurableSend),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnAcknowledge),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
blockOnDurableSend),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, autoGroup),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, preAcknowledge),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, maxRetryInterval),
+ new SimpleValueSupport(SimpleMetaType.DOUBLE_PRIMITIVE,
retryIntervalMultiplier),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, reconnectAttempts),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
failoverOnShutdown),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
scheduledThreadPoolMaxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, threadPoolMaxSize),
+ new SimpleValueSupport(SimpleMetaType.STRING, groupId),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
initialMessagePacketSize),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useGlobalPools),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, retryInterval),
+ new SimpleValueSupport(SimpleMetaType.STRING,
connectionLoadBalancingPolicyClassName));
+
+ createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
+ createResourceReport.setResourceKey(name);
+ createResourceReport.setResourceName(name);
+ }
+
+ private void createQueue(CreateResourceReport createResourceReport, ManagementView
managementView, String name, String jndiName, String DLA, String expiryAddress, int
maxSize, int pageSize, int maxDeliveryAttempts, long redeliveryDelay, boolean
lastValueQueue, long redistributionDelay, boolean sendToDLAOnNoRoute, String
addressFullMessagePolicy)
+ throws Exception
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
JMSConstants.Queue.COMPONENT_NAME, "createQueue",
JMSConstants.Queue.COMPONENT_TYPE);
+
+ StringBuffer sendRoles = new StringBuffer();
+ StringBuffer consumeRoles = new StringBuffer();
+ createRoles(createResourceReport, name, sendRoles, consumeRoles);
+
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+ new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+ new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+ new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
maxDeliveryAttempts),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
sendToDLAOnNoRoute),
+ new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
+ new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()));
+ createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
+ createResourceReport.setResourceKey("jms.queue." + name);
+ createResourceReport.setResourceName("jms.queue." + name);
+ }
+
+ private void createTopic(CreateResourceReport createResourceReport, ManagementView
managementView, String name, String jndiName, String DLA, String expiryAddress, int
maxSize, int pageSize, int maxDeliveryAttempts, long redeliveryDelay, boolean
lastValueQueue, long redistributionDelay, boolean sendToDLAOnNoRoute, String
addressFullMessagePolicy)
+ throws Exception
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
JMSConstants.Topic.COMPONENT_NAME,
+ "createTopic", JMSConstants.Topic.COMPONENT_TYPE);
+
+ StringBuffer sendRoles = new StringBuffer();
+ StringBuffer consumeRoles = new StringBuffer();
+ StringBuffer createNonDurableRoles = new StringBuffer();
+ StringBuffer deleteNonDurableRoles = new StringBuffer();
+ StringBuffer createDurableRoles = new StringBuffer();
+ StringBuffer deleteDurableRoles = new StringBuffer();
+ createRoles(createResourceReport, name, sendRoles, consumeRoles,
createNonDurableRoles, deleteNonDurableRoles, createDurableRoles, deleteDurableRoles);
+
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, name),
+ new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+ new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+ new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
maxDeliveryAttempts),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
sendToDLAOnNoRoute),
+ new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
+ new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
createDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
deleteDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
createNonDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
deleteNonDurableRoles.toString()));
+ createResourceReport.setStatus(CreateResourceStatus.SUCCESS);
+ createResourceReport.setResourceKey("jms.topic." + name);
+ createResourceReport.setResourceName("jms.topic." + name);
+ }
+
+
+ public void start(ResourceContext resourceContext) throws
InvalidPluginConfigurationException, Exception
+ {
+ this.resourceContext = resourceContext;
+ }
+
+ public void stop()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public AvailabilityType getAvailability()
+ {
+ return AvailabilityType.UP;
+ }
+
+ public ManagementView getProfileService() throws Exception
+ {
+ ResourceComponent component = resourceContext.getParentResourceComponent();
+ Method m = component.getClass().getMethod("getConnection");
+ Object conn = m.invoke(component);
+ m = conn.getClass().getMethod("getManagementView");
+ return (ManagementView) m.invoke(conn);
+ }
+
+ private void createRoles(CreateResourceReport configurationUpdateReport, String name,
StringBuffer sendRoles, StringBuffer consumeRoles)
+ {
+ PropertyList propertyList = (PropertyList)
configurationUpdateReport.getResourceConfiguration().get("roles");
+ List<Property> roles = propertyList.getList();
+ for (Property role : roles)
+ {
+ PropertyMap actRole = (PropertyMap) role;
+ boolean send;
+ boolean consume;
+ PropertySimple simple = (PropertySimple) actRole.get("name");
+ name = simple.getStringValue();
+ simple = (PropertySimple) actRole.get("send");
+ send = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("consume");
+ consume = simple.getBooleanValue();
+ if (send)
+ {
+ if (sendRoles.length() > 0)
+ {
+ sendRoles.append(",");
+ }
+ sendRoles.append(name);
+ }
+ if (consume)
+ {
+ if (consumeRoles.length() > 0)
+ {
+ consumeRoles.append(",");
+ }
+ consumeRoles.append(name);
+ }
+ }
+ }
+
+ private void createRoles(CreateResourceReport configurationUpdateReport, String name,
StringBuffer sendRoles, StringBuffer consumeRoles, StringBuffer createNonDurableRoles,
StringBuffer deleteNonDurableRoles, StringBuffer createDurableRoles, StringBuffer
deleteDurableRoles)
+ {
+ PropertyList propertyList = (PropertyList)
configurationUpdateReport.getResourceConfiguration().get("roles");
+ List<Property> roles = propertyList.getList();
+ for (Property role : roles)
+ {
+ PropertyMap actRole = (PropertyMap) role;
+ boolean send;
+ boolean consume;
+ boolean createNonDurableQueue;
+ boolean deleteNonDurableQueue;
+ boolean createDurableQueue;
+ boolean deleteDurableQueue;
+ PropertySimple simple = (PropertySimple) actRole.get("name");
+ name = simple.getStringValue();
+ simple = (PropertySimple) actRole.get("send");
+ send = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("consume");
+ consume = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("createNonDurableQueue");
+ createNonDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("deleteNonDurableQueue");
+ deleteNonDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("createDurableQueue");
+ createDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("deleteDurableQueue");
+ deleteDurableQueue = simple.getBooleanValue();
+ if (send)
+ {
+ if (sendRoles.length() > 0)
+ {
+ sendRoles.append(",");
+ }
+ sendRoles.append(name);
+ }
+ if (consume)
+ {
+ if (consumeRoles.length() > 0)
+ {
+ consumeRoles.append(",");
+ }
+ consumeRoles.append(name);
+ }
+ if (createDurableQueue)
+ {
+ if (createDurableRoles.length() > 0)
+ {
+ createDurableRoles.append(",");
+ }
+ createDurableRoles.append(name);
+ }
+ if (deleteDurableQueue)
+ {
+ if (deleteDurableRoles.length() > 0)
+ {
+ deleteDurableRoles.append(",");
+ }
+ deleteDurableRoles.append(name);
+ }
+ if (createNonDurableQueue)
+ {
+ if (createNonDurableRoles.length() > 0)
+ {
+ createNonDurableRoles.append(",");
+ }
+ createNonDurableRoles.append(name);
+ }
+ if (deleteNonDurableQueue)
+ {
+ if (deleteNonDurableRoles.length() > 0)
+ {
+ deleteNonDurableRoles.append(",");
+ }
+ deleteNonDurableRoles.append(name);
+ }
+ }
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerDiscoveryComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerDiscoveryComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerDiscoveryComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,67 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.rhq.core.pluginapi.inventory.*;
+
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created 11-Mar-2010
+ */
+public class JMSManagerDiscoveryComponent implements ResourceDiscoveryComponent
+{
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext
ctx) throws InvalidPluginConfigurationException, Exception
+ {
+ ManagementView managementView = getProfileService(ctx);
+ ManagedComponent component = managementView.getComponent("JMSServerMO",
new ComponentType("JMSManage", "ServerManage"));
+ if(component != null)
+ {
+ DiscoveredResourceDetails detail = new DiscoveredResourceDetails(
+ ctx.getResourceType(), // Resource type
+ ctx.getResourceType().getName(), // Resource key
+ ctx.getResourceType().getName(), // Resource name
+ null, // Resource version
+ ctx.getResourceType().getDescription(), // Description
+ ctx.getDefaultPluginConfiguration(), // Plugin config
+ null // Process info from a process scan
+ );
+ return Collections.singleton(detail);
+ }
+ return Collections.EMPTY_SET;
+ }
+
+ public ManagementView getProfileService(ResourceDiscoveryContext ctx) throws
Exception
+ {
+ ResourceComponent component = ctx.getParentResourceComponent();
+ Method m = component.getClass().getMethod("getConnection");
+ Object conn = m.invoke(component);
+ m = conn.getClass().getMethod("getManagementView");
+ return (ManagementView) m.invoke(conn);
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,338 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.CompositeValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.*;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.jboss.as.integration.hornetq.jopr.JMSConstants.Queue.COMPONENT_NAME;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created: 17-Mar-2010
+ */
+public class JMSQueueComponent extends JMSResourceComponent implements ResourceComponent,
MeasurementFacet, OperationFacet, ConfigurationFacet
+{
+ @Override
+ String getMeasurementsOperationName()
+ {
+ return "getQueueMeasurements";
+ }
+
+ public AvailabilityType getAvailability()
+ {
+ try
+ {
+ ManagementView view = getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(view,
getComponentName(), "isPaused", getComponentType());
+ SimpleValueSupport val = (SimpleValueSupport) operation.invoke(new
SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
+ boolean paused = ((Boolean)val.getValue()).booleanValue();
+ return paused ? AvailabilityType.DOWN : AvailabilityType.UP;
+ }
+ catch (Exception e)
+ {
+ return AvailabilityType.DOWN;
+ }
+ }
+
+ @Override
+ String getComponentName()
+ {
+ return COMPONENT_NAME;
+ }
+
+ @Override
+ ComponentType getComponentType()
+ {
+ return JMSConstants.Queue.COMPONENT_TYPE;
+ }
+
+ @Override
+ String getConfigurationOperationName()
+ {
+ return "getQueueConfiguration";
+ }
+
+ @Override
+ protected String getInvokeOperation()
+ {
+ return "invokeQueueOperation";
+ }
+
+ @Override
+ protected String getInvokeOperationJMSMessage()
+ {
+ return "invokeQueueOperationMessageType";
+ }
+
+ @Override
+ protected String getInvokeOperationSubscriptionMessage()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ @Override
+ String getDeleteOperationName()
+ {
+ return "deleteQueue";
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.INPROGRESS);
+
+ ManagementView view = null;
+ try
+ {
+ view = getProfileService();
+ }
+ catch (Exception e)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ return;
+ }
+ Map<String, PropertySimple> simpleProps =
configurationUpdateReport.getConfiguration().getSimpleProperties();
+ String name = simpleProps.get("name").getStringValue();
+ String jndiName = simpleProps.get("jndiBindings").getStringValue();
+ String DLA = simpleProps.get("dla").getStringValue();
+ String expiryAddress =
simpleProps.get("expiryAddress").getStringValue();
+ int maxSize = simpleProps.get("maxSize").getIntegerValue();
+ int pageSize = simpleProps.get("pageSize").getIntegerValue();
+ int maxDeliveryAttempts =
simpleProps.get("maxDeliveryAttempts").getIntegerValue();
+ long redeliveryDelay =
simpleProps.get("redeliveryDelay").getLongValue();
+ boolean lastValueQueue =
simpleProps.get("lastValueQueue").getBooleanValue();
+ long redistributionDelay =
simpleProps.get("redistributionDelay").getLongValue();
+ boolean sendToDLAOnNoRoute =
simpleProps.get("sendToDLAOnNoRoute").getBooleanValue();
+ String addressFullMessagePolicy =
simpleProps.get("addressFullMessagePolicy").getStringValue();
+
+
+ StringBuffer sendRoles = new StringBuffer();
+ StringBuffer consumeRoles = new StringBuffer();
+ createRoles(configurationUpdateReport, name, sendRoles, consumeRoles);
+ try
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(view,
JMSConstants.Queue.COMPONENT_NAME, "updateQueueConfiguration",
JMSConstants.Queue.COMPONENT_TYPE);
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING,
resourceContext.getResourceKey()),
+ new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+ new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+ new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
maxDeliveryAttempts),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
sendToDLAOnNoRoute),
+ new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
+ new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()));
+ }
+ catch (Exception e)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ return;
+ }
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ }
+
+ private void createRoles(ConfigurationUpdateReport configurationUpdateReport, String
name, StringBuffer sendRoles, StringBuffer consumeRoles)
+ {
+ PropertyList propertyList = (PropertyList)
configurationUpdateReport.getConfiguration().get("securityConfig");
+ if(propertyList == null)
+ {
+ return;
+ }
+ List<Property> roles = propertyList.getList();
+ for (Property role : roles)
+ {
+ PropertyMap actRole = (PropertyMap) role;
+ boolean send;
+ boolean consume;
+ PropertySimple simple = (PropertySimple) actRole.get("name");
+ name = simple.getStringValue();
+ simple = (PropertySimple) actRole.get("send");
+ send = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("consume");
+ consume = simple.getBooleanValue();
+ if(send)
+ {
+ if(sendRoles.length() > 0)
+ {
+ sendRoles.append(",");
+ }
+ sendRoles.append(name);
+ }
+ if(consume)
+ {
+ if(consumeRoles.length() > 0)
+ {
+ consumeRoles.append(",");
+ }
+ consumeRoles.append(name);
+ }
+ }
+ }
+
+ private void populateParams(final Collection<PropertySimple> props, final
SimpleValueSupport[] params, final SimpleValueSupport[] signature)
+ {
+ int pos = 0;
+ for (PropertySimple prop : props)
+ {
+ String[] val = prop.getName().split(":");
+ if (val.length == 1)
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getStringValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.String");
+ }
+ else
+ {
+ if (val[0].equals("Boolean"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getBooleanValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Boolean");
+ }
+ else if (val[0].equals("boolean"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getBooleanValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"boolean");
+ }
+ else if (val[0].equals("String"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getStringValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.String");
+ }
+ else if (val[0].equals("Long"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getLongValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Long");
+ }
+ else if (val[0].equals("long"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getLongValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"long");
+ }
+ else if (val[0].equals("Integer"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getIntegerValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Integer");
+ }
+ else if (val[0].equals("int"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getIntegerValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"int");
+ }
+ else if (val[0].equals("Double"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getDoubleValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Double");
+ }
+ else if (val[0].equals("double"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getDoubleValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"double");
+ }
+ }
+ pos++;
+ }
+ }
+
+ private String getStringValue(Object o)
+ {
+ return o == null ? "null" : o.toString();
+ }
+
+
+ private OperationResult formatResults(Object val, String type) throws Exception
+ {
+ if (type == null)
+ {
+ SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+ return new OperationResult(valueSupport.getValue().toString());
+ }
+ else if(type.equalsIgnoreCase("String"))
+ {
+ SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+ return new OperationResult(valueSupport.getValue().toString());
+ }
+ else if(type.equalsIgnoreCase("JMSMessage"))
+ {
+ OperationResult operationResult = new OperationResult();
+ Configuration c = operationResult.getComplexResults();
+ PropertyList property = new PropertyList("result");
+ CollectionValueSupport valueSupport = (CollectionValueSupport) val;
+ MetaValue[] msgs = valueSupport.getElements();
+ for (MetaValue mv : msgs)
+ {
+ CompositeValueSupport msg = (CompositeValueSupport) mv;
+ org.rhq.core.domain.configuration.PropertyMap p1 = new
org.rhq.core.domain.configuration.PropertyMap("element");
+ property.add(p1);
+ ImmutableCompositeMetaType metaType = (ImmutableCompositeMetaType)
msg.getMetaType();
+ Set<String> keys = metaType.keySet();
+ for (String key : keys)
+ {
+ SimpleValueSupport sattr = (SimpleValueSupport) msg.get(key);
+ p1.put(new PropertySimple(key,sattr.getValue()));
+ }
+ }
+ c.put(property);
+ return operationResult;
+ }
+ else if (val instanceof CompositeValueSupport)
+ {
+ CompositeValueSupport valueSupport = (CompositeValueSupport) val;
+ if (valueSupport.containsKey("cause"))
+ {
+ CompositeValueSupport cause = (CompositeValueSupport)
valueSupport.get("cause");
+ SimpleValueSupport message = (SimpleValueSupport)
cause.get("message");
+ Exception exception = new Exception(message.toString());
+ throw exception;
+ }
+ return new OperationResult("not yet");
+ }
+ return new OperationResult("not yet");
+ }
+}
\ No newline at end of file
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSQueueDiscoveryComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.values.ArrayValueSupport;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class JMSQueueDiscoveryComponent implements ResourceDiscoveryComponent
+{
+
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext
resourceDiscoveryContext) throws InvalidPluginConfigurationException, Exception
+ {
+ Set<DiscoveredResourceDetails> set = new
HashSet<DiscoveredResourceDetails>();
+ JMSComponent context = (JMSComponent)
resourceDiscoveryContext.getParentResourceComponent();
+ ManagementView managementView = context.getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
JMSConstants.Queue.COMPONENT_NAME, "getJMSQueues",
JMSConstants.Queue.COMPONENT_TYPE);
+
+ ArrayValueSupport value = (ArrayValueSupport) operation.invoke();
+
+ for (int i = 0; i < value.getLength(); i++)
+ {
+ SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
+ ResourceType resourceType = resourceDiscoveryContext.getResourceType();
+ String queueName = "jms.queue." + queue.getValue();
+ set.add(new DiscoveredResourceDetails(resourceType,
+ queueName,
+ queueName,
+ "a JMS Queue",
+ "",
+ resourceDiscoveryContext.getDefaultPluginConfiguration(),
+ null));
+ }
+ return set;
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSResourceComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,340 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.as.integration.hornetq.jopr.util.Operation;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.ArrayMetaType;
+import org.jboss.metatype.api.types.ImmutableCompositeMetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.*;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertyList;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.measurement.*;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created: 17-Mar-2010
+ */
+public abstract class JMSResourceComponent implements ResourceComponent,
MeasurementFacet, OperationFacet, ConfigurationFacet, JMSComponent, DeleteResourceFacet
+{
+ protected ResourceContext resourceContext;
+ private JMSComponent jmsComponent;
+
+ public AvailabilityType getAvailability()
+ {
+ return AvailabilityType.UP;
+ }
+
+ public void deleteResource() throws Exception
+ {
+ ManagementView view = getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(view,
getComponentName(), getDeleteOperationName(), getComponentType());
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING,
resourceContext.getResourceKey()));
+ }
+
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest>
measurementScheduleRequests) throws Exception
+ {
+ ArrayValueSupport support = new ArrayValueSupport(new
ArrayMetaType(SimpleMetaType.STRING, false));
+ SimpleValueSupport[] valueSupports = new
SimpleValueSupport[measurementScheduleRequests.size()];
+ Iterator<MeasurementScheduleRequest> it =
measurementScheduleRequests.iterator();
+ for (int i = 0, valueSupportsLength = valueSupports.length; i <
valueSupportsLength; i++)
+ {
+ valueSupports[i] = new SimpleValueSupport(SimpleMetaType.STRING,
it.next().getName());
+ }
+ support.setValue(valueSupports);
+ ManagementView view = getProfileService();
+
+ ManagedOperation operation = ManagementSupport.getOperation(view,
getComponentName(), getMeasurementsOperationName(), getComponentType());
+ ArrayValueSupport vals = (ArrayValueSupport) operation.invoke(new
SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()), support);
+ it = measurementScheduleRequests.iterator();
+ for (int i = 0, valueSupportsLength = valueSupports.length; i <
valueSupportsLength; i++)
+ {
+ MeasurementScheduleRequest request = it.next();
+ SimpleValueSupport simpleValueSupport = (SimpleValueSupport) vals.getValue(i);
+ simpleValueSupport.getValue();
+ if (request.getDataType().equals(DataType.MEASUREMENT))
+ {
+ report.addData(new MeasurementDataNumeric(request,
Double.valueOf(simpleValueSupport.getValue().toString())));
+ }
+ else if (request.getDataType().equals(DataType.TRAIT))
+ {
+ report.addData(new MeasurementDataTrait(request,
simpleValueSupport.getValue().toString()));
+ }
+ }
+ }
+
+ public Configuration loadResourceConfiguration() throws Exception
+ {
+ Configuration config = new Configuration();
+ ManagementView view = getProfileService();
+
+ ManagedOperation operation = ManagementSupport.getOperation(view,
getComponentName(), getConfigurationOperationName(), getComponentType());
+
+ CompositeValueSupport val = (CompositeValueSupport) operation.invoke(new
SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
+
+ ConfigurationDefinition configDef =
resourceContext.getResourceType().getResourceConfigurationDefinition();
+ List<PropertyDefinition> propertyDefinitionList =
configDef.getPropertiesInGroup("HornetQCustomProperties");
+ for (PropertyDefinition definition : propertyDefinitionList)
+ {
+ String name = definition.getName();
+ if (val.containsKey(name))
+ {
+ MetaValue mv = val.get(name);
+ if(mv instanceof SimpleValueSupport)
+ {
+ SimpleValueSupport attr = (SimpleValueSupport) mv;
+ PropertySimple simple = new PropertySimple(name, attr.getValue());
+ config.put(simple);
+ }
+ else if(mv instanceof CollectionValueSupport)
+ {
+ PropertyList property = new PropertyList("securityConfig");
+ CollectionValueSupport valueSupport = (CollectionValueSupport) mv;
+ MetaValue[] msgs = valueSupport.getElements();
+ for (MetaValue mv2 : msgs)
+ {
+ CompositeValueSupport msg = (CompositeValueSupport) mv2;
+ org.rhq.core.domain.configuration.PropertyMap p1 = new
org.rhq.core.domain.configuration.PropertyMap("element");
+ property.add(p1);
+ ImmutableCompositeMetaType metaType = (ImmutableCompositeMetaType)
msg.getMetaType();
+ Set<String> keys = metaType.keySet();
+ for (String key : keys)
+ {
+ SimpleValueSupport sattr = (SimpleValueSupport) msg.get(key);
+ if(sattr != null)
+ p1.put(new PropertySimple(key,sattr.getValue()));
+ }
+ }
+ config.put(property);
+ }
+ }
+ }
+ return config;
+ }
+
+ public OperationResult invokeOperation(String s, Configuration configuration) throws
InterruptedException, Exception
+ {
+ Operation oper = Operation.getOperation(s);
+ Collection<PropertySimple> props =
configuration.getSimpleProperties().values();
+ SimpleValueSupport[] params = new SimpleValueSupport[props.size()];
+ SimpleValueSupport[] signature = new SimpleValueSupport[props.size()];
+ populateParams(props, params, signature);
+ ArrayValueSupport param = new ArrayValueSupport(new
ArrayMetaType(SimpleMetaType.STRING, false));
+ param.setValue(params);
+ ArrayValueSupport sig = new ArrayValueSupport(new
ArrayMetaType(SimpleMetaType.STRING, false));
+ sig.setValue(signature);
+ SimpleValueSupport queueName = new SimpleValueSupport(SimpleMetaType.STRING,
resourceContext.getResourceKey());
+ SimpleValueSupport methodName = new SimpleValueSupport(SimpleMetaType.STRING,
oper.getOperationName());
+ ManagementView view = getProfileService();
+ String methodOperation = getInvokeOperation();
+ if("JMSMessage".equalsIgnoreCase(oper.getResultsType()))
+ {
+ methodOperation = getInvokeOperationJMSMessage();
+ }
+ else if("SubscriptionInfo".equalsIgnoreCase(oper.getResultsType()))
+ {
+ methodOperation = getInvokeOperationSubscriptionMessage();
+ }
+ ManagedOperation operation = ManagementSupport.getOperation(view,
getComponentName(), methodOperation, getComponentType());
+ Object result = null;
+ result = operation.invoke(queueName, methodName, param, sig);
+ if (result == null)
+ {
+ return null;
+ }
+ return formatResults(result, oper.getResultsType());
+ }
+
+ public void start(ResourceContext resourceContext) throws
InvalidPluginConfigurationException, Exception
+ {
+ this.resourceContext = resourceContext;
+
+ jmsComponent = (JMSComponent) resourceContext.getParentResourceComponent();
+ }
+
+ public void stop()
+ {
+ this.resourceContext = null;
+ }
+
+ protected abstract String getInvokeOperationSubscriptionMessage();
+
+ protected abstract String getInvokeOperationJMSMessage();
+
+ protected abstract String getInvokeOperation();
+
+
+ abstract String getComponentName();
+
+ abstract ComponentType getComponentType();
+
+ abstract String getConfigurationOperationName();
+
+ abstract String getMeasurementsOperationName();
+
+ abstract String getDeleteOperationName();
+
+ private void populateParams(final Collection<PropertySimple> props, final
SimpleValueSupport[] params, final SimpleValueSupport[] signature)
+ {
+ int pos = 0;
+ for (PropertySimple prop : props)
+ {
+ String[] val = prop.getName().split(":");
+ if (val.length == 1)
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getStringValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.String");
+ }
+ else
+ {
+ if (val[0].equals("Boolean"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getBooleanValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Boolean");
+ }
+ else if (val[0].equals("boolean"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getBooleanValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"boolean");
+ }
+ else if (val[0].equals("String"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getStringValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.String");
+ }
+ else if (val[0].equals("Long"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getLongValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Long");
+ }
+ else if (val[0].equals("long"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getLongValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"long");
+ }
+ else if (val[0].equals("Integer"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getIntegerValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Integer");
+ }
+ else if (val[0].equals("int"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getIntegerValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"int");
+ }
+ else if (val[0].equals("Double"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getDoubleValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"java.lang.Double");
+ }
+ else if (val[0].equals("double"))
+ {
+ params[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
getStringValue(prop.getDoubleValue()));
+ signature[pos] = new SimpleValueSupport(SimpleMetaType.STRING,
"double");
+ }
+ }
+ pos++;
+ }
+ }
+
+ private String getStringValue(Object o)
+ {
+ return o == null ? "null" : o.toString();
+ }
+
+
+ private OperationResult formatResults(Object val, String type) throws Exception
+ {
+ if (type == null)
+ {
+ SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+ return new OperationResult(valueSupport.getValue().toString());
+ }
+ else if(type.equalsIgnoreCase("String"))
+ {
+ SimpleValueSupport valueSupport = (SimpleValueSupport) val;
+ return new OperationResult(valueSupport.getValue().toString());
+ }
+ else if(type.equalsIgnoreCase("JMSMessage") ||
type.equalsIgnoreCase("SubscriptionInfo"))
+ {
+ OperationResult operationResult = new OperationResult();
+ Configuration c = operationResult.getComplexResults();
+ PropertyList property = new PropertyList("result");
+ CollectionValueSupport valueSupport = (CollectionValueSupport) val;
+ MetaValue[] msgs = valueSupport.getElements();
+ for (MetaValue mv : msgs)
+ {
+ CompositeValueSupport msg = (CompositeValueSupport) mv;
+ org.rhq.core.domain.configuration.PropertyMap p1 = new
org.rhq.core.domain.configuration.PropertyMap("element");
+ property.add(p1);
+ ImmutableCompositeMetaType metaType = (ImmutableCompositeMetaType)
msg.getMetaType();
+ Set<String> keys = metaType.keySet();
+ for (String key : keys)
+ {
+ SimpleValueSupport sattr = (SimpleValueSupport) msg.get(key);
+ if(sattr != null)
+ p1.put(new PropertySimple(key,sattr.getValue()));
+ }
+ }
+ c.put(property);
+ return operationResult;
+ }
+ else if (val instanceof CompositeValueSupport)
+ {
+ CompositeValueSupport valueSupport = (CompositeValueSupport) val;
+ if (valueSupport.containsKey("cause"))
+ {
+ CompositeValueSupport cause = (CompositeValueSupport)
valueSupport.get("cause");
+ SimpleValueSupport message = (SimpleValueSupport)
cause.get("message");
+ Exception exception = new Exception(message.toString());
+ throw exception;
+ }
+ return new OperationResult("not yet");
+ }
+ return new OperationResult("not yet");
+ }
+
+ public ManagementView getProfileService() throws Exception
+ {
+ return jmsComponent.getProfileService();
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,246 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.types.SimpleMetaType;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.configuration.*;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created: 17-Mar-2010
+ */
+public class JMSTopicComponent extends JMSResourceComponent
+{
+ public AvailabilityType getAvailability()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ @Override
+ String getComponentName()
+ {
+ return JMSConstants.Topic.COMPONENT_NAME;
+ }
+
+ @Override
+ ComponentType getComponentType()
+ {
+ return JMSConstants.Topic.COMPONENT_TYPE;
+ }
+
+ @Override
+ String getConfigurationOperationName()
+ {
+ return "getTopicConfiguration";
+ }
+
+ @Override
+ String getMeasurementsOperationName()
+ {
+ return "getTopicMeasurements";
+ }
+
+
+ @Override
+ protected String getInvokeOperation()
+ {
+ return "invokeTopicOperation";
+ }
+
+ @Override
+ protected String getInvokeOperationJMSMessage()
+ {
+ return "invokeTopicOperationMessageType";
+ }
+
+ @Override
+ protected String getInvokeOperationSubscriptionMessage()
+ {
+ return "invokeTopicOperationSubscriptionType";
+ }
+
+ @Override
+ String getDeleteOperationName()
+ {
+ return "deleteTopic";
+ }
+
+ public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.INPROGRESS);
+
+ ManagementView view = null;
+ try
+ {
+ view = getProfileService();
+ }
+ catch (Exception e)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ return;
+ }
+ Map<String, PropertySimple> simpleProps =
configurationUpdateReport.getConfiguration().getSimpleProperties();
+ String name = simpleProps.get("name").getStringValue();
+ String jndiName = simpleProps.get("jndiBindings").getStringValue();
+ String DLA = simpleProps.get("dla").getStringValue();
+ String expiryAddress =
simpleProps.get("expiryAddress").getStringValue();
+ int maxSize = simpleProps.get("maxSize").getIntegerValue();
+ int pageSize = simpleProps.get("pageSize").getIntegerValue();
+ int maxDeliveryAttempts =
simpleProps.get("maxDeliveryAttempts").getIntegerValue();
+ long redeliveryDelay =
simpleProps.get("redeliveryDelay").getLongValue();
+ boolean lastValueQueue =
simpleProps.get("lastValueQueue").getBooleanValue();
+ long redistributionDelay =
simpleProps.get("redistributionDelay").getLongValue();
+ boolean sendToDLAOnNoRoute =
simpleProps.get("sendToDLAOnNoRoute").getBooleanValue();
+ String addressFullMessagePolicy =
simpleProps.get("addressFullMessagePolicy").getStringValue();
+
+
+ StringBuffer sendRoles = new StringBuffer();
+ StringBuffer consumeRoles = new StringBuffer();
+ StringBuffer createNonDurableRoles = new StringBuffer();
+ StringBuffer deleteNonDurableRoles = new StringBuffer();
+ StringBuffer createDurableRoles = new StringBuffer();
+ StringBuffer deleteDurableRoles = new StringBuffer();
+ createRoles(configurationUpdateReport, name, sendRoles, consumeRoles,
createNonDurableRoles, deleteNonDurableRoles, createDurableRoles, deleteDurableRoles);
+ try
+ {
+ ManagedOperation operation = ManagementSupport.getOperation(view,
JMSConstants.Topic.COMPONENT_NAME,
+ "updateTopicConfiguration", JMSConstants.Topic.COMPONENT_TYPE);
+ operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING,
resourceContext.getResourceKey()),
+ new SimpleValueSupport(SimpleMetaType.STRING, jndiName),
+ new SimpleValueSupport(SimpleMetaType.STRING, DLA),
+ new SimpleValueSupport(SimpleMetaType.STRING, expiryAddress),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, maxSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, pageSize),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE,
maxDeliveryAttempts),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redeliveryDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, lastValueQueue),
+ new SimpleValueSupport(SimpleMetaType.LONG_PRIMITIVE, redistributionDelay),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE,
sendToDLAOnNoRoute),
+ new SimpleValueSupport(SimpleMetaType.STRING, addressFullMessagePolicy),
+ new SimpleValueSupport(SimpleMetaType.STRING, sendRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING, consumeRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
createDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
deleteDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
createNonDurableRoles.toString()),
+ new SimpleValueSupport(SimpleMetaType.STRING,
deleteNonDurableRoles.toString()));
+ }
+ catch (Exception e)
+ {
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.FAILURE);
+ configurationUpdateReport.setErrorMessage(e.getMessage());
+ e.printStackTrace();
+ return;
+ }
+ configurationUpdateReport.setStatus(ConfigurationUpdateStatus.SUCCESS);
+ }
+
+ private void createRoles(ConfigurationUpdateReport configurationUpdateReport, String
name, StringBuffer sendRoles, StringBuffer consumeRoles, StringBuffer
createNonDurableRoles, StringBuffer deleteNonDurableRoles, StringBuffer
createDurableRoles, StringBuffer deleteDurableRoles)
+ {
+ PropertyList propertyList = (PropertyList)
configurationUpdateReport.getConfiguration().get("securityConfig");
+ List<Property> roles = propertyList.getList();
+ for (Property role : roles)
+ {
+ PropertyMap actRole = (PropertyMap) role;
+ boolean send;
+ boolean consume;
+ boolean createNonDurableQueue;
+ boolean deleteNonDurableQueue;
+ boolean createDurableQueue;
+ boolean deleteDurableQueue;
+ PropertySimple simple = (PropertySimple) actRole.get("name");
+ name = simple.getStringValue();
+ simple = (PropertySimple) actRole.get("send");
+ send = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("consume");
+ consume = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("createNonDurableQueue");
+ createNonDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("deleteNonDurableQueue");
+ deleteNonDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("createDurableQueue");
+ createDurableQueue = simple.getBooleanValue();
+ simple = (PropertySimple) actRole.get("deleteDurableQueue");
+ deleteDurableQueue = simple.getBooleanValue();
+ if(send)
+ {
+ if(sendRoles.length() > 0)
+ {
+ sendRoles.append(",");
+ }
+ sendRoles.append(name);
+ }
+ if(consume)
+ {
+ if(consumeRoles.length() > 0)
+ {
+ consumeRoles.append(",");
+ }
+ consumeRoles.append(name);
+ }
+ if(createDurableQueue)
+ {
+ if(createDurableRoles.length() > 0)
+ {
+ createDurableRoles.append(",");
+ }
+ createDurableRoles.append(name);
+ }
+ if(deleteDurableQueue)
+ {
+ if(deleteDurableRoles.length() > 0)
+ {
+ deleteDurableRoles.append(",");
+ }
+ deleteDurableRoles.append(name);
+ }
+ if(createNonDurableQueue)
+ {
+ if(createNonDurableRoles.length() > 0)
+ {
+ createNonDurableRoles.append(",");
+ }
+ createNonDurableRoles.append(name);
+ }
+ if(deleteNonDurableQueue)
+ {
+ if(deleteNonDurableRoles.length() > 0)
+ {
+ deleteNonDurableRoles.append(",");
+ }
+ deleteNonDurableRoles.append(name);
+ }
+ }
+ }
+
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicDiscoveryComponent.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicDiscoveryComponent.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSTopicDiscoveryComponent.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr;
+
+import org.jboss.as.integration.hornetq.jopr.util.ManagementSupport;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ManagedOperation;
+import org.jboss.metatype.api.values.ArrayValueSupport;
+import org.jboss.metatype.api.values.SimpleValueSupport;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ */
+public class JMSTopicDiscoveryComponent implements ResourceDiscoveryComponent
+{
+
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext
resourceDiscoveryContext) throws InvalidPluginConfigurationException, Exception
+ {
+ Set<DiscoveredResourceDetails> set = new
HashSet<DiscoveredResourceDetails>();
+ JMSComponent context = (JMSComponent)
resourceDiscoveryContext.getParentResourceComponent();
+ ManagementView managementView = context.getProfileService();
+ ManagedOperation operation = ManagementSupport.getOperation(managementView,
JMSConstants.Topic.COMPONENT_NAME,
+ "getJMSTopics", JMSConstants.Topic.COMPONENT_TYPE);
+
+ ArrayValueSupport value = (ArrayValueSupport) operation.invoke();
+
+ for (int i = 0; i < value.getLength(); i++)
+ {
+ SimpleValueSupport queue = (SimpleValueSupport) value.getValue(i);
+ ResourceType resourceType = resourceDiscoveryContext.getResourceType();
+ String queueName = "jms.topic." + queue.getValue();
+ set.add(new DiscoveredResourceDetails(resourceType,
+ queueName,
+ queueName,
+ "a JMS Topic",
+ "",
+ resourceDiscoveryContext.getDefaultPluginConfiguration(),
+ null));
+ }
+ return set;
+ }
+}
\ No newline at end of file
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/ManagementSupport.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr.util;
+
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.managed.api.ComponentType;
+import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.api.ManagedOperation;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created 16-Mar-2010
+ */
+public class ManagementSupport
+{
+ public static ManagedOperation getOperation(ManagementView view, String componentName,
String operName, ComponentType componentType) throws Exception
+ {
+ ManagedComponent component = view.getComponent(componentName, componentType);
+ Set<ManagedOperation> operations = component.getOperations();
+ for (ManagedOperation operation : operations)
+ {
+ if (operation.getName().equals(operName))
+ {
+ return operation;
+ }
+ }
+ throw new IllegalArgumentException(" no operation available " +
operName);
+ }
+}
Added:
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/Operation.java
===================================================================
---
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/Operation.java
(rev 0)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/util/Operation.java 2010-03-26
16:19:56 UTC (rev 8970)
@@ -0,0 +1,68 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+package org.jboss.as.integration.hornetq.jopr.util;
+
+/**
+ * @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
+ * Created Feb 9, 2010
+ */
+public class Operation
+{
+ final private String operationName;
+ final private String resultsType;
+
+ Operation(String operationName, String resultsType)
+ {
+ this.operationName = operationName;
+ this.resultsType = resultsType;
+ }
+
+ public String getOperationName()
+ {
+ return operationName;
+ }
+
+ public String getResultsType()
+ {
+ return resultsType;
+ }
+
+ public static Operation getOperation(String oper)
+ {
+ String[] split = oper.split(",", 3);
+ String operationName = split[0];
+ String resultsType = null;
+ for (int i = 1, splitLength = split.length; i < splitLength; i++)
+ {
+ String s = split[i];
+ if(s.startsWith("operation"))
+ {
+ operationName = s.substring(s.indexOf("=") + 1);
+ }
+ else if(s.startsWith("result"))
+ {
+ resultsType = s.substring(s.indexOf("=") + 1);
+ }
+ }
+ return new Operation(operationName, resultsType);
+ }
+}
Added: projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
(rev 0)
+++ projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-03-26 16:19:56
UTC (rev 8970)
@@ -0,0 +1,755 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE plugin [
+
+ <!ENTITY destinationMetrics '
+ <metric property="getName"
+ displayName="Name"
+ description="name of this destination"
+ dataType="trait" displayType="summary"/>
+ <metric property="getJNDIBinding"
+ displayName="JNDI Binding"
+ description="JNDI Binding of this destination"
+ dataType="trait" displayType="summary"/>
+ <metric property="getAddress"
+ displayName="Address"
+ description="Address of this destination"
+ dataType="trait" displayType="summary"/>
+ <metric property="isTemporary"
+ displayName="Temporary"
+ description="If this destination is temporary"
+ dataType="trait" displayType="summary"/>
+'>
+ ]>
+
+<plugin name="HornetQ"
+ displayName="HornetQPlugin"
+ description="Supports management and monitoring of HornetQ Servers"
+ package="org.jboss.as.integration.hornetq.jopr"
+ version="2.1.10"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:xmlns:rhq-plugin"
+ xmlns:c="urn:xmlns:rhq-configuration">
+
+ <service name="JMS Manager"
+ discovery="JMSManagerDiscoveryComponent"
+ class="JMSManagerComponent"
+ singleton="true">
+
+ <runs-inside>
+ <parent-resource-type name="JBossAS Server"
plugin="JBossAS"/>
+ <parent-resource-type name="JBossAS Server"
plugin="JBossAS5"/>
+ </runs-inside>
+
+ <metric property="version"
+ displayName="HornetQ Version"
+ description="The HornetQ version"
+ dataType="trait" displayType="summary"/>
+ <metric property="started"
+ displayName="Is Started"
+ description="The HornetQ version"
+ dataType="trait" displayType="summary"/>
+
+ <service name="JMS Queue"
+ discovery="JMSQueueDiscoveryComponent"
+ class="JMSQueueComponent"
+ createDeletePolicy="both">
+ <operation name="removeMessages" displayName="Remove
Messages"
+ description="Remove all the messages from this queue that match
the given message selector. A null selector will delete all messages.">
+ <parameters>
+ <c:simple-property required="false" name="filter"
displayName="A message filter"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer" description="Number of removed messages."/>
+ </results>
+ </operation>
+ <operation name="listMessages,result=JMSMessage"
displayName="List Messages"
+ description="list all the messages currently in this
queue.">
+ <parameters>
+ <c:simple-property required="false" name="filter"
displayName="A JMS message filter (can be empty)"/>
+ </parameters>
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false"
name="element">
+ <c:simple-property type="string"
name="JMSMessageID"/>
+ <c:simple-property type="long"
required="false" name="JMSTimestamp"/>
+ <c:simple-property type="integer"
required="false" name="JMSPriority"/>
+ <c:simple-property type="long"
required="false" name="JMSExpiration"/>
+ <c:simple-property type="string"
required="false" name="JMSDeliveryMode"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="countMessages" displayName="Count
Messages"
+ description="Returns the number of the messages in the queue
matching the given filter.">
+ <parameters>
+ <c:simple-property required="false" name="selector"
displayName="the selector"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer"
+ description="Number of the messages in the queue
matching the given filter."/>
+ </results>
+ </operation>
+ <operation name="removeMessage" displayName="Remove
Message"
+ description="Remove the message corresponding to the given
messageID.">
+ <parameters>
+ <c:simple-property required="true" name="messageID"
displayName="The message ID"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="boolean" description="Was the message removed."/>
+ </results>
+ </operation>
+ <operation name="expireMessages" displayName="Expire
Messages"
+ description="Expires the messages corresponding to the given
filter.">
+ <parameters>
+ <c:simple-property required="false" name="filter"
displayName="A message filter"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer" description="Number of expired messages."/>
+ </results>
+ </operation>
+ <operation name="expireMessage" displayName="Expire
Message"
+ description="Expire the message corresponding to the given
messageID.">
+ <parameters>
+ <c:simple-property required="true" name="messageID"
displayName="The message ID"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="boolean" description="Was the message removed."/>
+ </results>
+ </operation>
+ <operation name="sendMessageToDeadLetterAddress"
displayName="Send Message to DLA"
+ description="Send the message corresponding to the given
messageID to this queue's Dead Letter Address.">
+ <parameters>
+ <c:simple-property required="true" name="messageID"
displayName="The message ID"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="boolean" description="Was the message sent."/>
+ </results>
+ </operation>
+ <operation name="sendMessagesToDeadLetterAddress"
displayName="Send Messages to DLA"
+ description="Send the messages corresponding to the given filter
to this queue's Dead Letter Address.">
+ <parameters>
+ <c:simple-property required="false"
name="filterStr" displayName="A message filter"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer" description="Number of expired messages."/>
+ </results>
+ </operation>
+ <operation name="changeMessagePriority" displayName="Change
Message Priority"
+ description="Change the priority of the message corresponding to
the given messageID.">
+ <parameters>
+ <c:simple-property required="true" name="messageID"
displayName="A message ID"/>
+ <c:simple-property required="true" type="integer"
name="int:newPriority"
+ displayName="the new priority (between 0 and
9)"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="boolean" description="True if priority set."/>
+ </results>
+ </operation>
+ <operation name="changeMessagesPriority" displayName="Change
Messages Priority"
+ description="Change the priority of the messages corresponding
to the given filter.">
+ <parameters>
+ <c:simple-property required="false" name="filter"
displayName="A message filter"/>
+ <c:simple-property required="true" type="integer"
name="int:newPriority"
+ displayName="The New Priority (between 0 and
9)"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer"
+ description="Number of messages reset with
priority."/>
+ </results>
+ </operation>
+ <operation name="moveMessage" displayName="Move Message"
+ description="Move the message corresponding to the given
messageID to another queue.">
+ <parameters>
+ <c:simple-property required="true" name="messageID"
displayName="A message ID"/>
+ <c:simple-property required="true"
name="otherQueueName"
+ displayName="Destination Queue"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="boolean" description="True if message moved."/>
+ </results>
+ </operation>
+ <operation name="moveMessages" displayName="Move
Messages"
+ description="Move the messages corresponding to the given
filter.">
+ <parameters>
+ <c:simple-property required="false" name="filter"
displayName="The Filter"/>
+ <c:simple-property required="true"
name="otherQueueName"
+ displayName="Destination Queue"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
type="integer" description="Number of moved messages."/>
+ </results>
+ </operation>
+ <operation name="listMessageCounter" displayName="List Message
Counter"
+ description="List the message counters for this queue. This will
show statistics for the queue">
+ <results>
+ <c:simple-property name="operationResult"
description="Message Counters."/>
+ </results>
+ </operation>
+ <operation name="resetMessageCounter" displayName="Reset
Message Counter"
+ description="Reset the message counters.">
+ </operation>
+ <operation name="listMessageCounterAsHTML" displayName="List
Message Counter in HTML"
+ description="List the message counters in HTML.">
+ <results>
+ <c:simple-property name="operationResult"
description="Message Counters."/>
+ </results>
+ </operation>
+ <operation name="listMessageCounterHistory" displayName="List
Message Counter History"
+ description="List the message counters history.">
+ <results>
+ <c:simple-property name="operationResult"
description="Message Counter history."/>
+ </results>
+ </operation>
+ <operation name="listMessageCounterHistoryAsHTML"
displayName="List Message Counter History in HTML"
+ description="List the message counters history in
HTML.">
+ <results>
+ <c:simple-property name="operationResult"
description="Message Counter history."/>
+ </results>
+ </operation>
+ <operation name="pause" displayName="Pause the Queue"
description="Pause the Queue. If the queue is paused no messages can be routed to it
or consumed from it.">
+ </operation>
+ <operation name="resume" displayName="restart the Queue"
description="Restart the Queue from its paused state.">
+ </operation>
+ &destinationMetrics;
+ <metric property="getMessageCount"
+ displayName="Message Count"
+ description="number of messages currently held in this queue
awaiting delivery"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getScheduledCount"
+ displayName="Scheduled Message Count"
+ description="number of scheduled messages in this queue awaiting
scheduled delivery"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getConsumerCount"
+ displayName="Consumer Count"
+ description="number of consumers currently consuming messages from
this queue"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getDeliveringCount"
+ displayName="Delivering Count"
+ description="number of messages that this queue is currently
delivering to its consumers that have not been acknowledged"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getMessagesAdded"
+ displayName="Messages Added"
+ description="number of messages added to this queue since it was
initially created"
+ dataType="measurement" displayType="summary"/>
+ <metric property="isPaused"
+ displayName="paused"
+ description="Is the queue currently paused"
+ dataType="trait" displayType="summary"/>
+ <resource-configuration>
+ <c:group name="HornetQCustomProperties"
displayName="Destination Options">
+ <c:simple-property name="name" displayName="Name"
required="true" readOnly="true">
+ <c:description>The name of the queue</c:description>
+ </c:simple-property>
+ <c:simple-property name="jndiBindings" displayName="JNDI
Name" required="true" readOnly="true">
+ <c:description>The JNDI name of the queue. This will be used when
looking up the queue using the naming server</c:description>
+ </c:simple-property>
+ <c:simple-property name="dla" displayName="Dead Letter
Address" required="false">
+ <c:description>The address to route messages to once the message
has been delivered more than the configured number of times. This is specified by 'Max
Delivery Attempts'</c:description>
+ </c:simple-property>
+ <c:simple-property name="expiryAddress"
displayName="Expiry Address" required="false">
+ <c:description>The Address to route messages to once they have
expired.</c:description>
+ </c:simple-property>
+ <c:simple-property name="maxSize" default="-1"
type="integer" displayName="Max Size of Address"
+ required="true">
+ <c:description>The maximum size in bytes of messages that can be
delivered to this queue. -1 means no limit, if limit is set then 'Address Full Message
Policy' specifies what should happen</c:description>
+ </c:simple-property>
+ <c:simple-property name="pageSize"
default="10485760" type="integer" displayName="Page Size"
+ required="true">
+ <c:description>The point at which messages will be paged on an
Address</c:description>
+ </c:simple-property>
+ <c:simple-property name="maxDeliveryAttempts"
type="integer" default="10"
+ displayName="Max Delivery Attempts"
required="true">
+ <c:description>The maximum time to attempt delivery of a message
to a consumer, once hit the message is routed to which ever address is specified by
'Dead Letter Address'</c:description>
+ </c:simple-property>
+ <c:simple-property name="redeliveryDelay"
type="long" default="0" displayName="Redelivery Delay"
+ required="true">
+ <c:description>The delay (in milli seconds) before re routing a
message to this Address after an unsuccessful delivery attempt has occurred. default 0
means no delay</c:description>
+ </c:simple-property>
+ <c:simple-property name="lastValueQueue"
default="false" type="boolean" displayName="Last Value
Queue"
+ required="true">
+ <c:description>Is this queue a last value queue. A last value
queue can only ever contain a single message for each value for the message property
'_HQ_LVQ_NAME'.</c:description>
+ </c:simple-property>
+ <c:simple-property name="redistributionDelay"
default="-1" type="long" displayName="Redistribution Delay"
+ required="true">
+ <c:description>How long to wait (in milli seconds) before
redistributing messages to another node when clustered when a queue has no consumers.
Default -1 means do not re distribute.</c:description>
+ </c:simple-property>
+ <c:simple-property name="sendToDLAOnNoRoute"
default="false" type="boolean"
+ displayName="Send To DLA on no route"
required="true">
+ <c:description>Whether or not messages routed to this address
gets sent to DLA when no consumers are available</c:description>
+ </c:simple-property>
+ <c:simple-property name="addressFullMessagePolicy"
default="PAGE" type="string"
+ displayName="Address Full Message Policy"
required="true">
+ <c:description>The policy to use when this Address is full. PAGE
means that the message will be paged, DROP means that messages are just droppoed and BLOCK
means that the client will block on send until the queue clears some
messages</c:description>
+ <c:property-options>
+ <c:option name="PAGE" value="PAGE"/>
+ <c:option name="DROP" value="DROP"/>
+ <c:option name="BLOCK" value="BLOCK"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:list-property name="roles"
+ displayName="Roles"
+ description="These are the roles for this queue. The
'name' of the role, 'send' allows a producer to send a message,
'consume' allows a consumer to receive a message.">
+ <c:map-property name="role"
+ displayName="Role Attributes"
+ description="These are the attributes that define
the role name, and if the role is allowed to send and consume messages on this
queue">
+ <c:simple-property name="name"
+ displayName="name"
+ description="The name of the role?"
+ summary="true"
+ required="true"
+ type="string"/>
+ <c:simple-property name="send"
+ displayName="send"
+ description="Is this role allowed to send
messages to this queue?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="consume"
+ displayName="consume"
+ description="Is this role allowed to consume
messages from this queue?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ </c:map-property>
+
+ </c:list-property>
+ </c:group>
+ </resource-configuration>
+ </service>
+ <service name="JMS Topic"
+ discovery="JMSTopicDiscoveryComponent"
+ class="JMSTopicComponent"
+ createDeletePolicy="both">
+ <operation name="listAllSubscriptions,result=SubscriptionInfo"
displayName="List all Subscriptions"
+ description="Lists all the subscriptions for this topic (both
durable and non-durable).">
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false"
name="element">
+ <c:simple-property type="string"
name="name"/>
+ <c:simple-property type="string"
required="false" name="clientID"/>
+ <c:simple-property type="string"
required="false" name="subName"/>
+ <c:simple-property type="boolean"
required="false" name="durable"/>
+ <c:simple-property type="integer"
name="messageCount"/>
+ <c:simple-property type="string"
name="filter"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="listDurableSubscriptions,result=SubscriptionInfo"
displayName="List all Durable Dubscriptions"
+ description="Lists all the durable subscriptions for this
topic.">
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false"
name="element">
+ <c:simple-property type="string"
name="name"/>
+ <c:simple-property type="string"
required="false" name="clientID"/>
+ <c:simple-property type="string"
required="false" name="subName"/>
+ <c:simple-property type="boolean"
required="false" name="durable"/>
+ <c:simple-property type="integer"
name="messageCount"/>
+ <c:simple-property type="string"
name="filter"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation
name="listNonDurableSubscriptions,result=SubscriptionInfo"
+ displayName="List all non Durable Subscriptions"
+ description="Lists all the non-durable subscriptions for this
topic.">
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false"
name="element">
+ <c:simple-property type="string"
name="name"/>
+ <c:simple-property type="string"
required="false" name="clientID"/>
+ <c:simple-property type="string"
required="false" name="subName"/>
+ <c:simple-property type="boolean"
required="false" name="durable"/>
+ <c:simple-property type="integer"
name="messageCount"/>
+ <c:simple-property type="string"
name="filter"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="listMessagesForSubscription,result=JMSMessage"
displayName="List all Messages"
+ description="list all the messages.">
+ <parameters>
+ <c:simple-property required="true"
name="queueName"
+ displayName="the name of the queue representing a
subscription"/>
+ </parameters>
+ <results>
+ <c:list-property name="result">
+ <c:map-property required="false"
name="element">
+ <c:simple-property type="string"
name="JMSMessageID"/>
+ <c:simple-property type="long"
required="false" name="JMSTimestamp"/>
+ <c:simple-property type="long"
required="false" name="JMSExpiration"/>
+ <c:simple-property type="string"
required="false" name="JMSDeliveryMode"/>
+ <c:simple-property type="string"
name="JMSMessageID"/>
+ </c:map-property>
+ </c:list-property>
+ </results>
+ </operation>
+ <operation name="countMessagesForSubscription"
displayName="List Messages for Subscription"
+ description="Count the number of messages matching the filter
for the given subscription.">
+ <parameters>
+ <c:simple-property required="true" name="clientID"
displayName="the client ID"/>
+ <c:simple-property required="true"
name="subscriptionName"
+ displayName="Durable Subscription Name"/>
+ <c:simple-property required="false" name="filter"
displayName="JMS Selector (can be empty)"/>
+ </parameters>
+ <results>
+ <c:simple-property name="operationResult"
description="Message Subscriptions."/>
+ </results>
+ </operation>
+ <operation name="dropDurableSubscription" displayName="Drop
Durable Subscription"
+ description="Drop a durable subscription.">
+ <parameters>
+ <c:simple-property required="true" name="clientID"
displayName="The Client ID"/>
+ <c:simple-property required="true"
name="subscriptionName"
+ displayName="Durable Subscription Name"/>
+ </parameters>
+ </operation>
+ <operation name="dropAllSubscriptions" displayName="Drop
Durable Subscriptions"
+ description="Drop all durable subscription.">
+ </operation>
+ &destinationMetrics;
+ <metric property="getSubscriptionCount"
+ displayName="Subscription Count"
+ description="number of (durable and non-durable) subscribers for
this topic"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getDurableSubscriptionCount"
+ displayName="Durable Subscription Count"
+ description="number of durable subscribers for this topic"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getNonDurableSubscriptionCount"
+ displayName="Non Durable Subscription Count"
+ description="number of non-durable subscribers for this
topic"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getMessageCount"
+ displayName="Message Count"
+ description="number of messages for all subscribers for this
topic"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getDurableMessageCount"
+ displayName="Durable Message Count"
+ description="number of messages for all durable subscribers for
this topic"
+ dataType="measurement" displayType="summary"/>
+ <metric property="getNonDurableMessageCount"
+ displayName="Non Durable Message Count"
+ description="number of messages for all non-durable subscribers for
this topic"
+ dataType="measurement" displayType="summary"/>
+ <resource-configuration>
+ <c:group name="HornetQCustomProperties"
displayName="Destination Options">
+ <c:simple-property name="name" displayName="Name"
required="true" readOnly="true">
+ <c:description>The Name of the topic to
deploy</c:description>
+ </c:simple-property>
+ <c:simple-property name="jndiBindings" displayName="JNDI
Name" required="true" readOnly="true">
+ <c:description>The JNDI name of the queue. This will be used when
looking up the queue using the naming server</c:description>
+ </c:simple-property>
+ <c:simple-property name="dla" displayName="Dead Letter
Address" required="false">
+ <c:description>The address to route messages to once the message
has been delivered more than the configured number of times. This is specified by 'Max
Delivery Attempts'</c:description>
+ </c:simple-property>
+ <c:simple-property name="expiryAddress"
displayName="Expiry Address" required="false">
+ <c:description>The Address to route messages to once they have
expired.</c:description>
+ </c:simple-property>
+ <c:simple-property name="maxSize" default="-1"
type="integer" displayName="Max Size of Address"
+ required="true">
+ <c:description>The maximum size in bytes of messages that can be
delivered to this queue. -1 means no limit, if limit is set then 'Address Full Message
Policy' specifies what should happen</c:description>
+ </c:simple-property>
+ <c:simple-property name="pageSize"
default="10485760" type="integer" displayName="Page Size"
+ required="true">
+ <c:description>The point at which messages will be paged on an
Address</c:description>
+ </c:simple-property>
+ <c:simple-property name="maxDeliveryAttempts"
type="integer" default="10"
+ displayName="Max Delivery Attempts"
required="true">
+ <c:description>The maximum time to attempt delivery of a message
to a consumer, once hit the message is routed to which ever address is specified by
'Dead Letter Address'</c:description>
+ </c:simple-property>
+ <c:simple-property name="redeliveryDelay"
type="long" default="0" displayName="Redelivery Delay"
+ required="true">
+ <c:description>The delay (in milli seconds) before re routing a
message to this Address after an unsuccessful delivery attempt has occurred. default 0
means no delay</c:description>
+ </c:simple-property>
+ <c:simple-property name="lastValueQueue"
default="false" type="boolean" displayName="Last Value
Queue"
+ required="true">
+ <c:description>Is this queue a last value queue. A last value
queue can only ever contain a single message for each value for the message property
'_HQ_LVQ_NAME'.</c:description>
+ </c:simple-property>
+ <c:simple-property name="redistributionDelay"
default="-1" type="long" displayName="Redistribution Delay"
+ required="true">
+ <c:description>How long to wait (in milli seconds) before
redistributing messages to another node when clustered when a queue has no consumers.
Default -1 means do not re distribute.</c:description>
+ </c:simple-property>
+ <c:simple-property name="sendToDLAOnNoRoute"
default="false" type="boolean"
+ displayName="Send To DLA on no route"
required="true">
+ <c:description>Whether or not messages routed to this address
gets sent to DLA when no consumers are available</c:description>
+ </c:simple-property>
+ <c:simple-property name="addressFullMessagePolicy"
default="PAGE" type="string"
+ displayName="Address Full Message Policy"
required="true">
+ <c:description>The policy to use when this Address is full. PAGE
means that the message will be paged, DROP means that messages are just droppoed and BLOCK
means that the client will block on send until the queue clears some
messages</c:description>
+ <c:property-options>
+ <c:option name="PAGE" value="PAGE"/>
+ <c:option name="DROP" value="DROP"/>
+ <c:option name="BLOCK" value="BLOCK"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:list-property name="roles"
+ displayName="Roles"
+ description="These are the role defined for this
topic. The 'name' of the role, 'send' allows a producer to send a message,
'consume' allows a consumer or subscriber to receive a message. The create/delete
(non) durable subscriber specifies whether the queue representing the subscription can be
created or deleted">
+ <c:map-property name="role"
+ displayName="Role Attributes"
+ description="These are the attributes that define
a role for this topic.">
+ <c:simple-property name="name"
+ displayName="name"
+ description="The name of the role"
+ summary="true"
+ required="true"
+ type="string"/>
+ <c:simple-property name="send"
+ displayName="send"
+ description="Is this role allowed to send
messages to this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="consume"
+ displayName="consume"
+ description="Is this role allowed to consume
messages from this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="createNonDurableQueue"
+ displayName="create subscriber"
+ description="Is this role allowed to create
non durable subscribers for this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="deleteNonDurableQueue"
+ displayName="delete subscriber"
+ description="Is this role allowed to delete
non durable subscribers for this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="createDurableQueue"
+ displayName="create durable
subscriber"
+ description="Is this role allowed to create
durable subscribers for this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ <c:simple-property name="deleteDurableQueue"
+ displayName="delete durable
subscriber"
+ description="Is this role allowed to delete
durable subscribers for this topic?"
+ summary="true"
+ required="true"
+ type="boolean"/>
+ </c:map-property>
+
+ </c:list-property>
+ </c:group>
+ </resource-configuration>
+ </service>
+ <service name="JMS Connection Factory"
+ discovery="JMSConnectionFactoryDiscoveryComponent"
+ class="JMSConnectionFactoryComponent"
+ createDeletePolicy="both">
+ <metric property="getName"
+ displayName="Name"
+ description="name of this connection factory"
+ dataType="trait" displayType="summary"/>
+ <metric property="getBindings"
+ displayName="JNDI Bindings"
+ description="JNDI Bindings of this connection factory"
+ dataType="trait" displayType="summary"/>
+ <resource-configuration>
+ <c:group name="HornetQCustomProperties"
displayName="Connection Factory Options">
+ <c:simple-property name="name" displayName="Connection
Factory Name" required="true" readOnly="true">
+ <c:description>Name of the connection factory to
deploy</c:description>
+ </c:simple-property>
+ <c:simple-property name="Bindings"
displayName="Connection Factory JNDI Bindings" required="true"
readOnly="true">
+ <c:description>JNDI Bindings of the connection factory to
deploy</c:description>
+ </c:simple-property>
+ <c:simple-property name="liveTransportClassNames"
+
default="org.hornetq.integration.transports.netty.NettyConnectorFactory"
+ readOnly="true" required="false"
+ displayName="Connectors to live servers">
+ <c:description>comma-separated list of class names to connect to
live servers</c:description>
+ </c:simple-property>
+ <c:simple-property name="liveTransportParams"
+ default="{host=localhost,port=5445}"
+ readOnly="true" required="false"
+ displayName="Parameters for connectors to live servers">
+ <c:description>comma-separated list of key=value parameters for
the live connectors ( enclosed between { })</c:description>
+ </c:simple-property>
+ <c:simple-property name="backupTransportClassNames"
+ required="false" readOnly="true"
+ displayName="Connectors to backup servers">
+ <c:description>comma-separated list of class names to connect to
backup servers</c:description>
+ </c:simple-property>
+ <c:simple-property name="backupTransportParams"
+ required="false" readOnly="true"
+ displayName="Parameters for connectors to backup
servers">
+ <c:description>comma-separated list of key=value parameters for
the backup connectors ( enclosed between { })</c:description>
+ </c:simple-property>
+ <c:simple-property name="DiscoveryAddress"
+ required="false"
+ readOnly="true"
+ displayName="Discovery Address">
+ <c:description>the address to listen to discover which connectors
this connection factory can use</c:description>
+ </c:simple-property>
+ <c:simple-property name="DiscoveryPort"
+ readOnly="true"
+ default="0" type="integer"
+ displayName="Discovery Port">
+ <c:description>port to listen to discover which connectors this
connection factory can use</c:description>
+ </c:simple-property>
+ <c:simple-property name="DiscoveryRefreshTimeout"
+ default="10000" type="long"
+ displayName="Discovery Refresh Timeout">
+ <c:description>refresh timeout for discovered HornetQ
servers</c:description>
+ </c:simple-property>
+ <c:simple-property name="DiscoveryInitialWaitTimeout"
+ default="2000" type="long"
+ displayName="Discovery Initial Wait Timeout">
+ <c:description>initial wait timeout if this connection factory
is configured to use discovery </c:description>
+ </c:simple-property>
+ <c:simple-property name="ClientID"
+ required="false"
+ displayName="Client ID">
+ <c:description>Client ID for connections created by this
connection factory</c:description>
+ </c:simple-property>
+ <c:simple-property name="DupsOKBatchSize"
+ default="1048576" type="integer"
+ displayName="Dups OK Batch Size">
+ <c:description>batch size (in bytes) between acknowledgements
when using DUPS_OK_ACKNOWLEDGE mode</c:description>
+ </c:simple-property>
+ <c:simple-property name="TransactionBatchSize"
+ default="1048576" type="integer"
+ displayName="Transaction Batch Size">
+ <c:description>batch size (in bytes) between acknowledgements
when using a transacted session</c:description>
+ </c:simple-property>
+ <c:simple-property name="ClientFailureCheckPeriod"
+ default="30000" type="long"
+ displayName="Client Failure Check Period">
+ <c:description>period used to check if a client has failed to
receive pings from the serve</c:description>
+ </c:simple-property>
+ <c:simple-property name="ConnectionTTL"
+ default="60000" type="long"
+ displayName="Connection TTL">
+ <c:description>connection time-to-live (in
milliseconds)</c:description>
+ </c:simple-property>
+ <c:simple-property name="CallTimeout"
+ default="30000" type="long"
+ displayName="Call Timeout">
+ <c:description>blocking calls timeout (in
milliseconds)</c:description>
+ </c:simple-property>
+ <c:simple-property name="ConsumerWindowSize"
+ default="1048576" type="integer"
+ displayName="Consumer Window Size">
+ <c:description>window size (in bytes) used for consumer flow
control</c:description>
+ </c:simple-property>
+ <c:simple-property name="ConsumerMaxRate"
+ default="-1" type="integer"
+ displayName="Consumer Max Rate">
+ <c:description>maximum rate of message consumption (in messages
per seconds)</c:description>
+ </c:simple-property>
+ <c:simple-property name="ConfirmationWindowSize"
+ default="-1" type="integer"
+ displayName="Confirmation Window Size">
+ <c:description>size (in bytes) for the confirmation window of
clients using this connection factory</c:description>
+ </c:simple-property>
+ <c:simple-property name="ProducerMaxRate"
+ default="-1" type="integer"
+ displayName="Producer Max Rate">
+ <c:description>maximum rate of message production (in messages
per seconds)</c:description>
+ </c:simple-property>
+ <c:simple-property name="ProducerWindowSize"
+ default="65536" type="integer"
+ displayName="Producer Window Size">
+ <c:description>window size (in bytes) used for producer flow
control</c:description>
+ </c:simple-property>
+ <c:simple-property name="CacheLargeMessagesClient"
+ default="false" type="boolean"
+ displayName="Cache Large Messages Client">
+ <c:description>Whether consumers created through this factory
will cache large messages in temporary files</c:description>
+ </c:simple-property>
+ <c:simple-property name="MinLargeMessageSize"
+ default="102400" type="integer"
+ displayName="Minimum Large Message Size">
+ <c:description>message size threshold (in bytes) to treat
messages as large messages</c:description>
+ </c:simple-property>
+ <c:simple-property name="BlockOnNonDurableSend"
+ default="false" type="boolean"
+ displayName="Block On Non Durable Send">
+ <c:description>whether producers will block while sending
non-durable messages or do it asynchronously</c:description>
+ </c:simple-property>
+ <c:simple-property name="BlockOnAcknowledge"
+ default="false" type="boolean"
+ displayName="Block On Acknowledge">
+ <c:description>whether consumers will block while sending message
acknowledgements or do it asynchronously</c:description>
+ </c:simple-property>
+ <c:simple-property name="BlockOnDurableSend"
+ default="true" type="boolean"
+ displayName="Block On Durable Send">
+ <c:description>whether producers will block while sending
persistent messages or do it asynchronously</c:description>
+ </c:simple-property>
+ <c:simple-property name="AutoGroup"
+ default="false" type="boolean"
+ displayName="Auto Group">
+ <c:description> whether producers will automatically assign a
group ID to their messages</c:description>
+ </c:simple-property>
+ <c:simple-property name="PreAcknowledge"
+ default="false" type="boolean"
+ displayName="Pre Acknowledge">
+ <c:description>whether messages will pre-acknowledged on the
server before they are sent to the consumers or not</c:description>
+ </c:simple-property>
+ <c:simple-property name="RetryInterval"
+ default="2000" type="long"
+ displayName="Retry Interval">
+ <c:description>interval (in milliseconds) to retry connections
created by this factory after failure</c:description>
+ </c:simple-property>
+ <c:simple-property name="MaxRetryInterval"
+ default="2000" type="long"
+ displayName="Maximum Retry Interval">
+ <c:description>maximum retry interval (in
milliseconds)</c:description>
+ </c:simple-property>
+ <c:simple-property name="RetryIntervalMultiplier"
+ default="1.0" type="double"
+ displayName="Retry Interval Multiplier">
+ <c:description>multiplier to apply to successive retry
intervals</c:description>
+ </c:simple-property>
+ <c:simple-property name="ReconnectAttempts"
+ default="0" type="integer"
+ displayName="Reconnect Attempts">
+ <c:description>maximum number of attempts to retry connection in
case of failure</c:description>
+ </c:simple-property>
+ <c:simple-property name="FailoverOnServerShutdown"
+ default="false" type="boolean"
+ displayName="Failover On Server Shutdown">
+ <c:description>whether connections created by this factory must
failover in case the server they are connected to has normally shut
down</c:description>
+ </c:simple-property>
+ <c:simple-property name="ScheduledThreadPoolMaxSize"
+ default="5" type="integer"
+ displayName="Scheduled Thread Pool Max Size">
+ <c:description>maximum size of the scheduled thread
pool</c:description>
+ </c:simple-property>
+ <c:simple-property name="ThreadPoolMaxSize"
+ default="-1" type="integer"
+ displayName="Thread Pool Max Size">
+ <c:description>maximum size of the thread
pool</c:description>
+ </c:simple-property>
+ <c:simple-property name="GroupID"
+ default="false" type="boolean"
+ required="false"
+ displayName="Group ID">
+ <c:description>group ID that will be eventually set on each
message</c:description>
+ </c:simple-property>
+ <c:simple-property name="InitialMessagePacketSize"
+ default="1500" type="integer"
+ displayName="Initial Message Packet Size">
+ <c:description>initial size (in bytes) of messages created
through this factory</c:description>
+ </c:simple-property>
+ <c:simple-property name="UseGlobalPools"
+ default="true" type="boolean"
+ displayName="Use Global Pools">
+ <c:description>whether this factory will use global thread pools
(shared among all the factories in the same JVM) or its own pools</c:description>
+ </c:simple-property>
+ <c:simple-property
name="ConnectionLoadBalancingPolicyClassName"
+
default="org.hornetq.api.core.client.loadbalance.RoundRobinConnectionLoadBalancingPolicy"
+ displayName="Connection Load Balancing Policy Class
Name">
+ <c:description>class name of the connection load balancing
policy</c:description>
+ </c:simple-property>
+ </c:group>
+ </resource-configuration>
+ </service>
+ </service>
+</plugin>