Author: ataylor
Date: 2010-12-06 04:12:16 -0500 (Mon, 06 Dec 2010)
New Revision: 9995
Modified:
projects/jopr-plugin/trunk/pom.xml
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/JMSManagerComponent.java
projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
Log:
changes for latest hornetq management API
Modified: projects/jopr-plugin/trunk/pom.xml
===================================================================
--- projects/jopr-plugin/trunk/pom.xml 2010-12-05 10:14:53 UTC (rev 9994)
+++ projects/jopr-plugin/trunk/pom.xml 2010-12-06 09:12:16 UTC (rev 9995)
@@ -5,7 +5,7 @@
<groupId>org.hornetq</groupId>
<artifactId>hornetq-jopr-plugin</artifactId>
<packaging>jar</packaging>
- <version>1.0.0.Final</version>
+ <version>2.0.0.CR1</version>
<name>JBoss Application Server JOPR plugin</name>
<url>http://hornetq.org</url>
<description>HornetQ JOPR plugin</description>
Modified:
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 2010-12-05
10:14:53 UTC (rev 9994)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSConnectionFactoryComponent.java 2010-12-06
09:12:16 UTC (rev 9995)
@@ -86,7 +86,6 @@
{
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();
@@ -107,7 +106,6 @@
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();
@@ -120,7 +118,7 @@
{
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);
+ updateConnectionFactory(configurationUpdateReport, managementView, name,
clientId, dupsOkBatchSize, transactionBatchSize, clientFailureCheckPeriod, connectionTTL,
callTimeout, consumerWindowSize, confirmationWindowSize, producerMaxRate,
producerWindowSize, cacheLargeMessageClient, minLargeMessageSize, blockOnNonDurableSend,
blockOnAcknowledge, blockOnDurableSend, autoGroup, preAcknowledge, maxRetryInterval,
retryIntervalMultiplier, reconnectAttempts, scheduledThreadPoolMaxSize, threadPoolMaxSize,
groupId, initialMessagePacketSize, useGlobalPools, retryInterval,
connectionLoadBalancingPolicyClassName);
}
catch (Exception e)
{
@@ -134,7 +132,6 @@
private void updateConnectionFactory(ConfigurationUpdateReport
configurationUpdateReport,
ManagementView managementView,
String name,
- long discoveryRefreshTimeout,
String clientId,
int dupsOkBatchSize,
int transactionBatchSize,
@@ -155,7 +152,6 @@
long maxRetryInterval,
double retryIntervalMultiplier,
int reconnectAttempts,
- boolean failoverOnShutdown,
int scheduledThreadPoolMaxSize,
int threadPoolMaxSize,
String groupId,
@@ -166,7 +162,6 @@
{
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),
@@ -187,7 +182,6 @@
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),
Modified:
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 2010-12-05
10:14:53 UTC (rev 9994)
+++
projects/jopr-plugin/trunk/src/main/java/org/jboss/as/integration/hornetq/jopr/JMSManagerComponent.java 2010-12-06
09:12:16 UTC (rev 9995)
@@ -56,11 +56,11 @@
for (MeasurementScheduleRequest measurementScheduleRequest :
measurementScheduleRequests)
{
- if("provider".equalsIgnoreCase(measurementScheduleRequest.getName()))
+ if
("provider".equalsIgnoreCase(measurementScheduleRequest.getName()))
{
measurementReport.addData(new
MeasurementDataTrait(measurementScheduleRequest, "HornetQ"));
}
- else
if("started".equalsIgnoreCase(measurementScheduleRequest.getName()))
+ else if
("started".equalsIgnoreCase(measurementScheduleRequest.getName()))
{
ManagementView managementView = getProfileService();
ManagedOperation operation = ManagementSupport.getOperation(managementView,
"JMSServerMO", "isStarted", new ComponentType("JMSManage",
"ServerManage"));
@@ -95,14 +95,11 @@
{
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 connectorNames =
simpleProps.get("connectorNames").getStringValue();
+ boolean ha = simpleProps.get("ha").getBooleanValue();
+ boolean useDiscovery =
simpleProps.get("useDiscovery").getBooleanValue();
+ int cfType = simpleProps.get("cfType").getIntegerValue();
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();
@@ -123,7 +120,6 @@
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();
@@ -131,7 +127,8 @@
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);
+ createConnectionFactory(createResourceReport, managementView, name,
connectorNames, ha, useDiscovery, cfType, bindings,
+ clientId, dupsOkBatchSize, transactionBatchSize,
clientFailureCheckPeriod, connectionTTL, callTimeout, consumerWindowSize,
confirmationWindowSize, producerMaxRate, producerWindowSize, cacheLargeMessageClient,
minLargeMessageSize, blockOnNonDurableSend, blockOnAcknowledge, blockOnDurableSend,
autoGroup, preAcknowledge, maxRetryInterval, retryIntervalMultiplier, reconnectAttempts,
scheduledThreadPoolMaxSize, threadPoolMaxSize, groupId, initialMessagePacketSize,
useGlobalPools, retryInterval, connectionLoadBalancingPolicyClassName);
}
else
{
@@ -181,19 +178,50 @@
this.resourceContext = null;
}
- 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)
+ private void createConnectionFactory(CreateResourceReport createResourceReport,
+ ManagementView managementView,
+ String name,
+ String connectorNames,
+ boolean ha,
+ boolean useDiscovery,
+ int cfType,
+ String bindings,
+ 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,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ String groupId,
+ int initialMessagePacketSize,
+ boolean useGlobalPools,
+ 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.BOOLEAN_PRIMITIVE, ha),
+ new SimpleValueSupport(SimpleMetaType.BOOLEAN_PRIMITIVE, useDiscovery),
+ new SimpleValueSupport(SimpleMetaType.INTEGER_PRIMITIVE, cfType),
+ new SimpleValueSupport(SimpleMetaType.STRING, connectorNames),
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),
@@ -214,7 +242,6 @@
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),
@@ -322,7 +349,7 @@
@Override
protected String getInvokeOperation()
{
- return "invokeManagerOperation";
+ return "invokeManagerOperation";
}
@Override
@@ -357,7 +384,7 @@
public void updateResourceConfiguration(ConfigurationUpdateReport
configurationUpdateReport)
{
-
+
}
private void createRoles(CreateResourceReport configurationUpdateReport, String name,
StringBuffer sendRoles, StringBuffer consumeRoles)
Modified: projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml
===================================================================
--- projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-12-05 10:14:53
UTC (rev 9994)
+++ projects/jopr-plugin/trunk/src/resources/META-INF/rhq-plugin.xml 2010-12-06 09:12:16
UTC (rev 9995)
@@ -606,53 +606,38 @@
<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="JNDI
Bindings" required="true" readOnly="true">
- <c:description>comma-separated list of JNDI bindings (use
'&comma;' if u need to use commas in your jndi
name)</c:description>
+ <c:simple-property name="ha"
+ default="false" type="boolean"
+ displayName="supports high availability"
required="true" readOnly="true">
+ <c:description>whether or not this connection factory will
support high availability</c:description>
</c:simple-property>
- <c:simple-property name="liveTransportClassNames"
-
default="org.hornetq.integration.transports.netty.NettyConnectorFactory"
+ <c:simple-property name="useDiscovery"
+ default="false" type="boolean"
+ displayName="use discovery" required="true"
readOnly="true">
+ <c:description>whether or not to use connectors or
discovery</c:description>
+ </c:simple-property>
+ <c:simple-property name="cfType"
+ default="1" type="integer"
+ displayName="the type of factory" required="true"
readOnly="true">
+ <c:description>the connection factory type</c:description>
+ <c:property-options>
+ <c:option name="JMS Factory" value="0"/>
+ <c:option name="JMS Queue Factory"
value="1"/>
+ <c:option name="JMS Topic Factory"
value="2"/>
+ <c:option name="JMS XA Factory"
value="3"/>
+ <c:option name="JMS XA Queue Factory"
value="4"/>
+ <c:option name="JMS XA Topic Factory"
value="5"/>
+ </c:property-options>
+ </c:simple-property>
+ <c:simple-property name="connectorNames"
+ default="netty"
readOnly="true" required="false"
displayName="Connectors to live servers">
- <c:description>comma-separated list of class names to connect to
live servers, default id
'org.hornetq.core.remoting.impl.netty.NettyConnectorFactory'.</c:description>
+ <c:description>comma-separated list of either connector names or
a discovery group name</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 { }), default is
{host=localhost,port=5445}.</c:description>
+ <c:simple-property name="Bindings" displayName="JNDI
Bindings" required="true" readOnly="true">
+ <c:description>comma-separated list of JNDI bindings (use
'&comma;' if u need to use commas in your jndi
name)</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, default is no backup connectors.</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 { }), default is no backup params. NB these must
match 'Connectors to backup servers', 1 for each entry.</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. NB this is used instead of static connectors, i.e.
setting 'Connectors to backup servers'.</c:description>
- </c:simple-property>
- <c:simple-property name="DiscoveryPort"
- readOnly="true"
- default="0" type="integer"
- displayName="Discovery Port">
- <c:description>port to listen on to discover which connectors
this connection factory can use. Should be used when 'Discovery Address' is set
and greater 0</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 in
milli seconds.</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, in milliseconds. </c:description>
- </c:simple-property>
<c:simple-property name="ClientID"
required="false"
displayName="Client ID">
@@ -763,11 +748,6 @@
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">