JBoss hornetq SVN: r8677 - trunk/src/config/common.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-12-11 11:08:20 -0500 (Fri, 11 Dec 2009)
New Revision: 8677
Modified:
trunk/src/config/common/hornetq-version.properties
Log:
incremented version number
Modified: trunk/src/config/common/hornetq-version.properties
===================================================================
--- trunk/src/config/common/hornetq-version.properties 2009-12-11 15:12:06 UTC (rev 8676)
+++ trunk/src/config/common/hornetq-version.properties 2009-12-11 16:08:20 UTC (rev 8677)
@@ -2,7 +2,7 @@
hornetq.version.majorVersion=2
hornetq.version.minorVersion=0
hornetq.version.microVersion=0
-hornetq.version.incrementingVersion=109
+hornetq.version.incrementingVersion=110
hornetq.version.versionSuffix=CR1
hornetq.version.versionTag=CR1
hornetq.netty.version=(a)NETTY.VERSION@
16 years, 7 months
JBoss hornetq SVN: r8676 - in trunk/src/main/org/hornetq/core: management and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-11 10:12:06 -0500 (Fri, 11 Dec 2009)
New Revision: 8676
Modified:
trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java
trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc
Modified: trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java 2009-12-11 14:45:28 UTC (rev 8675)
+++ trunk/src/main/org/hornetq/core/client/LargeMessageBuffer.java 2009-12-11 15:12:06 UTC (rev 8676)
@@ -19,7 +19,7 @@
import org.hornetq.core.exception.HornetQException;
/**
- * A LargeMessageBufferImpl
+ * A LargeMessageBuffer represents the buffer of a large message.
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
*
@@ -27,18 +27,40 @@
*/
public interface LargeMessageBuffer extends HornetQBuffer
{
+ /**
+ * Returns the size of this buffer.
+
+ */
long getSize();
+ /**
+ * Discards packets unused by this buffer.
+ */
void discardUnusedPackets();
+ /**
+ * Closes this buffer.
+ */
void close();
+ /**
+ * Cancels this buffer.
+ */
void cancel();
+ /**
+ * Sets the OutputStream of this buffer to the specified output.
+ */
void setOutputStream(final OutputStream output) throws HornetQException;
+ /**
+ * Saves this buffer to the specified output.
+ */
void saveBuffer(final OutputStream output) throws HornetQException;
+ /**
+ * Waits for the completion for the specified waiting time (in milliseconds).
+ */
boolean waitCompletion(long timeWait) throws HornetQException;
}
Modified: trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/DayCounterInfo.java 2009-12-11 14:45:28 UTC (rev 8675)
+++ trunk/src/main/org/hornetq/core/management/DayCounterInfo.java 2009-12-11 15:12:06 UTC (rev 8676)
@@ -21,7 +21,10 @@
import org.hornetq.utils.json.JSONObject;
/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link QueueControl#listMessageCounterHistory()}.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public class DayCounterInfo
{
@@ -52,9 +55,12 @@
return json.toString();
}
+ /**
+ * Returns an array of RoleInfo corresponding to the JSON serialization returned
+ * by {@link QueueControl#listMessageCounterHistory()}.
+ */
public static DayCounterInfo[] fromJSON(final String jsonString) throws JSONException
{
-
JSONObject json = new JSONObject(jsonString);
JSONArray dayCounters = json.getJSONArray("dayCounters");
DayCounterInfo[] infos = new DayCounterInfo[dayCounters.length()];
@@ -85,12 +91,17 @@
// Public --------------------------------------------------------
/**
+ * Returns the date of the counter.
*/
public String getDate()
{
return date;
}
+ /**
+ * Returns a 24-length array corresponding to the number of messages added to the queue
+ * for the given hour of the day.
+ */
public int[] getCounters()
{
return counters;
Modified: trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java 2009-12-11 14:45:28 UTC (rev 8675)
+++ trunk/src/main/org/hornetq/core/management/MessageCounterInfo.java 2009-12-11 15:12:06 UTC (rev 8676)
@@ -21,10 +21,10 @@
import org.hornetq.utils.json.JSONObject;
/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link QueueControl#listMessageCounter()}.
*
- * @version <tt>$Revision$</tt>
- *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public class MessageCounterInfo
{
@@ -67,6 +67,10 @@
return json.toString();
}
+ /**
+ * Returns an array of RoleInfo corresponding to the JSON serialization returned
+ * by {@link QueueControl#listMessageCounter()}.
+ */
public static MessageCounterInfo fromJSON(final String jsonString) throws Exception
{
JSONObject data = new JSONObject(jsonString);
@@ -116,46 +120,73 @@
// Public --------------------------------------------------------
+ /**
+ * Returns the name of the queue.
+ */
public String getName()
{
return name;
}
+ /**
+ * Returns the name of the subscription.
+ */
public String getSubscription()
{
return subscription;
}
+ /**
+ * Returns whether the queue is durable.
+ */
public boolean isDurable()
{
return durable;
}
+ /**
+ * Returns the number of messages added to the queue since it was created.
+ */
public long getCount()
{
return count;
}
+ /**
+ * Returns the number of messages added to the queue since the last counter sample.
+ */
public long getCountDelta()
{
return countDelta;
}
+ /**
+ * Returns the number of messages currently in the queue.
+ */
public int getDepth()
{
return depth;
}
+ /**
+ * Returns the number of messages in the queue since last counter sample.
+ */
public int getDepthDelta()
{
return depthDelta;
}
+ /**
+ * Returns the timestamp of the last time a message was added to the queue.
+ */
public String getLastAddTimestamp()
{
return lastAddTimestamp;
}
+ /**
+ * Returns the timestamp of the last time the queue was updated.
+ */
public String getUdpateTimestamp()
{
return udpateTimestamp;
16 years, 7 months
JBoss hornetq SVN: r8675 - in trunk/src/main/org/hornetq: core/client and 10 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-11 09:45:28 -0500 (Fri, 11 Dec 2009)
New Revision: 8675
Added:
trunk/src/main/org/hornetq/core/config/package-info.java
trunk/src/main/org/hornetq/core/exception/package-info.java
trunk/src/main/org/hornetq/core/message/package-info.java
trunk/src/main/org/hornetq/core/remoting/package-info.java
trunk/src/main/org/hornetq/core/remoting/spi/package-info.java
trunk/src/main/org/hornetq/jms/client/package-info.java
trunk/src/main/org/hornetq/jms/management/package-info.java
trunk/src/main/org/hornetq/jms/package-info.java
trunk/src/main/org/hornetq/utils/package-info.java
Modified:
trunk/src/main/org/hornetq/core/buffers/package-info.java
trunk/src/main/org/hornetq/core/client/package-info.java
trunk/src/main/org/hornetq/core/management/package-info.java
trunk/src/main/org/hornetq/core/remoting/Channel.java
trunk/src/main/org/hornetq/jms/HornetQDestination.java
trunk/src/main/org/hornetq/jms/HornetQQueue.java
trunk/src/main/org/hornetq/jms/HornetQTemporaryQueue.java
trunk/src/main/org/hornetq/jms/HornetQTemporaryTopic.java
trunk/src/main/org/hornetq/jms/HornetQTopic.java
trunk/src/main/org/hornetq/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc
* added javadoc for org.hornet.jms package
* added package javadoc for all documented packages
Modified: trunk/src/main/org/hornetq/core/buffers/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/buffers/package-info.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/core/buffers/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -12,7 +12,7 @@
*/
/**
- * HornetQ Buffering.
+ * Buffering API.
* <br>
* This package defines the buffers used by HornetQ. The underlying implementations uses
* Netty's ChannelBuffer and wraps it with methods required by HornetQ usage.
Modified: trunk/src/main/org/hornetq/core/client/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/package-info.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/core/client/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -13,7 +13,7 @@
/**
* Core API to produce and consume messages.
- *
+ * <br>
* This package defines the API used by HornetQ clients to produce and consume messages.
*/
package org.hornetq.core.client;
Added: trunk/src/main/org/hornetq/core/config/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/config/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+/**
+ * Configuration API to configure HornetQ clients and servers.
+ * <br>
+ * This package defines the API used by HornetQ clients configure how they connect to HornetQ servers.
+ * <br>
+ * It also defined the API to configure HornetQ servers.
+ */
+package org.hornetq.core.config;
+
Added: trunk/src/main/org/hornetq/core/exception/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/exception/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/exception/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Core Exception.
+ * <br>
+ * This package defines the root exception used by HornetQ when exceptions occur.
+ */
+package org.hornetq.core.exception;
+
Modified: trunk/src/main/org/hornetq/core/management/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/package-info.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/core/management/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -12,7 +12,7 @@
*/
/**
- * API management to manage HornetQ server and its Core resources.
+ * management API for HornetQ servers and its Core resources.
* <br>
* HornetQ can be managed either using JMX or by sending management messages to the
* server's special management address. Please refer to the user manual for more information.
Added: trunk/src/main/org/hornetq/core/message/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/message/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Core Message API.
+ * <br>
+ * This package defines HornetQ Core Message API.
+ */
+package org.hornetq.core.message;
+
Modified: trunk/src/main/org/hornetq/core/remoting/Channel.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/Channel.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/core/remoting/Channel.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -126,8 +126,6 @@
/**
* returns the Remoting Connection being used by the channel
- *
- * @return
*/
RemotingConnection getConnection();
Added: trunk/src/main/org/hornetq/core/remoting/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/remoting/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Remoting API.
+ * <br>
+ * This package defines the API used by HornetQ for remoting.
+ */
+package org.hornetq.core.remoting;
+
Added: trunk/src/main/org/hornetq/core/remoting/spi/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/spi/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/remoting/spi/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Remoting SPI.
+ * <br>
+ * This package defines the Service Provide Interface that
+ * remoting providers must implement to be supported by HornetQ.
+ */
+package org.hornetq.core.remoting.spi;
+
Modified: trunk/src/main/org/hornetq/jms/HornetQDestination.java
===================================================================
--- trunk/src/main/org/hornetq/jms/HornetQDestination.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/HornetQDestination.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -25,6 +25,8 @@
import org.hornetq.utils.SimpleString;
/**
+ * HornetQ implementation of a JMS Destination.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt>
Modified: trunk/src/main/org/hornetq/jms/HornetQQueue.java
===================================================================
--- trunk/src/main/org/hornetq/jms/HornetQQueue.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/HornetQQueue.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -20,6 +20,10 @@
import org.hornetq.utils.SimpleString;
/**
+ * HornetQ implementation of a JMS Queue.
+ * <br>
+ * This class can be instantiated directly.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt>
Modified: trunk/src/main/org/hornetq/jms/HornetQTemporaryQueue.java
===================================================================
--- trunk/src/main/org/hornetq/jms/HornetQTemporaryQueue.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/HornetQTemporaryQueue.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -19,6 +19,10 @@
import org.hornetq.jms.client.HornetQSession;
/**
+ * HornetQ implementation of a JMS TemporaryQueue.
+ * <br>
+ * This class can be instantiated directly.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision: 3569 $</tt>
*
Modified: trunk/src/main/org/hornetq/jms/HornetQTemporaryTopic.java
===================================================================
--- trunk/src/main/org/hornetq/jms/HornetQTemporaryTopic.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/HornetQTemporaryTopic.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -19,6 +19,10 @@
import org.hornetq.jms.client.HornetQSession;
/**
+ * HornetQ implementation of a JMS TemporaryTopic.
+ * <br>
+ * This class can be instantiated directly.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision: 3569 $</tt>
*
Modified: trunk/src/main/org/hornetq/jms/HornetQTopic.java
===================================================================
--- trunk/src/main/org/hornetq/jms/HornetQTopic.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/HornetQTopic.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -20,6 +20,10 @@
import org.hornetq.utils.SimpleString;
/**
+ * HornetQ implementation of a JMS Topic.
+ * <br>
+ * This class can be instantiated directly.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt>
Added: trunk/src/main/org/hornetq/jms/client/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/client/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+/**
+ * Implementation of the JMS API.
+ * <br>
+ * Classes in this package are not meant to be used directly
+ * except {@link org.hornetq.jms.client.HornetQConnectionFactory} which can be instantiated directly
+ * if JMS resources are not looked up in JNDI.
+ *
+ */
+package org.hornetq.jms.client;
+
Modified: trunk/src/main/org/hornetq/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/JMSServerControl.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/management/JMSServerControl.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -17,6 +17,9 @@
import javax.management.MBeanOperationInfo;
+import org.hornetq.core.client.ClientSessionFactory;
+import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.remoting.spi.ConnectorFactory;
import org.hornetq.core.server.management.Operation;
import org.hornetq.core.server.management.Parameter;
@@ -57,20 +60,51 @@
// Operations ----------------------------------------------------
+ /**
+ * Creates a JMS Queue with the specified name and JNDI binding.
+ *
+ * @return {@code true}�if the queue was created, {@code false} else
+ */
@Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name,
@Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+ /**
+ * Destroys a JMS Queue with the specified name.
+ *
+ * @return {@code true}�if the queue was destroyed, {@code false} else
+ */
@Operation(desc = "Destroy a JMS Queue", impact = MBeanOperationInfo.ACTION)
boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
+ /**
+ * Creates a JMS Topic with the specified name and JNDI binding.
+ *
+ * @return {@code true}�if the topic was created, {@code false} else
+ */
@Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.ACTION)
boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name,
@Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+ /**
+ * Destroys a JMS Topic with the specified name.
+ *
+ * @return {@code true}�if the topic was destroyed, {@code false} else
+ */
@Operation(desc = "Destroy a JMS Topic", impact = MBeanOperationInfo.ACTION)
boolean destroyTopic(@Parameter(name = "name", desc = "Name of the topic to destroy") String name) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a static list of live-backup servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * {@code liveConnectorsTransportClassNames} (resp. {@code backupConnectorsTransportClassNames}) are the class names
+ * of the {@link ConnectorFactory} to connect to the live (resp. backup) servers
+ * and {@code liveConnectorTransportParams} (resp. backupConnectorTransportParams) are Map<String, Object> for the corresponding {@link TransportConfiguration}'s parameters.
+ *
+ * @see ClientSessionFactory#setStaticConnectors(java.util.List)
+ */
void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
@@ -78,6 +112,13 @@
Object[] backupConnectorTransportParams,
Object[] bindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single live-backup pair of servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * {@code backupTransportClassNames} and {@code backupTransportParams}�can be {@code null} if there is no backup server.
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
@@ -86,6 +127,13 @@
@Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a static list of live-backup servers.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ *
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[], Object[])
+ */
void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
@@ -94,6 +142,15 @@
String clientID,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single live-backup pair of servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ * <br>
+ * {@code backupTransportClassNames} and {@code backupTransportParams}�can be {@code null} if there is no backup server.
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
@@ -103,6 +160,16 @@
@Parameter(name = "clientID") String clientID,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a static list of live-backup servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * All parameters corresponds to the underlying ClientSessionFactory used by the factory.
+ *
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[], Object[])
+ * @see ClientSessionFactory
+ */
void createConnectionFactory(String name,
Object[] liveConnectorsTransportClassNames,
Object[] liveConnectorTransportParams,
@@ -138,6 +205,16 @@
String groupID,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single live-backup pair of servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * All parameters corresponds to the underlying ClientSessionFactory used by the factory.
+ *
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[], Object[])
+ * @see ClientSessionFactory
+ */
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
@Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
@@ -173,12 +250,34 @@
@Parameter(name = "groupID") String groupID,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name using a discovery group to discover HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * This factory listens to the specified {@code discoveryAddress} and {@code discoveryPort} to discover which servers it can connect to.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ *
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[], Object[])
+ */
void createConnectionFactory(String name,
String discoveryAddress,
int discoveryPort,
String clientID,
Object[] bindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name using a discovery group to discover HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for the specified bindings Strings
+ * <br>
+ * This factory listens to the specified {@code discoveryAddress} and {@code discoveryPort} to discover which servers it can connect to.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ *
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[], Object[])
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "discoveryAddress") String discoveryAddress,
@@ -186,6 +285,17 @@
@Parameter(name = "clientID") String clientID,
@Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name using a discovery group to discover HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
+ * <br>
+ * This factory listens to the specified {@code discoveryAddress} and {@code discoveryPort} to discover which servers it can connect to.
+ * <br>
+ * All parameters corresponds to the underlying ClientSessionFactory used by the factory.
+ *
+ * @see ClientSessionFactory
+ */
void createConnectionFactory(String name,
String discoveryAddress,
int discoveryPort,
@@ -221,6 +331,17 @@
String groupID,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name using a discovery group to discover HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ * <br>
+ * This factory listens to the specified {@code discoveryAddress} and {@code discoveryPort} to discover which servers it can connect to.
+ * <br>
+ * All parameters corresponds to the underlying ClientSessionFactory used by the factory.
+ *
+ * @see ClientSessionFactory
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "discoveryAddress") String discoveryAddress,
@@ -257,23 +378,51 @@
@Parameter(name = "groupID") String groupID,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single HornetQ server.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings.
+ */
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single HornetQ server.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ * <br>
+ * The {@code liveTransportParams} is a comma-separated list of key=value for the transport parameters corresponding to the {@code TransportConfiguration}�parameters.
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "liveTransportClassName") String liveTransportClassName,
@Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single HornetQ server.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ */
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
String clientID,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a single HornetQ server.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ * <br>
+ * The {@code liveTransportParams} is a comma-separated list of key=value for the transport parameters corresponding to the {@code TransportConfiguration}�parameters.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ */
@Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void createConnectionFactory(@Parameter(name = "name") String name,
@Parameter(name = "liveTransportClassName") String liveTransportClassName,
@@ -281,6 +430,11 @@
@Parameter(name = "clientID") String clientID,
@Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a static list of live-backup HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ */
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
@@ -288,6 +442,13 @@
Map<String, Object> backupTransportParams,
Object[] jndiBindings) throws Exception;
+ /**
+ * Create a JMS ConnectionFactory with the specified name connected to a static list of live-backup HornetQ servers.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified comma-separated bindings.
+ * <br>
+ * Connections created by this ConnectionFactory will have their ClientID set to the specified ClientID.
+ */
void createConnectionFactory(String name,
String liveTransportClassName,
Map<String, Object> liveTransportParams,
@@ -296,21 +457,39 @@
String clientID,
Object[] jndiBindings) throws Exception;
+ /**
+ * Destroy the ConnectionFactory corresponding to the specified name.
+ */
@Operation(desc = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
+ /**
+ * Lists the addresses of all the clients connected to this address.
+ */
@Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
String[] listRemoteAddresses() throws Exception;
+ /**
+ * Lists the addresses of the clients connected to this address which matches the specified IP address.
+ */
@Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO)
String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+ /**
+ * Closes all the connections of clients connected to this server which matches the specified IP address.
+ */
@Operation(desc = "Closes all the connections for the given IP Address", impact = MBeanOperationInfo.INFO)
boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+ /**
+ * Lists all the IDs of the connections connected to this server.
+ */
@Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
String[] listConnectionIDs() throws Exception;
+ /**
+ * Lists all the sessions IDs for the specified connection ID.
+ */
@Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
}
Modified: trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java 2009-12-11 13:18:01 UTC (rev 8674)
+++ trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -13,14 +13,15 @@
package org.hornetq.jms.management;
+import org.hornetq.core.management.AddressControl;
import org.hornetq.utils.json.JSONArray;
import org.hornetq.utils.json.JSONObject;
/**
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods.
+ *
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
*/
public class SubscriptionInfo
{
@@ -42,6 +43,10 @@
// Static --------------------------------------------------------
+ /**
+ * Returns an array of SubscriptionInfo corresponding to the JSON serialization returned
+ * by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods.
+ */
public static SubscriptionInfo[] from(final String jsonString) throws Exception
{
JSONArray array = new JSONArray(jsonString);
@@ -80,31 +85,49 @@
// Public --------------------------------------------------------
+ /**
+ * Returns the name of the HornetQ core queue corresponding to this subscription.
+ */
public String getQueueName()
{
return queueName;
}
+ /**
+ * Returns the client ID of this subscription or {@code null}.
+ */
public String getClientID()
{
return clientID;
}
+ /**
+ * Returns the name of this subscription.
+ */
public String getName()
{
return name;
}
+ /**
+ * Returns whether this subscription is durable.
+ */
public boolean isDurable()
{
return durable;
}
+ /**
+ * Returns the JMS message selector associated to this subscription.
+ */
public String getSelector()
{
return selector;
}
+ /**
+ * Returns the number of messages currently held by this subscription.
+ */
public int getMessageCount()
{
return messageCount;
Added: trunk/src/main/org/hornetq/jms/management/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * management API for HornetQ JMS resources.
+ * <br>
+ * HornetQ JMS resources can be managed either using JMX or by sending JMS management messages to the
+ * server's special management address. Please refer to the user manual for more information.
+ */
+package org.hornetq.jms.management;
+
Added: trunk/src/main/org/hornetq/jms/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/jms/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+/**
+ * Implementation of the JMS Destinations.
+ * <br>
+ * Classes in this package can be instantiated directly
+ * if JMS destinations are not looked up in JNDI.
+ *
+ */
+package org.hornetq.jms;
+
Added: trunk/src/main/org/hornetq/utils/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/utils/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/utils/package-info.java 2009-12-11 14:45:28 UTC (rev 8675)
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+/**
+ * Utilities and helper classes.
+ * <br>
+ * This package defines the utilities class used by HornetQ.
+ */
+package org.hornetq.utils;
+
16 years, 7 months
JBoss hornetq SVN: r8674 - in trunk: docs/user-manual/en and 20 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-11 08:18:01 -0500 (Fri, 11 Dec 2009)
New Revision: 8674
Added:
trunk/src/main/org/hornetq/jms/management/
trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java
trunk/src/main/org/hornetq/jms/management/DestinationControl.java
trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java
trunk/src/main/org/hornetq/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java
trunk/src/main/org/hornetq/jms/management/TopicControl.java
trunk/src/main/org/hornetq/jms/management/impl/
trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
Removed:
trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java
trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java
trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
Modified:
trunk/build-hornetq.xml
trunk/docs/user-manual/en/management.xml
trunk/examples/jms/client-kickoff/readme.html
trunk/examples/jms/jmx/readme.html
trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java
trunk/examples/jms/management/readme.html
trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java
trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java
trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java
trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java
trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java
trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java
trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java
trunk/src/main/org/hornetq/jms/client/HornetQSession.java
trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java
trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java
trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java
trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc
* moved JMS management API to org.hornetq.jms.management
* added javadoc for JMS management API
+ fixed compilation error for jms-tests
Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/build-hornetq.xml 2009-12-11 13:18:01 UTC (rev 8674)
@@ -683,8 +683,8 @@
<fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/*.class"/>
<fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/client/*.class"/>
<fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/referenceable/*.class"/>
- <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/server/management/*.class"/>
- <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/server/management/impl/JMSManagementHelper.class"/>
+ <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/management/*.class"/>
+ <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/management/impl/JMSManagementHelper.class"/>
</jar>
</target>
@@ -1019,7 +1019,7 @@
<include name="org/hornetq/core/remoting/spi"/>
<include name="org/hornetq/jms"/>
<include name="org/hornetq/jms/client"/>
- <include name="org/hornetq/jms/server/management"/>
+ <include name="org/hornetq/jms/management"/>
<include name="org/hornetq/utils"/>
</packageset>
<classpath refid="javadoc.classpath"/>
@@ -1030,7 +1030,7 @@
<group title="HornetQ Remoting API" packages="org.hornetq.core.remoting"/>
<group title="HornetQ Remoting SPI" packages="org.hornetq.core.remoting.spi"/>
<group title="JMS Facade" packages="org.hornetq.jms, org.hornetq.jms.client"/>
- <group title="JMS Management API" packages="org.hornetq.jms.server.management"/>
+ <group title="JMS Management API" packages="org.hornetq.jms.management"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
<link href="http://java.sun.com/javaee/5/docs/api/"/>
</javadoc>
Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/docs/user-manual/en/management.xml 2009-12-11 13:18:01 UTC (rev 8674)
@@ -56,7 +56,7 @@
</listitem>
<listitem>
<para><emphasis>JMS</emphasis> resources are located in the <literal
- >org.hornetq.jms.server.management</literal> package</para>
+ >org.hornetq.jms.management</literal> package</para>
</listitem>
</itemizedlist>
<para>The way to invoke a <emphasis>management operations</emphasis> depends whether JMX, core
@@ -504,7 +504,7 @@
</programlisting>
<para>and the MBean is:</para>
<programlisting>
- org.hornetq.jms.server.management.JMSQueueControl
+ org.hornetq.jms.management.JMSQueueControl
</programlisting>
<para>The MBean's <literal>ObjectName</literal> are built using the helper class <literal
>org.hornetq.core.management.ObjectNameBuilder</literal>. You can also use <literal
@@ -674,7 +674,7 @@
</listitem>
<listitem>
<para>use the helper class <literal
- >org.hornetq.jms.server.management.impl.JMSManagementHelper</literal> to fill the
+ >org.hornetq.jms.management.impl.JMSManagementHelper</literal> to fill the
message with the management properties</para>
</listitem>
<listitem>
@@ -682,7 +682,7 @@
</listitem>
<listitem>
<para>use the helper class <literal
- >org.hornetq.jms.server.management.impl.JMSManagementHelper</literal> to retrieve
+ >org.hornetq.jms.management.impl.JMSManagementHelper</literal> to retrieve
the operation result from the management reply</para>
</listitem>
</orderedlist>
Modified: trunk/examples/jms/client-kickoff/readme.html
===================================================================
--- trunk/examples/jms/client-kickoff/readme.html 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/client-kickoff/readme.html 2009-12-11 13:18:01 UTC (rev 8674)
@@ -132,10 +132,6 @@
<ul>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
- <li>HornetQ defines a set of MBeans for this core
- API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
- package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
- <li><a href="../../../docs/api/org/jboss/messaging/core/management/ObjectNameBuilder.html">ObjectNameBuilder</a> is a helper class used to build the ObjectName of HornetQ manageable resources</li>
</ul>
</body>
</html>
\ No newline at end of file
Modified: trunk/examples/jms/jmx/readme.html
===================================================================
--- trunk/examples/jms/jmx/readme.html 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/jmx/readme.html 2009-12-11 13:18:01 UTC (rev 8674)
@@ -86,7 +86,7 @@
<code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
</pre>
- <li>We create a <a href="../../../docs/api/org/jboss/messaging/jms/server/management/JMSQueueControl.html">JMSQueueControl</a> proxy to manage the queue on the server</li>
+ <li>We create a <code>JMSQueueControl</code> proxy to manage the queue on the server</li>
<pre class="prettyprint">
<code>JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
on,
@@ -156,10 +156,6 @@
<ul>
<li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jmx">Using Management Via JMX chapter</a></li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
- <li>HornetQ defines a set of MBeans for this core
- API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
- package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
- <li><a href="../../../docs/api/org/jboss/messaging/core/management/ObjectNameBuilder.html">ObjectNameBuilder</a> is a helper class used to build the ObjectName of HornetQ manageable resources</li>
</ul>
</body>
</html>
\ No newline at end of file
Modified: trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java
===================================================================
--- trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -32,7 +32,7 @@
import org.hornetq.common.example.HornetQExample;
import org.hornetq.core.management.ObjectNameBuilder;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
/**
* An example that shows how to manage HornetQ using JMX.
Modified: trunk/examples/jms/management/readme.html
===================================================================
--- trunk/examples/jms/management/readme.html 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/management/readme.html 2009-12-11 13:18:01 UTC (rev 8674)
@@ -93,7 +93,7 @@
</pre>
<li>a <em>management</em> message has well-defined properties that HornetQ server needs to know to perform management operations.<br />
- We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to fill these properties:
+ We use a helper class <code>JMSManagementHelper</code> to fill these properties:
<ul>
<li>The name of the resource to manage <code>jms.queue.exampleQueue</code>
(i.e. <code>jms.queue</code> followed by the name of the queue as defined in <a href="server0/hornetq-jms.xml">hornetq-jms.xml</a>)</li>
@@ -109,7 +109,7 @@
<code>Message reply = requestor.request(m);</code>
</pre>
- <li>We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to retrieve the result from the reply message:
+ <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
<pre class="prettyprint">
<code>int messageCount = (Integer)JMSManagementHelper.getResult(reply);
System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");</code>
@@ -142,7 +142,7 @@
System.out.println("operation invocation has succeeded: " + success);</code>
</pre>
- <li>We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to retrieve the result from the reply message:
+ <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
(in our case, the <code>removeMessage</code> method returns a boolean)</li>
<pre class="prettyprint">
<code>boolean messageRemoved = (Boolean)JMSManagementHelper.getResult(reply);
@@ -184,12 +184,6 @@
<ul>
<li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jms">Using Management Via JMS chapter</a></li>
- <li>HornetQ defines a set of resources for this core
- API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
- package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
- <li><a href="../../../docs/api/org/jboss/messaging/core/management/ResourceNames.html">ResourceNames</a> is a helper class used to build the name of HornetQ resources by messages<br />
- The convention is simple: <code>jms.queue.</code> followed by the name of the queue for a JMS queue, <code>jms.topic.</code> followed by the name of a topic for a JMS topic, etc.<br />
- The name for the JMS server resource is <code>jms.server</code></li>
- </p>
+ </ul>
</body>
</html>
\ No newline at end of file
Modified: trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java
===================================================================
--- trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,7 +26,7 @@
import org.hornetq.common.example.HornetQExample;
import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
/**
* An example that shows how to manage HornetQ using JMS messages.
Modified: trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java
===================================================================
--- trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -33,7 +33,7 @@
import org.hornetq.common.example.HornetQExample;
import org.hornetq.core.management.MessageCounterInfo;
import org.hornetq.core.management.ObjectNameBuilder;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
/**
* An example showing how to use message counters to have information on a queue.
Modified: trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java
===================================================================
--- trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -28,7 +28,7 @@
import org.hornetq.common.example.HornetQExample;
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.client.HornetQSession;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
/**
*
Modified: trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java
===================================================================
--- trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -24,7 +24,7 @@
import org.hornetq.common.example.HornetQExample;
import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
/**
* This examples demonstrates a connection created to a server. Failure of the network connection is then simulated
Modified: trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -16,10 +16,10 @@
import javax.management.ObjectName;
import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
import org.hornetq.utils.SimpleString;
/**
Modified: trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -24,7 +24,7 @@
import org.hornetq.core.logging.Logger;
/**
- * This class implements javax.jms.BytesMessage.
+ * HornetQ implementation of a JMS BytesMessage.
*
* @author Norbert Lataille (Norbert.Lataille(a)m4x.org)
* @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
@@ -53,7 +53,7 @@
/*
* This constructor is used to construct messages prior to sending
*/
- public HornetQBytesMessage(final ClientSession session)
+ protected HornetQBytesMessage(final ClientSession session)
{
super(HornetQBytesMessage.TYPE, session);
}
@@ -61,7 +61,7 @@
/*
* Constructor on receipt at client side
*/
- public HornetQBytesMessage(final ClientMessage message, final ClientSession session)
+ protected HornetQBytesMessage(final ClientMessage message, final ClientSession session)
{
super(message, session);
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -50,6 +50,8 @@
import org.hornetq.utils.VersionLoader;
/**
+ * HornetQ implementation of a JMS Connection.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
@@ -118,7 +120,7 @@
// Constructors ---------------------------------------------------------------------------------
- public HornetQConnection(final String username,
+ protected HornetQConnection(final String username,
final String password,
final int connectionType,
final String clientID,
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -42,6 +42,8 @@
import org.hornetq.utils.Pair;
/**
+ * HornetQ implementation of a JMS ConnectionFactory.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @version <tt>$Revision$</tt> $Id$
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -22,7 +22,7 @@
import org.hornetq.core.version.Version;
/**
- * Connection metadata
+ * HornetQ implementation of a JMS ConnectionMetaData.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
@@ -44,7 +44,7 @@
// Constructors --------------------------------------------------
/**
- * Create a new HornetQRAConnectionMetaData object.
+ * Create a new HornetQConnectionMetaData object.
*/
public HornetQConnectionMetaData(final Version serverVersion)
{
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,7 +29,7 @@
import org.hornetq.utils.TypedProperties;
/**
- * This class implements javax.jms.MapMessage
+ * HornetQ implementation of a JMS MapMessage.
*
* @author Norbert Lataille (Norbert.Lataille(a)m4x.org)
* @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
@@ -58,14 +58,14 @@
/*
* This constructor is used to construct messages prior to sending
*/
- public HornetQMapMessage(final ClientSession session)
+ protected HornetQMapMessage(final ClientSession session)
{
super(HornetQMapMessage.TYPE, session);
map = new TypedProperties();
}
- public HornetQMapMessage(final ClientMessage message, final ClientSession session)
+ protected HornetQMapMessage(final ClientMessage message, final ClientSession session)
{
super(message, session);
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -45,7 +45,9 @@
import org.hornetq.utils.SimpleString;
/**
- * Implementation of a JMS Message JMS Messages only live on the client side - the server only deals with MessageImpl
+ * HornetQ implementation of a JMS Message.
+ * <br>
+ * JMS Messages only live on the client side - the server only deals with MessageImpl
* instances
*
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
@@ -241,7 +243,7 @@
}
- public HornetQMessage(final ClientSession session)
+ protected HornetQMessage(final ClientSession session)
{
this(HornetQMessage.TYPE, session);
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -33,10 +33,10 @@
import org.hornetq.utils.SimpleString;
/**
+ * HornetQ implementation of a JMS MessageConsumer.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @version <tt>$Revision$</tt>
- *
- * $Id$
*/
public class HornetQMessageConsumer implements MessageConsumer, QueueReceiver, TopicSubscriber
{
@@ -68,7 +68,7 @@
// Constructors --------------------------------------------------
- public HornetQMessageConsumer(final HornetQSession session,
+ protected HornetQMessageConsumer(final HornetQSession session,
final ClientConsumer consumer,
final boolean noLocal,
final HornetQDestination destination,
@@ -181,7 +181,7 @@
@Override
public String toString()
{
- return "HornetQRAMessageConsumer->" + consumer;
+ return "HornetQMessageConsumer[" + consumer + "]";
}
// Package protected ---------------------------------------------
Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -40,6 +40,8 @@
import org.hornetq.utils.UUIDGenerator;
/**
+ * HornetQ implementation of a JMS MessageProducer.
+ *
* @author <a href="mailto:ovidiu@feodorov.com">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
@@ -83,7 +85,7 @@
// Constructors --------------------------------------------------
- public HornetQMessageProducer(final HornetQConnection jbossConn,
+ protected HornetQMessageProducer(final HornetQConnection jbossConn,
final ClientProducer producer,
final HornetQDestination defaultDestination,
final ClientSession clientSession) throws JMSException
Modified: trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,8 +26,8 @@
import org.hornetq.core.client.ClientSession;
/**
- * This class implements javax.jms.ObjectMessage
- *
+ * HornetQ implementation of a JMS ObjectMessage.
+ * <br>
* Don't used ObjectMessage if you want good performance!
*
* Serialization is slooooow!
@@ -55,12 +55,12 @@
// Constructors --------------------------------------------------
- public HornetQObjectMessage(final ClientSession session)
+ protected HornetQObjectMessage(final ClientSession session)
{
super(HornetQObjectMessage.TYPE, session);
}
- public HornetQObjectMessage(final ClientMessage message, final ClientSession session)
+ protected HornetQObjectMessage(final ClientMessage message, final ClientSession session)
{
super(message, session);
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,6 +29,8 @@
import org.hornetq.utils.SimpleString;
/**
+ * HornetQ implementation of a JMS QueueBrowser.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*
@@ -54,7 +56,7 @@
// Constructors ---------------------------------------------------------------------------------
- public HornetQQueueBrowser(final HornetQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
+ protected HornetQQueueBrowser(final HornetQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
{
this.session = session;
this.queue = queue;
Modified: trunk/src/main/org/hornetq/jms/client/HornetQSession.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQSession.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQSession.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -66,7 +66,8 @@
import org.hornetq.utils.SimpleString;
/**
- *
+ * HornetQ implementation of a JMS Session.
+ * <br>
* Note that we *do not* support JMS ASF (Application Server Facilities) optional
* constructs such as ConnectionConsumer
*
@@ -116,7 +117,7 @@
// Constructors --------------------------------------------------
- public HornetQSession(final HornetQConnection connection,
+ protected HornetQSession(final HornetQConnection connection,
final boolean transacted,
final boolean xa,
final int ackMode,
Modified: trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,7 +26,7 @@
import org.hornetq.utils.DataConstants;
/**
- * This class implements javax.jms.StreamMessage.
+ * HornetQ implementation of a JMS StreamMessage.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*
@@ -56,12 +56,12 @@
// Constructors --------------------------------------------------
- public HornetQStreamMessage(final ClientSession session)
+ protected HornetQStreamMessage(final ClientSession session)
{
super(HornetQStreamMessage.TYPE, session);
}
- public HornetQStreamMessage(final ClientMessage message, final ClientSession session)
+ protected HornetQStreamMessage(final ClientMessage message, final ClientSession session)
{
super(message, session);
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -23,7 +23,9 @@
import org.hornetq.utils.SimpleString;
/**
- * This class implements javax.jms.TextMessage ported from SpyTextMessage in JBossMQ.
+ * HornetQ implementation of a JMS TextMessage.
+ * <br>
+ * This class was ported from SpyTextMessage in JBossMQ.
*
* @author Norbert Lataille (Norbert.Lataille(a)m4x.org)
* @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
Modified: trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -41,7 +41,7 @@
private final boolean transactedOrClientAck;
- public JMSMessageListenerWrapper(final HornetQSession session,
+ protected JMSMessageListenerWrapper(final HornetQSession session,
final ClientConsumer consumer,
final MessageListener listener,
final int ackMode)
Copied: trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,147 @@
+/*
+ * 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.hornetq.jms.management;
+
+import java.util.List;
+
+import org.hornetq.core.client.ClientSessionFactory;
+
+/**
+ * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory.
+ * <br>
+ * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ servers.
+ * Please refer to the ClientSessionFactory for a detailed description.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:fox@redhat.com">Tim Fox</a>
+ *
+ * @see ClientSessionFactory
+ */
+public interface ConnectionFactoryControl
+{
+ /**
+ * Returns the configuration name of this connection factory.
+ */
+ String getName();
+
+ /**
+ * Returns the JNDI bindings associated to this connection factory.
+ */
+ List<String> getBindings();
+
+ /**
+ * Returns the Client ID of this connection factory (or {@code null}�if it is not set.
+ */
+ String getClientID();
+
+ /**
+ * @see ClientSessionFactory#getClientFailureCheckPeriod()
+ */
+ long getClientFailureCheckPeriod();
+
+ /**
+ * @see ClientSessionFactory#getCallTimeout()
+ */
+ long getCallTimeout();
+
+ /**
+ * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode.
+ *
+ * @see ClientSessionFactory#getAckBatchSize()
+ * @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
+ */
+ int getDupsOKBatchSize();
+
+ /**
+ * @see ClientSessionFactory#getConsumerMaxRate()
+ */
+ int getConsumerMaxRate();
+
+ /**
+ * @see ClientSessionFactory#getConsumerWindowSize()
+ */
+ int getConsumerWindowSize();
+
+ /**
+ * @see ClientSessionFactory#getProducerMaxRate()
+ */
+ int getProducerMaxRate();
+
+ /**
+ * @see ClientSessionFactory#getConfirmationWindowSize()
+ */
+ int getConfirmationWindowSize();
+
+ /**
+ * @see ClientSessionFactory#isBlockOnAcknowledge()
+ */
+ boolean isBlockOnAcknowledge();
+
+ /**
+ * @see ClientSessionFactory#isBlockOnDurableSend()
+ */
+ boolean isBlockOnDurableSend();
+
+ /**
+ * @see ClientSessionFactory#isBlockOnNonDurableSend()
+ */
+ boolean isBlockOnNonDurableSend();
+
+ /**
+ * @see ClientSessionFactory#isPreAcknowledge()
+ */
+ boolean isPreAcknowledge();
+
+ /**
+ * @see ClientSessionFactory#getConnectionTTL()
+ */
+ long getConnectionTTL();
+
+ /**
+ * Returns the batch size (in bytes) between acknowledgements when using a transacted session.
+ *
+ * @see ClientSessionFactory#getAckBatchSize()
+ */
+ long getTransactionBatchSize();
+
+ /**
+ * @see ClientSessionFactory#getMinLargeMessageSize()
+ */
+ long getMinLargeMessageSize();
+
+ /**
+ * @see ClientSessionFactory#isAutoGroup()
+ */
+ boolean isAutoGroup();
+
+ /**
+ * @see ClientSessionFactory#getRetryInterval()
+ */
+ long getRetryInterval();
+
+ /**
+ * @see ClientSessionFactory#getRetryIntervalMultiplier()
+ */
+ double getRetryIntervalMultiplier();
+
+ /**
+ * @see ClientSessionFactory#getReconnectAttempts()
+ */
+ int getReconnectAttempts();
+
+ /**
+ * @see ClientSessionFactory#isFailoverOnServerShutdown()
+ */
+ boolean isFailoverOnServerShutdown();
+}
Copied: trunk/src/main/org/hornetq/jms/management/DestinationControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/DestinationControl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/DestinationControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,67 @@
+/*
+ * 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.hornetq.jms.management;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A DestinationControl is used to manage a JMS Destination.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public interface DestinationControl
+{
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Returns the name of this destination.
+ */
+ String getName();
+
+ /**
+ * Returns the JNDI binding of this destination.
+ */
+ String getJNDIBinding();
+
+ /**
+ * Returns the HornetQ address corresponding to this destination.
+ */
+ String getAddress();
+
+ /**
+ * Returns whether this destination is temporary.
+ */
+ boolean isTemporary();
+
+ /**
+ * Returns the number of messages currently in this destination.
+ */
+ int getMessageCount() throws Exception;
+
+ // Operations ----------------------------------------------------
+
+ /**
+ * Removed all the messages which matches the specified JMS filter from this destination.
+ * <br>
+ * Using {@code null} or an empty filter will remove <em>all</em> messages from this destination.
+ *
+ * @return the number of removed messages
+ */
+ @Operation(desc = "Remove messages matching the given filter from the destination", impact = MBeanOperationInfo.ACTION)
+ int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+
+}
\ No newline at end of file
Copied: trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,245 @@
+/*
+ * 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.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A JMSQueueControl is used to manage a JMS queue.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public interface JMSQueueControl extends DestinationControl
+{
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Returns the expiry address associated to this queue.
+ */
+ String getExpiryAddress();
+
+ /**
+ * Sets the expiry address associated to this queue to the specified expiryAddress.
+ */
+ void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception;
+
+ /**
+ * Returns the dead-letter address associated to this queue.
+ */
+ String getDeadLetterAddress();
+
+ /**
+ * Sets the dead-letter address associated to this queue to the specified deadLetterAddress.
+ */
+ void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
+
+ /**
+ * Returns the number of messages added to this queue since it was created.
+ */
+ int getMessagesAdded();
+
+ /**
+ * Returns the number of scheduled messages in this queue.
+ */
+ long getScheduledCount();
+
+ /**
+ * Returns the number of consumers consuming messages from this queue.
+ */
+ int getConsumerCount();
+
+ /**
+ * Returns the number of messages that this queue is currently delivering to its consumers.
+ */
+ int getDeliveringCount();
+
+ // Operations ----------------------------------------------------
+
+ /**
+ * Lists all the JMS messages in this queue matching the specified filter.
+ * <br>
+ * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+ */
+ @Operation(desc = "List all messages in the queue which matches the filter", impact = MBeanOperationInfo.INFO)
+ Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter") String filter) throws Exception;
+
+ /**
+ * Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+ */
+ @Operation(desc = "List all messages in the queue which matches the filter and return them using JSON", impact = MBeanOperationInfo.INFO)
+ String listMessagesAsJSON(@Parameter(name = "filter", desc = "A JMS Message filter (can be empty)") String filter) throws Exception;
+
+ /**
+ * Counts the number of messages in this queue matching the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+ */
+ @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
+ int countMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+
+ /**
+ * Removes the message corresponding to the specified message ID.
+ *
+ * @return {@code true}�if the message was removed, {@code false} else
+ */
+ @Operation(desc = "Remove the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
+ boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+ /**
+ * Removes all the message corresponding to the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will remove <em>all</em> messages from this queue.
+ *
+ * @return the number of removed messages
+ */
+ @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = MBeanOperationInfo.ACTION)
+ int removeMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+
+ /**
+ * Expires all the message corresponding to the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will expire <em>all</em> messages from this queue.
+ *
+ * @return the number of expired messages
+ */
+ @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = MBeanOperationInfo.ACTION)
+ int expireMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+
+ /**
+ * Expires the message corresponding to the specified message ID.
+ *
+ * @return {@code true}�if the message was expired, {@code false} else
+ */
+ @Operation(desc = "Expire the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
+ boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+ /**
+ * Sends the message corresponding to the specified message ID to this queue's dead letter address.
+ *
+ * @return {@code true}�if the message was sent to the dead letter address, {@code false} else
+ */
+ @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
+ boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+ /**
+ * Sends all the message corresponding to the specified filter to this queue's dead letter address.
+ * <br>
+ * Using {@code null} or an empty filter will send <em>all</em> messages from this queue.
+ *
+ * @return the number of sent messages
+ */
+ @Operation(desc = "Send the messages corresponding to the given filter to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
+ int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception;
+
+ /**
+ * Changes the message's priority corresponding to the specified message ID to the specified priority.
+ *
+ * @param newPriority between 0 and 9 inclusive.
+ *
+ * @return {@code true}�if the message priority was changed
+ */
+ @Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
+ boolean changeMessagePriority(@Parameter(name = "messageID", desc = "A message ID") String messageID,
+ @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+
+ /**
+ * Changes the priority for all the message corresponding to the specified filter to the specified priority.
+ * <br>
+ * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
+ *
+ * @return the number of changed messages
+ */
+ @Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = MBeanOperationInfo.ACTION)
+ int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter") String filter,
+ @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+
+ /**
+ * Moves the message corresponding to the specified message ID to the specified other queue.
+ *
+ * @return {@code true}�if the message was moved, {@code false} else
+ */
+ @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = MBeanOperationInfo.ACTION)
+ boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID,
+ @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to") String otherQueueName) throws Exception;
+
+ /**
+ * Moves all the message corresponding to the specified filter to the specified other queue.
+ * <br>
+ * Using {@code null} or an empty filter will move <em>all</em> messages from this queue.
+ *
+ * @return the number of moved messages
+ */
+ @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = MBeanOperationInfo.ACTION)
+ int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
+ @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
+
+ /**
+ * Lists the message counter for this queue.
+ */
+ @Operation(desc = "List the message counters", impact = MBeanOperationInfo.INFO)
+ String listMessageCounter() throws Exception;
+
+ /**
+ * Resets the message counter for this queue.
+ */
+ @Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
+ void resetMessageCounter() throws Exception;
+
+
+ /**
+ * Lists the message counter for this queue as a HTML table.
+ */
+ @Operation(desc = "List the message counters as HTML", impact = MBeanOperationInfo.INFO)
+ String listMessageCounterAsHTML() throws Exception;
+
+ /**
+ * Lists the message counter history for this queue.
+ */
+ @Operation(desc = "List the message counters history", impact = MBeanOperationInfo.INFO)
+ String listMessageCounterHistory() throws Exception;
+
+ /**
+ * Lists the message counter history for this queue as a HTML table.
+ */
+ @Operation(desc = "List the message counters history as HTML", impact = MBeanOperationInfo.INFO)
+ String listMessageCounterHistoryAsHTML() throws Exception;
+
+ /**
+ * Pauses the queue. Messages are no longer delivered to its consumers.
+ */
+ @Operation(desc = "Pause the queue.", impact = MBeanOperationInfo.ACTION)
+ void pause() throws Exception;
+
+ /**
+ * Returns whether the queue is paused.
+ */
+ @Operation(desc = "Returns true if the queue is paused.", impact = MBeanOperationInfo.INFO)
+ boolean isPaused() throws Exception;
+
+ /**
+ * Resumes the queue. Messages are again delivered to its consumers.
+ */
+ @Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
+ void resume() throws Exception;
+
+}
Copied: trunk/src/main/org/hornetq/jms/management/JMSServerControl.java (from rev 8664, trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/JMSServerControl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/JMSServerControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,316 @@
+/*
+ * 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.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A JMSSserverControl is used to manage HornetQ JMS server.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ */
+public interface JMSServerControl
+{
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Returns whether this server is started.
+ */
+ boolean isStarted();
+
+ /**
+ * Returns this server's version
+ */
+ String getVersion();
+
+ /**
+ * Returns the names of the JMS topics available on this server.
+ */
+ String[] getTopicNames();
+
+ /**
+ * Returns the names of the JMS queues available on this server.
+ */
+ String[] getQueueNames();
+
+ /**
+ * Returns the names of the JMS connection factories available on this server.
+ */
+ String[] getConnectionFactoryNames();
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
+ boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name,
+ @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+
+ @Operation(desc = "Destroy a JMS Queue", impact = MBeanOperationInfo.ACTION)
+ boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
+
+ @Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.ACTION)
+ boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name,
+ @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
+
+ @Operation(desc = "Destroy a JMS Topic", impact = MBeanOperationInfo.ACTION)
+ boolean destroyTopic(@Parameter(name = "name", desc = "Name of the topic to destroy") String name) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ Object[] bindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ String clientID,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ boolean cacheLargeMessageClient,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int confirmationWindowSize,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnDurableSend,
+ boolean blockOnNonDurableSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ long maxRetryInterval,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ String groupID,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+ @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+ @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+ @Parameter(name = "connectionTTL") long connectionTTL,
+ @Parameter(name = "callTimeout") long callTimeout,
+ @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
+ @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+ @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+ @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+ @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
+ @Parameter(name = "producerWindowSize") int producerWindowSize,
+ @Parameter(name = "producerMaxRate") int producerMaxRate,
+ @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+ @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
+ @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
+ @Parameter(name = "autoGroup") boolean autoGroup,
+ @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+ @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+ @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+ @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+ @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+ @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+ @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+ @Parameter(name = "retryInterval") long retryInterval,
+ @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+ @Parameter(name = "maxRetryInterval") long maxRetryInterval,
+ @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+ @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+ @Parameter(name = "groupID") String groupID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ Object[] bindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "discoveryAddress") String discoveryAddress,
+ @Parameter(name = "discoveryPort") int discoveryPort,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ long discoveryRefreshTimeout,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ boolean cacheLargeMessageClient,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int confirmationWindowSize,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnDurableSend,
+ boolean blockOnNonDurableSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ long initialWaitTimeout,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ long maxRetryInterval,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ String groupID,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "discoveryAddress") String discoveryAddress,
+ @Parameter(name = "discoveryPort") int discoveryPort,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "discoveryRefreshTimeout") long discoveryRefreshTimeout,
+ @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+ @Parameter(name = "connectionTTL") long connectionTTL,
+ @Parameter(name = "callTimeout") long callTimeout,
+ @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
+ @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+ @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+ @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+ @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
+ @Parameter(name = "producerWindowSize") int producerWindowSize,
+ @Parameter(name = "producerMaxRate") int producerMaxRate,
+ @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+ @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
+ @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
+ @Parameter(name = "autoGroup") boolean autoGroup,
+ @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+ @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+ @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+ @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+ @Parameter(name = "initialWaitTimeout") long initialWaitTimeout,
+ @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+ @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+ @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+ @Parameter(name = "retryInterval") long retryInterval,
+ @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+ @Parameter(name = "maxRetryInterval") long maxRetryInterval,
+ @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+ @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+ @Parameter(name = "groupID") String groupID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void createConnectionFactory(@Parameter(name = "name") String name,
+ @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+ @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+ @Parameter(name = "clientID") String clientID,
+ @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String backupTransportClassName,
+ Map<String, Object> backupTransportParams,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String backupTransportClassName,
+ Map<String, Object> backupTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+ void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
+
+ @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
+ String[] listRemoteAddresses() throws Exception;
+
+ @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO)
+ String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+
+ @Operation(desc = "Closes all the connections for the given IP Address", impact = MBeanOperationInfo.INFO)
+ boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+
+ @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
+ String[] listConnectionIDs() throws Exception;
+
+ @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
+ String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+}
Copied: trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,120 @@
+/*
+ * 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.hornetq.jms.management;
+
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class SubscriptionInfo
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final String queueName;
+
+ private final String clientID;
+
+ private final String name;
+
+ private final boolean durable;
+
+ private final String selector;
+
+ private final int messageCount;
+
+ // Static --------------------------------------------------------
+
+ public static SubscriptionInfo[] from(final String jsonString) throws Exception
+ {
+ JSONArray array = new JSONArray(jsonString);
+ SubscriptionInfo[] infos = new SubscriptionInfo[array.length()];
+ for (int i = 0; i < array.length(); i++)
+ {
+ JSONObject sub = array.getJSONObject(i);
+ SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"),
+ sub.optString("clientID", null),
+ sub.optString("name", null),
+ sub.getBoolean("durable"),
+ sub.optString("selector", null),
+ sub.getInt("messageCount"));
+ infos[i] = info;
+ }
+
+ return infos;
+ }
+
+ // Constructors --------------------------------------------------
+
+ private SubscriptionInfo(final String queueName,
+ final String clientID,
+ final String name,
+ final boolean durable,
+ final String selector,
+ final int messageCount)
+ {
+ this.queueName = queueName;
+ this.clientID = clientID;
+ this.name = name;
+ this.durable = durable;
+ this.selector = selector;
+ this.messageCount = messageCount;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getQueueName()
+ {
+ return queueName;
+ }
+
+ public String getClientID()
+ {
+ return clientID;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean isDurable()
+ {
+ return durable;
+ }
+
+ public String getSelector()
+ {
+ return selector;
+ }
+
+ public int getMessageCount()
+ {
+ return messageCount;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Copied: trunk/src/main/org/hornetq/jms/management/TopicControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/TopicControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/TopicControl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/TopicControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,137 @@
+/*
+ * 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.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A TopicControl is used to manage a JMS Topic.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public interface TopicControl extends DestinationControl
+{
+ // Attributes ----------------------------------------------------
+
+ /**
+ * Returns the number of (durable and non-durable) subscribers for this topic.
+ */
+ int getSubscriptionCount();
+
+ /**
+ * Returns the number of <em>durable</em> subscribers for this topic.
+ */
+ int getDurableSubscriptionCount();
+
+ /**
+ * Returns the number of <em>non-durable</em> subscribers for this topic.
+ */
+ int getNonDurableSubscriptionCount();
+
+ /**
+ * Returns the number of messages for all <em>durable</em> subscribers for this topic.
+ */
+ int getDurableMessageCount();
+
+ /**
+ * Returns the number of messages for all <em>non-durable</em> subscribers for this topic.
+ */
+ int getNonDurableMessageCount();
+
+ // Operations ----------------------------------------------------
+
+ /**
+ * Lists all the subscriptions for this topic (both durable and non-durable).
+ */
+ @Operation(desc = "List all subscriptions")
+ Object[] listAllSubscriptions() throws Exception;
+
+ /**
+ * Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
+ @Operation(desc = "List all subscriptions")
+ String listAllSubscriptionsAsJSON() throws Exception;
+
+ /**
+ * Lists all the <em>durable</em> subscriptions for this topic.
+ */
+ @Operation(desc = "List only the durable subscriptions")
+ Object[] listDurableSubscriptions() throws Exception;
+
+ /**
+ * Lists all the <em>durable</em> subscriptions using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
+ @Operation(desc = "List only the durable subscriptions")
+ String listDurableSubscriptionsAsJSON() throws Exception;
+
+ /**
+ * Lists all the <em>non-durable</em> subscriptions for this topic.
+ */
+ @Operation(desc = "List only the non durable subscriptions")
+ Object[] listNonDurableSubscriptions() throws Exception;
+
+ /**
+ * Lists all the <em>non-durable</em> subscriptions using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
+ @Operation(desc = "List only the non durable subscriptions")
+ String listNonDurableSubscriptionsAsJSON() throws Exception;
+
+ /**
+ * Lists all the messages in this queue matching the specified queue representing the subscription.
+ * <br>
+ * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+ */
+ @Operation(desc = "List all the message for the given subscription")
+ public Map<String, Object>[] listMessagesForSubscription(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
+
+ /**
+ * Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
+ */
+ @Operation(desc = "List all the message for the given subscription")
+ public String listMessagesForSubscriptionAsJSON(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
+
+ /**
+ * Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
+ * <br>
+ * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+ */
+ @Operation(desc = "Count the number of messages matching the filter for the given subscription")
+ public int countMessagesForSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
+ @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName,
+ @Parameter(name = "filter", desc = "a JMS filter (can be empty)") String filter) throws Exception;
+
+ /**
+ * Drops the subscription specified by the specified client ID and subscription name.
+ */
+ @Operation(desc = "Drop a durable subscription", impact = MBeanOperationInfo.ACTION)
+ void dropDurableSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
+ @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName) throws Exception;
+
+ /**
+ * Drops all subscriptions.
+ */
+ @Operation(desc = "Drop all subscriptions from this topic", impact = MBeanOperationInfo.ACTION)
+ void dropAllSubscriptions() throws Exception;
+}
Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,192 @@
+/*
+ * 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.hornetq.jms.management.impl;
+
+import java.util.List;
+
+import javax.management.MBeanInfo;
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSConnectionFactoryControlImpl extends StandardMBean implements ConnectionFactoryControl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final HornetQConnectionFactory cf;
+
+ private final List<String> bindings;
+
+ private final String name;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public JMSConnectionFactoryControlImpl(final HornetQConnectionFactory cf,
+ final String name,
+ final List<String> bindings) throws NotCompliantMBeanException
+ {
+ super(ConnectionFactoryControl.class);
+ this.cf = cf;
+ this.name = name;
+ this.bindings = bindings;
+ }
+
+ // Public --------------------------------------------------------
+
+ // ManagedConnectionFactoryMBean implementation ------------------
+
+ public List<String> getBindings()
+ {
+ return bindings;
+ }
+
+ public String getClientID()
+ {
+ return cf.getClientID();
+ }
+
+ public long getClientFailureCheckPeriod()
+ {
+ return cf.getClientFailureCheckPeriod();
+ }
+
+ public long getCallTimeout()
+ {
+ return cf.getCallTimeout();
+ }
+
+ public int getConsumerMaxRate()
+ {
+ return cf.getConsumerMaxRate();
+ }
+
+ public int getConsumerWindowSize()
+ {
+ return cf.getConsumerWindowSize();
+ }
+
+ public int getProducerMaxRate()
+ {
+ return cf.getProducerMaxRate();
+ }
+
+ public int getConfirmationWindowSize()
+ {
+ return cf.getConfirmationWindowSize();
+ }
+
+ public int getDupsOKBatchSize()
+ {
+ return cf.getDupsOKBatchSize();
+ }
+
+ public boolean isBlockOnAcknowledge()
+ {
+ return cf.isBlockOnAcknowledge();
+ }
+
+ public boolean isBlockOnNonDurableSend()
+ {
+ return cf.isBlockOnNonDurableSend();
+ }
+
+ public boolean isBlockOnDurableSend()
+ {
+ return cf.isBlockOnDurableSend();
+ }
+
+ public boolean isPreAcknowledge()
+ {
+ return cf.isPreAcknowledge();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public long getConnectionTTL()
+ {
+ return cf.getConnectionTTL();
+ }
+
+ public int getReconnectAttempts()
+ {
+ return cf.getReconnectAttempts();
+ }
+
+ public boolean isFailoverOnServerShutdown()
+ {
+ return cf.isFailoverOnServerShutdown();
+ }
+
+ public long getMinLargeMessageSize()
+ {
+ return cf.getMinLargeMessageSize();
+ }
+
+ public long getRetryInterval()
+ {
+ return cf.getRetryInterval();
+ }
+
+ public double getRetryIntervalMultiplier()
+ {
+ return cf.getRetryIntervalMultiplier();
+ }
+
+ public long getTransactionBatchSize()
+ {
+ return cf.getTransactionBatchSize();
+ }
+
+ public boolean isAutoGroup()
+ {
+ return cf.isAutoGroup();
+ }
+
+ @Override
+ public MBeanInfo getMBeanInfo()
+ {
+ MBeanInfo info = super.getMBeanInfo();
+ return new MBeanInfo(info.getClassName(),
+ info.getDescription(),
+ info.getAttributes(),
+ info.getConstructors(),
+ MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class),
+ info.getNotifications());
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,131 @@
+/*
+ * 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.hornetq.jms.management.impl;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+import org.hornetq.jms.client.HornetQMessage;
+
+/*
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ */
+public class JMSManagementHelper
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ private static org.hornetq.core.message.Message getCoreMessage(final Message jmsMessage)
+ {
+ if (jmsMessage instanceof HornetQMessage == false)
+ {
+ throw new IllegalArgumentException("Cannot send a non JBoss message as a management message " + jmsMessage.getClass()
+ .getName());
+ }
+
+ return ((HornetQMessage)jmsMessage).getCoreMessage();
+ }
+
+ public static void putAttribute(final Message message, final String resourceName, final String attribute) throws JMSException
+ {
+ ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
+ }
+
+ public static void putOperationInvocation(final Message message,
+ final String resourceName,
+ final String operationName) throws JMSException
+ {
+ try
+ {
+ ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
+ resourceName,
+ operationName);
+ }
+ catch (Exception e)
+ {
+ throw JMSManagementHelper.convertFromException(e);
+ }
+ }
+
+ private static JMSException convertFromException(final Exception e)
+ {
+ JMSException jmse = new JMSException(e.getMessage());
+
+ jmse.initCause(e);
+
+ return jmse;
+ }
+
+ public static void putOperationInvocation(final Message message,
+ final String resourceName,
+ final String operationName,
+ final Object... parameters) throws JMSException
+ {
+ try
+ {
+ ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
+ resourceName,
+ operationName,
+ parameters);
+ }
+ catch (Exception e)
+ {
+ throw JMSManagementHelper.convertFromException(e);
+ }
+ }
+
+ public static boolean isOperationResult(final Message message) throws JMSException
+ {
+ return ManagementHelper.isOperationResult(JMSManagementHelper.getCoreMessage(message));
+ }
+
+ public static boolean isAttributesResult(final Message message) throws JMSException
+ {
+ return ManagementHelper.isAttributesResult(JMSManagementHelper.getCoreMessage(message));
+ }
+
+ public static boolean hasOperationSucceeded(final Message message) throws JMSException
+ {
+ return ManagementHelper.hasOperationSucceeded(JMSManagementHelper.getCoreMessage(message));
+ }
+
+ public static Object[] getResults(final Message message) throws Exception
+ {
+ return ManagementHelper.getResults(JMSManagementHelper.getCoreMessage(message));
+ }
+
+ public static Object getResult(final Message message) throws Exception
+ {
+ return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message));
+ }
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,360 @@
+/*
+ * 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.hornetq.jms.management.impl;
+
+import java.util.Map;
+
+import javax.management.MBeanInfo;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.management.MessageCounterInfo;
+import org.hornetq.core.management.QueueControl;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.messagecounter.MessageCounter;
+import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
+import org.hornetq.jms.HornetQQueue;
+import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.client.SelectorTranslator;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSQueueControlImpl extends StandardMBean implements JMSQueueControl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(JMSQueueControlImpl.class);
+
+ // Attributes ----------------------------------------------------
+
+ private final HornetQQueue managedQueue;
+
+ private final QueueControl coreQueueControl;
+
+ private final String binding;
+
+ private final MessageCounter counter;
+
+ // Static --------------------------------------------------------
+
+ /**
+ * Returns null if the string is null or empty
+ */
+ public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
+ {
+ return selectorStr == null || selectorStr.trim().length() == 0 ? null
+ : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+ }
+
+ private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
+ {
+ return HornetQMessage.HORNETQ_MESSAGE_ID + " = '" + jmsMessageID + "'";
+ }
+
+ static String toJSON(final Map<String, Object>[] messages)
+ {
+ JSONArray array = new JSONArray();
+ for (Map<String, Object> message : messages)
+ {
+ array.put(new JSONObject(message));
+ }
+ return array.toString();
+ }
+
+ // Constructors --------------------------------------------------
+
+ public JMSQueueControlImpl(final HornetQQueue managedQueue,
+ final QueueControl coreQueueControl,
+ final String jndiBinding,
+ final MessageCounter counter) throws Exception
+ {
+ super(JMSQueueControl.class);
+ this.managedQueue = managedQueue;
+ this.coreQueueControl = coreQueueControl;
+ binding = jndiBinding;
+ this.counter = counter;
+ }
+
+ // Public --------------------------------------------------------
+
+ // ManagedJMSQueueMBean implementation ---------------------------
+
+ public String getName()
+ {
+ return managedQueue.getName();
+ }
+
+ public String getAddress()
+ {
+ return managedQueue.getAddress();
+ }
+
+ public boolean isTemporary()
+ {
+ return managedQueue.isTemporary();
+ }
+
+ public int getMessageCount()
+ {
+ return coreQueueControl.getMessageCount();
+ }
+
+ public int getMessagesAdded()
+ {
+ return coreQueueControl.getMessagesAdded();
+ }
+
+ public int getConsumerCount()
+ {
+ return coreQueueControl.getConsumerCount();
+ }
+
+ public int getDeliveringCount()
+ {
+ return coreQueueControl.getDeliveringCount();
+ }
+
+ public long getScheduledCount()
+ {
+ return coreQueueControl.getScheduledCount();
+ }
+
+ public boolean isDurable()
+ {
+ return coreQueueControl.isDurable();
+ }
+
+ public String getJNDIBinding()
+ {
+ return binding;
+ }
+
+ public String getDeadLetterAddress()
+ {
+ return coreQueueControl.getDeadLetterAddress();
+ }
+
+ public void setDeadLetterAddress(final String deadLetterAddress) throws Exception
+ {
+ coreQueueControl.setDeadLetterAddress(deadLetterAddress);
+ }
+
+ public String getExpiryAddress()
+ {
+ return coreQueueControl.getExpiryAddress();
+ }
+
+ public void setExpiryAddress(final String expiryAddres) throws Exception
+ {
+ coreQueueControl.setExpiryAddress(expiryAddres);
+ }
+
+ public boolean removeMessage(final String messageID) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+ int removed = coreQueueControl.removeMessages(filter);
+ if (removed != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int removeMessages(final String filterStr) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.removeMessages(filter);
+ }
+
+ public Map<String, Object>[] listMessages(final String filterStr) throws Exception
+ {
+ try
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ Map<String, Object>[] coreMessages = coreQueueControl.listMessages(filter);
+
+ Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
+
+ int i = 0;
+
+ for (Map<String, Object> coreMessage : coreMessages)
+ {
+ Map<String, Object> jmsMessage = HornetQMessage.coreMaptoJMSMap(coreMessage);
+ jmsMessages[i++] = jmsMessage;
+ }
+ return jmsMessages;
+ }
+ catch (HornetQException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public String listMessagesAsJSON(final String filter) throws Exception
+ {
+ return JMSQueueControlImpl.toJSON(listMessages(filter));
+ }
+
+ public int countMessages(final String filterStr) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.countMessages(filter);
+ }
+
+ public boolean expireMessage(final String messageID) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+ int expired = coreQueueControl.expireMessages(filter);
+ if (expired != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int expireMessages(final String filterStr) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.expireMessages(filter);
+ }
+
+ public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+ int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+ if (dead != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+ }
+
+ public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+ int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
+ if (changed != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int changeMessagesPriority(final String filterStr, final int newPriority) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.changeMessagesPriority(filter, newPriority);
+ }
+
+ public boolean moveMessage(final String messageID, final String otherQueueName) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+ HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
+ int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress());
+ if (moved != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+
+ return true;
+ }
+
+ public int moveMessages(final String filterStr, final String otherQueueName) throws Exception
+ {
+ String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+ HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
+ return coreQueueControl.moveMessages(filter, otherQueue.getAddress());
+ }
+
+ public String listMessageCounter()
+ {
+ try
+ {
+ return MessageCounterInfo.toJSon(counter);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void resetMessageCounter() throws Exception
+ {
+ coreQueueControl.resetMessageCounter();
+ }
+
+ public String listMessageCounterAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
+ }
+
+ public String listMessageCounterHistory() throws Exception
+ {
+ return MessageCounterHelper.listMessageCounterHistory(counter);
+ }
+
+ public String listMessageCounterHistoryAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
+ }
+
+ public boolean isPaused() throws Exception
+ {
+ return coreQueueControl.isPaused();
+ }
+
+ public void pause() throws Exception
+ {
+ coreQueueControl.pause();
+ }
+
+ public void resume() throws Exception
+ {
+ coreQueueControl.resume();
+ }
+
+ @Override
+ public MBeanInfo getMBeanInfo()
+ {
+ MBeanInfo info = super.getMBeanInfo();
+ return new MBeanInfo(info.getClassName(),
+ info.getDescription(),
+ info.getAttributes(),
+ info.getConstructors(),
+ MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class),
+ info.getNotifications());
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,820 @@
+/*
+ * 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.hornetq.jms.management.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanNotificationInfo;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.utils.Pair;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSServerControlImpl extends StandardMBean implements JMSServerControl, NotificationEmitter
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final JMSServerManager server;
+
+ private final NotificationBroadcasterSupport broadcaster;
+
+ private final AtomicLong notifSeq = new AtomicLong(0);
+
+ // Static --------------------------------------------------------
+
+ private static List<String> convert(final Object[] jndiBindings)
+ {
+ List<String> bindings = new ArrayList<String>();
+ for (Object object : jndiBindings)
+ {
+ bindings.add(object.toString().trim());
+ }
+ return bindings;
+ }
+
+ private static String[] toArray(final String commaSeparatedString)
+ {
+ if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+ {
+ return new String[0];
+ }
+ String[] values = commaSeparatedString.split(",");
+ String[] trimmed = new String[values.length];
+ for (int i = 0; i < values.length; i++)
+ {
+ trimmed[i] = values[i].trim();
+ }
+ return trimmed;
+ }
+
+ private static List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams)
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
+
+ for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
+ {
+ Map<String, Object> liveParams = null;
+ if (liveConnectorTransportParams.length > i)
+ {
+ liveParams = (Map<String, Object>)liveConnectorTransportParams[i];
+ }
+
+ TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
+ liveParams);
+
+ Map<String, Object> backupParams = null;
+ if (backupConnectorTransportParams.length > i)
+ {
+ backupParams = (Map<String, Object>)backupConnectorTransportParams[i];
+ }
+
+ TransportConfiguration tcBackup = null;
+ if (backupConnectorsTransportClassNames.length > i)
+ {
+ new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(), backupParams);
+ }
+ Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
+ tcBackup);
+
+ pairs.add(pair);
+ }
+
+ return pairs;
+ }
+
+ public static MBeanNotificationInfo[] getNotificationInfos()
+ {
+ NotificationType[] values = NotificationType.values();
+ String[] names = new String[values.length];
+ for (int i = 0; i < values.length; i++)
+ {
+ names[i] = values[i].toString();
+ }
+ return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
+ JMSServerControl.class.getName(),
+ "Notifications emitted by a JMS Server") };
+ }
+
+ // Constructors --------------------------------------------------
+
+ public JMSServerControlImpl(final JMSServerManager server) throws Exception
+ {
+ super(JMSServerControl.class);
+ this.server = server;
+ broadcaster = new NotificationBroadcasterSupport();
+ }
+
+ // Public --------------------------------------------------------
+
+ // JMSServerControlMBean implementation --------------------------
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name, pairs, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String jndiBindings) throws Exception
+ {
+ Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+ Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+ createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+ Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final String clientID,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final boolean cacheLargeMessageClient,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int confirmationWindowSize,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnDurableSend,
+ final boolean blockOnNonDurableSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final long maxRetryInterval,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String groupID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name,
+ pairs,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ cacheLargeMessageClient,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ confirmationWindowSize,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnDurableSend,
+ blockOnNonDurableSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ maxRetryInterval,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ groupID,
+ jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassNames,
+ final String liveTransportParams,
+ final String backupTransportClassNames,
+ final String backupTransportParams,
+ final String clientID,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final boolean cacheLargeMessageClient,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int confirmationWindowSize,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnDurableSend,
+ final boolean blockOnNonDurableSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final long maxRetryInterval,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String groupID,
+ final String jndiBindings) throws Exception
+ {
+ Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+ Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+ Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+ Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);
+ Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name,
+ liveClassNames,
+ liveParams,
+ backupClassNames,
+ backupParams,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ cacheLargeMessageClient,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ confirmationWindowSize,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnDurableSend,
+ blockOnNonDurableSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ maxRetryInterval,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ groupID,
+ bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final long discoveryRefreshTimeout,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final boolean cacheLargeMessageClient,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int confirmationWindowSize,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnDurableSend,
+ final boolean blockOnNonDurableSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final long initialWaitTimeout,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final long maxRetryInterval,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String groupID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ discoveryRefreshTimeout,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ cacheLargeMessageClient,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ confirmationWindowSize,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnDurableSend,
+ blockOnNonDurableSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ maxRetryInterval,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ groupID,
+ jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final long discoveryRefreshTimeout,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final boolean cacheLargeMessageClient,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int confirmationWindowSize,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnDurableSend,
+ final boolean blockOnNonDurableSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final long initialWaitTimeout,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final long maxRetryInterval,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final String groupID,
+ final String jndiBindings) throws Exception
+ {
+ Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ discoveryRefreshTimeout,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ cacheLargeMessageClient,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ confirmationWindowSize,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnDurableSend,
+ blockOnNonDurableSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ maxRetryInterval,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ groupID,
+ bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ server.createConnectionFactory(name, liveTC, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final String liveTransportParams,
+ final String jndiBindings) throws Exception
+ {
+ Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+ String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name, liveTransportClassName, params, bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ server.createConnectionFactory(name, liveTC, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final String liveTransportParams,
+ final String clientID,
+ final String jndiBindings) throws Exception
+ {
+ Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+ String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+ createConnectionFactory(name, liveTransportClassName, params, clientID, bindings);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String backupTransportClassName,
+ final Map<String, Object> backupTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
+
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name, liveTC, backupTC, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String backupTransportClassName,
+ final Map<String, Object> backupTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
+
+ List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+ server.createConnectionFactory(name, liveTC, backupTC, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public boolean createQueue(final String name, final String jndiBinding) throws Exception
+ {
+ boolean created = server.createQueue(name, jndiBinding, null, true);
+ if (created)
+ {
+ sendNotification(NotificationType.QUEUE_CREATED, name);
+ }
+ return created;
+ }
+
+ public boolean destroyQueue(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyQueue(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.QUEUE_DESTROYED, name);
+ }
+ return destroyed;
+ }
+
+ public boolean createTopic(final String topicName, final String jndiBinding) throws Exception
+ {
+ boolean created = server.createTopic(topicName, jndiBinding);
+ if (created)
+ {
+ sendNotification(NotificationType.TOPIC_CREATED, topicName);
+ }
+ return created;
+ }
+
+ public boolean destroyTopic(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyTopic(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.TOPIC_DESTROYED, name);
+ }
+ return destroyed;
+ }
+
+ public void destroyConnectionFactory(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyConnectionFactory(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.CONNECTION_FACTORY_DESTROYED, name);
+ }
+ }
+
+ public boolean isStarted()
+ {
+ return server.isStarted();
+ }
+
+ public String getVersion()
+ {
+ return server.getVersion();
+ }
+
+ public String[] getQueueNames()
+ {
+ Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
+ String[] names = new String[queueControls.length];
+ for (int i = 0; i < queueControls.length; i++)
+ {
+ JMSQueueControl queueControl = (JMSQueueControl)queueControls[i];
+ names[i] = queueControl.getName();
+ }
+ return names;
+ }
+
+ public String[] getTopicNames()
+ {
+ Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
+ String[] names = new String[topicControls.length];
+ for (int i = 0; i < topicControls.length; i++)
+ {
+ TopicControl topicControl = (TopicControl)topicControls[i];
+ names[i] = topicControl.getName();
+ }
+ return names;
+ }
+
+ public String[] getConnectionFactoryNames()
+ {
+ Object[] cfControls = server.getHornetQServer()
+ .getManagementService()
+ .getResources(ConnectionFactoryControl.class);
+ String[] names = new String[cfControls.length];
+ for (int i = 0; i < cfControls.length; i++)
+ {
+ ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
+ names[i] = cfControl.getName();
+ }
+ return names;
+ }
+
+ // NotificationEmitter implementation ----------------------------
+
+ public void removeNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener, filter, handback);
+ }
+
+ public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener);
+ }
+
+ public void addNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws IllegalArgumentException
+ {
+ broadcaster.addNotificationListener(listener, filter, handback);
+ }
+
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
+ return JMSServerControlImpl.getNotificationInfos();
+ }
+
+ public String[] listRemoteAddresses() throws Exception
+ {
+ return server.listRemoteAddresses();
+ }
+
+ public String[] listRemoteAddresses(final String ipAddress) throws Exception
+ {
+ return server.listRemoteAddresses(ipAddress);
+ }
+
+ public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
+ {
+ return server.closeConnectionsForAddress(ipAddress);
+ }
+
+ public String[] listConnectionIDs() throws Exception
+ {
+ return server.listConnectionIDs();
+ }
+
+ public String[] listSessions(final String connectionID) throws Exception
+ {
+ return server.listSessions(connectionID);
+ }
+
+ @Override
+ public MBeanInfo getMBeanInfo()
+ {
+ MBeanInfo info = super.getMBeanInfo();
+ return new MBeanInfo(info.getClassName(),
+ info.getDescription(),
+ info.getAttributes(),
+ info.getConstructors(),
+ MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
+ info.getNotifications());
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private void sendNotification(final NotificationType type, final String message)
+ {
+ Notification notif = new Notification(type.toString(), this, notifSeq.incrementAndGet(), message);
+ broadcaster.sendNotification(notif);
+ }
+
+ // Inner classes -------------------------------------------------
+
+ public static enum NotificationType
+ {
+ QUEUE_CREATED,
+ QUEUE_DESTROYED,
+ TOPIC_CREATED,
+ TOPIC_DESTROYED,
+ CONNECTION_FACTORY_CREATED,
+ CONNECTION_FACTORY_DESTROYED;
+ }
+
+}
Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,371 @@
+/*
+ * 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.hornetq.jms.management.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.MBeanInfo;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.management.AddressControl;
+import org.hornetq.core.management.HornetQServerControl;
+import org.hornetq.core.management.QueueControl;
+import org.hornetq.core.management.ResourceNames;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.jms.HornetQTopic;
+import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.client.SelectorTranslator;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.utils.Pair;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSTopicControlImpl extends StandardMBean implements TopicControl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(JMSTopicControlImpl.class);
+
+ // Attributes ----------------------------------------------------
+
+ private final HornetQTopic managedTopic;
+
+ private final String binding;
+
+ private final AddressControl addressControl;
+
+ private final ManagementService managementService;
+
+ // Static --------------------------------------------------------
+
+ public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
+ {
+ return selectorStr == null || selectorStr.trim().length() == 0 ? null
+ : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+ }
+
+ // Constructors --------------------------------------------------
+
+ public JMSTopicControlImpl(final HornetQTopic topic,
+ final AddressControl addressControl,
+ final String jndiBinding,
+ final ManagementService managementService) throws Exception
+ {
+ super(TopicControl.class);
+ managedTopic = topic;
+ this.addressControl = addressControl;
+ binding = jndiBinding;
+ this.managementService = managementService;
+ }
+
+ // TopicControlMBean implementation ------------------------------
+
+ public String getName()
+ {
+ return managedTopic.getName();
+ }
+
+ public boolean isTemporary()
+ {
+ return managedTopic.isTemporary();
+ }
+
+ public String getAddress()
+ {
+ return managedTopic.getAddress();
+ }
+
+ public String getJNDIBinding()
+ {
+ return binding;
+ }
+
+ public int getMessageCount()
+ {
+ return getMessageCount(DurabilityType.ALL);
+ }
+
+ public int getDurableMessageCount()
+ {
+ return getMessageCount(DurabilityType.DURABLE);
+ }
+
+ public int getNonDurableMessageCount()
+ {
+ return getMessageCount(DurabilityType.NON_DURABLE);
+ }
+
+ public int getSubscriptionCount()
+ {
+ return getQueues(DurabilityType.ALL).size();
+ }
+
+ public int getDurableSubscriptionCount()
+ {
+ return getQueues(DurabilityType.DURABLE).size();
+ }
+
+ public int getNonDurableSubscriptionCount()
+ {
+ return getQueues(DurabilityType.NON_DURABLE).size();
+ }
+
+ public Object[] listAllSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.ALL);
+ }
+
+ public String listAllSubscriptionsAsJSON() throws Exception
+ {
+ return listSubscribersInfosAsJSON(DurabilityType.ALL);
+ }
+
+ public Object[] listDurableSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.DURABLE);
+ }
+
+ public String listDurableSubscriptionsAsJSON() throws Exception
+ {
+ return listSubscribersInfosAsJSON(DurabilityType.DURABLE);
+ }
+
+ public Object[] listNonDurableSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.NON_DURABLE);
+ }
+
+ public String listNonDurableSubscriptionsAsJSON() throws Exception
+ {
+ return listSubscribersInfosAsJSON(DurabilityType.NON_DURABLE);
+ }
+
+ public Map<String, Object>[] listMessagesForSubscription(final String queueName) throws Exception
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName);
+ }
+
+ Map<String, Object>[] coreMessages = coreQueueControl.listMessages(null);
+
+ Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
+
+ int i = 0;
+
+ for (Map<String, Object> coreMessage : coreMessages)
+ {
+ jmsMessages[i++] = HornetQMessage.coreMaptoJMSMap(coreMessage);
+ }
+ return jmsMessages;
+ }
+
+ public String listMessagesForSubscriptionAsJSON(final String queueName) throws Exception
+ {
+ return JMSQueueControlImpl.toJSON(listMessagesForSubscription(queueName));
+ }
+
+ public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
+ {
+ String queueName = HornetQTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
+ }
+ String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.listMessages(filter).length;
+ }
+
+ public int removeMessages(final String filterStr) throws Exception
+ {
+ String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
+ int count = 0;
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+ count += coreQueueControl.removeMessages(filter);
+ }
+
+ return count;
+ }
+
+ public void dropDurableSubscription(final String clientID, final String subscriptionName) throws Exception
+ {
+ String queueName = HornetQTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
+ }
+ HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+ serverControl.destroyQueue(queueName);
+ }
+
+ public void dropAllSubscriptions() throws Exception
+ {
+ HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ serverControl.destroyQueue(queue);
+ }
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private Object[] listSubscribersInfos(final DurabilityType durability)
+ {
+ List<QueueControl> queues = getQueues(durability);
+ List<Object[]> subInfos = new ArrayList<Object[]>(queues.size());
+
+ for (QueueControl queue : queues)
+ {
+ String clientID = null;
+ String subName = null;
+
+ if (queue.isDurable())
+ {
+ Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
+ .toString());
+ clientID = pair.a;
+ subName = pair.b;
+ }
+
+ String filter = queue.getFilter() != null ? queue.getFilter() : null;
+
+ Object[] subscriptionInfo = new Object[6];
+ subscriptionInfo[0] = queue.getName();
+ subscriptionInfo[1] = clientID;
+ subscriptionInfo[2] = subName;
+ subscriptionInfo[3] = queue.isDurable();
+ subscriptionInfo[4] = queue.getMessageCount();
+
+ subInfos.add(subscriptionInfo);
+ }
+ return subInfos.toArray(new Object[subInfos.size()]);
+ }
+
+ private String listSubscribersInfosAsJSON(final DurabilityType durability) throws Exception
+ {
+ List<QueueControl> queues = getQueues(durability);
+ JSONArray array = new JSONArray();
+
+ for (QueueControl queue : queues)
+ {
+ String clientID = null;
+ String subName = null;
+
+ if (queue.isDurable())
+ {
+ Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
+ .toString());
+ clientID = pair.a;
+ subName = pair.b;
+ }
+
+ String filter = queue.getFilter() != null ? queue.getFilter() : null;
+
+ JSONObject info = new JSONObject();
+ info.put("queueName", queue.getName());
+ info.put("clientID", clientID);
+ info.put("selector", filter);
+ info.put("name", subName);
+ info.put("durable", queue.isDurable());
+ info.put("messageCount", queue.getMessageCount());
+ array.put(info);
+ }
+
+ return array.toString();
+ }
+
+ private int getMessageCount(final DurabilityType durability)
+ {
+ List<QueueControl> queues = getQueues(durability);
+ int count = 0;
+ for (QueueControl queue : queues)
+ {
+ count += queue.getMessageCount();
+ }
+ return count;
+ }
+
+ private List<QueueControl> getQueues(final DurabilityType durability)
+ {
+ try
+ {
+ List<QueueControl> matchingQueues = new ArrayList<QueueControl>();
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+
+ // Ignore the "special" subscription
+ if (!coreQueueControl.getName().equals(addressControl.getAddress()))
+ {
+ if (durability == DurabilityType.ALL || durability == DurabilityType.DURABLE &&
+ coreQueueControl.isDurable() ||
+ durability == DurabilityType.NON_DURABLE &&
+ !coreQueueControl.isDurable())
+ {
+ matchingQueues.add(coreQueueControl);
+ }
+ }
+ }
+ return matchingQueues;
+ }
+ catch (Exception e)
+ {
+ return Collections.emptyList();
+ }
+ }
+
+ @Override
+ public MBeanInfo getMBeanInfo()
+ {
+ MBeanInfo info = super.getMBeanInfo();
+ return new MBeanInfo(info.getClassName(),
+ info.getDescription(),
+ info.getAttributes(),
+ info.getConstructors(),
+ MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class),
+ info.getNotifications());
+ }
+
+ // Inner classes -------------------------------------------------
+
+ private enum DurabilityType
+ {
+ ALL, DURABLE, NON_DURABLE
+ }
+}
Deleted: trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,70 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:fox@redhat.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface ConnectionFactoryControl
-{
- String getName();
-
- List<String> getBindings();
-
- String getClientID();
-
- long getClientFailureCheckPeriod();
-
- long getCallTimeout();
-
- int getDupsOKBatchSize();
-
- int getConsumerMaxRate();
-
- int getConsumerWindowSize();
-
- int getProducerMaxRate();
-
- int getConfirmationWindowSize();
-
- boolean isBlockOnAcknowledge();
-
- boolean isBlockOnDurableSend();
-
- boolean isBlockOnNonDurableSend();
-
- boolean isPreAcknowledge();
-
- long getConnectionTTL();
-
- long getTransactionBatchSize();
-
- long getMinLargeMessageSize();
-
- boolean isAutoGroup();
-
- long getRetryInterval();
-
- double getRetryIntervalMultiplier();
-
- int getReconnectAttempts();
-
- boolean isFailoverOnNodeShutdown();
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,67 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A DestinationControl is used to manage a JMS Destination.
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface DestinationControl
-{
- // Attributes ----------------------------------------------------
-
- /**
- * Returns the name of this destination.
- */
- String getName();
-
- /**
- * Returns the JNDI binding of this destination.
- */
- String getJNDIBinding();
-
- /**
- * Returns the HornetQ address corresponding to this destination.
- */
- String getAddress();
-
- /**
- * Returns whether this destination is temporary.
- */
- boolean isTemporary();
-
- /**
- * Returns the number of messages currently in this destination.
- */
- int getMessageCount() throws Exception;
-
- // Operations ----------------------------------------------------
-
- /**
- * Removed all the messages which matches the specified JMS filter from this destination.
- * <br>
- * Using {@code null} or an empty filter will remove <em>all</em> messages from this destination.
- *
- * @return the number of removed messages
- */
- @Operation(desc = "Remove messages matching the given filter from the destination", impact = MBeanOperationInfo.ACTION)
- int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
-
-}
\ No newline at end of file
Modified: trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -18,6 +18,7 @@
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.HornetQTopic;
import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.JMSServerControl;
import org.hornetq.jms.server.JMSServerManager;
/**
Deleted: trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,245 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A JMSQueueControl is used to manage a JMS queue.
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface JMSQueueControl extends DestinationControl
-{
- // Attributes ----------------------------------------------------
-
- /**
- * Returns the expiry address associated to this queue.
- */
- String getExpiryAddress();
-
- /**
- * Sets the expiry address associated to this queue to the specified expiryAddress.
- */
- void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception;
-
- /**
- * Returns the dead-letter address associated to this queue.
- */
- String getDeadLetterAddress();
-
- /**
- * Sets the dead-letter address associated to this queue to the specified deadLetterAddress.
- */
- void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
-
- /**
- * Returns the number of messages added to this queue since it was created.
- */
- int getMessagesAdded();
-
- /**
- * Returns the number of scheduled messages in this queue.
- */
- long getScheduledCount();
-
- /**
- * Returns the number of consumers consuming messages from this queue.
- */
- int getConsumerCount();
-
- /**
- * Returns the number of messages that this queue is currently delivering to its consumers.
- */
- int getDeliveringCount();
-
- // Operations ----------------------------------------------------
-
- /**
- * Lists all the JMS messages in this queue matching the specified filter.
- * <br>
- * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
- * <br>
- * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
- */
- @Operation(desc = "List all messages in the queue which matches the filter", impact = MBeanOperationInfo.INFO)
- Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter") String filter) throws Exception;
-
- /**
- * Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
- * <br>
- * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
- */
- @Operation(desc = "List all messages in the queue which matches the filter and return them using JSON", impact = MBeanOperationInfo.INFO)
- String listMessagesAsJSON(@Parameter(name = "filter", desc = "A JMS Message filter (can be empty)") String filter) throws Exception;
-
- /**
- * Counts the number of messages in this queue matching the specified filter.
- * <br>
- * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
- */
- @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
- int countMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
-
- /**
- * Removes the message corresponding to the specified message ID.
- *
- * @return {@code true}�if the message was removed, {@code false} else
- */
- @Operation(desc = "Remove the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
- boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
- /**
- * Removes all the message corresponding to the specified filter.
- * <br>
- * Using {@code null} or an empty filter will remove <em>all</em> messages from this queue.
- *
- * @return the number of removed messages
- */
- @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = MBeanOperationInfo.ACTION)
- int removeMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
-
- /**
- * Expires all the message corresponding to the specified filter.
- * <br>
- * Using {@code null} or an empty filter will expire <em>all</em> messages from this queue.
- *
- * @return the number of expired messages
- */
- @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = MBeanOperationInfo.ACTION)
- int expireMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
-
- /**
- * Expires the message corresponding to the specified message ID.
- *
- * @return {@code true}�if the message was expired, {@code false} else
- */
- @Operation(desc = "Expire the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
- boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
- /**
- * Sends the message corresponding to the specified message ID to this queue's dead letter address.
- *
- * @return {@code true}�if the message was sent to the dead letter address, {@code false} else
- */
- @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
- boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
- /**
- * Sends all the message corresponding to the specified filter to this queue's dead letter address.
- * <br>
- * Using {@code null} or an empty filter will send <em>all</em> messages from this queue.
- *
- * @return the number of sent messages
- */
- @Operation(desc = "Send the messages corresponding to the given filter to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
- int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception;
-
- /**
- * Changes the message's priority corresponding to the specified message ID to the specified priority.
- *
- * @param newPriority between 0 and 9 inclusive.
- *
- * @return {@code true}�if the message priority was changed
- */
- @Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
- boolean changeMessagePriority(@Parameter(name = "messageID", desc = "A message ID") String messageID,
- @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
-
- /**
- * Changes the priority for all the message corresponding to the specified filter to the specified priority.
- * <br>
- * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
- *
- * @return the number of changed messages
- */
- @Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = MBeanOperationInfo.ACTION)
- int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter") String filter,
- @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
-
- /**
- * Moves the message corresponding to the specified message ID to the specified other queue.
- *
- * @return {@code true}�if the message was moved, {@code false} else
- */
- @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = MBeanOperationInfo.ACTION)
- boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID,
- @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to") String otherQueueName) throws Exception;
-
- /**
- * Moves all the message corresponding to the specified filter to the specified other queue.
- * <br>
- * Using {@code null} or an empty filter will move <em>all</em> messages from this queue.
- *
- * @return the number of moved messages
- */
- @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = MBeanOperationInfo.ACTION)
- int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
- @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
-
- /**
- * Lists the message counter for this queue.
- */
- @Operation(desc = "List the message counters", impact = MBeanOperationInfo.INFO)
- String listMessageCounter() throws Exception;
-
- /**
- * Resets the message counter for this queue.
- */
- @Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
- void resetMessageCounter() throws Exception;
-
-
- /**
- * Lists the message counter for this queue as a HTML table.
- */
- @Operation(desc = "List the message counters as HTML", impact = MBeanOperationInfo.INFO)
- String listMessageCounterAsHTML() throws Exception;
-
- /**
- * Lists the message counter history for this queue.
- */
- @Operation(desc = "List the message counters history", impact = MBeanOperationInfo.INFO)
- String listMessageCounterHistory() throws Exception;
-
- /**
- * Lists the message counter history for this queue as a HTML table.
- */
- @Operation(desc = "List the message counters history as HTML", impact = MBeanOperationInfo.INFO)
- String listMessageCounterHistoryAsHTML() throws Exception;
-
- /**
- * Pauses the queue. Messages are no longer delivered to its consumers.
- */
- @Operation(desc = "Pause the queue.", impact = MBeanOperationInfo.ACTION)
- void pause() throws Exception;
-
- /**
- * Returns whether the queue is paused.
- */
- @Operation(desc = "Returns true if the queue is paused.", impact = MBeanOperationInfo.INFO)
- boolean isPaused() throws Exception;
-
- /**
- * Resumes the queue. Messages are again delivered to its consumers.
- */
- @Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
- void resume() throws Exception;
-
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,302 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface JMSServerControl
-{
- // Attributes ----------------------------------------------------
-
- boolean isStarted();
-
- String getVersion();
-
- String[] getTopicNames();
-
- String[] getQueueNames();
-
- String[] getConnectionFactoryNames();
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.ACTION)
- boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create") String name,
- @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
-
- @Operation(desc = "Destroy a JMS Queue", impact = MBeanOperationInfo.ACTION)
- boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
-
- @Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.ACTION)
- boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create") String name,
- @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI") String jndiBinding) throws Exception;
-
- @Operation(desc = "Destroy a JMS Topic", impact = MBeanOperationInfo.ACTION)
- boolean destroyTopic(@Parameter(name = "name", desc = "Name of the topic to destroy") String name) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- Object[] bindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
- @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
- @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
- @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
- @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
- @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
- @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
- @Parameter(name = "clientID") String clientID,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- String clientID,
- long clientFailureCheckPeriod,
- long connectionTTL,
- long callTimeout,
- boolean cacheLargeMessageClient,
- int minLargeMessageSize,
- int consumerWindowSize,
- int consumerMaxRate,
- int confirmationWindowSize,
- int producerWindowSize,
- int producerMaxRate,
- boolean blockOnAcknowledge,
- boolean blockOnDurableSend,
- boolean blockOnNonDurableSend,
- boolean autoGroup,
- boolean preAcknowledge,
- String loadBalancingPolicyClassName,
- int transactionBatchSize,
- int dupsOKBatchSize,
- boolean useGlobalPools,
- int scheduledThreadPoolMaxSize,
- int threadPoolMaxSize,
- long retryInterval,
- double retryIntervalMultiplier,
- long maxRetryInterval,
- int reconnectAttempts,
- boolean failoverOnServerShutdown,
- String groupID,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
- @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
- @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
- @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
- @Parameter(name = "clientID") String clientID,
- @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
- @Parameter(name = "connectionTTL") long connectionTTL,
- @Parameter(name = "callTimeout") long callTimeout,
- @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
- @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
- @Parameter(name = "consumerWindowSize") int consumerWindowSize,
- @Parameter(name = "consumerMaxRate") int consumerMaxRate,
- @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
- @Parameter(name = "producerWindowSize") int producerWindowSize,
- @Parameter(name = "producerMaxRate") int producerMaxRate,
- @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
- @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
- @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
- @Parameter(name = "autoGroup") boolean autoGroup,
- @Parameter(name = "preAcknowledge") boolean preAcknowledge,
- @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
- @Parameter(name = "transactionBatchSize") int transactionBatchSize,
- @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
- @Parameter(name = "useGlobalPools") boolean useGlobalPools,
- @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
- @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
- @Parameter(name = "retryInterval") long retryInterval,
- @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
- @Parameter(name = "maxRetryInterval") long maxRetryInterval,
- @Parameter(name = "reconnectAttempts") int reconnectAttempts,
- @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
- @Parameter(name = "groupID") String groupID,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String discoveryAddress,
- int discoveryPort,
- String clientID,
- Object[] bindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "discoveryAddress") String discoveryAddress,
- @Parameter(name = "discoveryPort") int discoveryPort,
- @Parameter(name = "clientID") String clientID,
- @Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String discoveryAddress,
- int discoveryPort,
- String clientID,
- long discoveryRefreshTimeout,
- long clientFailureCheckPeriod,
- long connectionTTL,
- long callTimeout,
- boolean cacheLargeMessageClient,
- int minLargeMessageSize,
- int consumerWindowSize,
- int consumerMaxRate,
- int confirmationWindowSize,
- int producerWindowSize,
- int producerMaxRate,
- boolean blockOnAcknowledge,
- boolean blockOnDurableSend,
- boolean blockOnNonDurableSend,
- boolean autoGroup,
- boolean preAcknowledge,
- String loadBalancingPolicyClassName,
- int transactionBatchSize,
- int dupsOKBatchSize,
- long initialWaitTimeout,
- boolean useGlobalPools,
- int scheduledThreadPoolMaxSize,
- int threadPoolMaxSize,
- long retryInterval,
- double retryIntervalMultiplier,
- long maxRetryInterval,
- int reconnectAttempts,
- boolean failoverOnServerShutdown,
- String groupID,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "discoveryAddress") String discoveryAddress,
- @Parameter(name = "discoveryPort") int discoveryPort,
- @Parameter(name = "clientID") String clientID,
- @Parameter(name = "discoveryRefreshTimeout") long discoveryRefreshTimeout,
- @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
- @Parameter(name = "connectionTTL") long connectionTTL,
- @Parameter(name = "callTimeout") long callTimeout,
- @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
- @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
- @Parameter(name = "consumerWindowSize") int consumerWindowSize,
- @Parameter(name = "consumerMaxRate") int consumerMaxRate,
- @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
- @Parameter(name = "producerWindowSize") int producerWindowSize,
- @Parameter(name = "producerMaxRate") int producerMaxRate,
- @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
- @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
- @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
- @Parameter(name = "autoGroup") boolean autoGroup,
- @Parameter(name = "preAcknowledge") boolean preAcknowledge,
- @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
- @Parameter(name = "transactionBatchSize") int transactionBatchSize,
- @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
- @Parameter(name = "initialWaitTimeout") long initialWaitTimeout,
- @Parameter(name = "useGlobalPools") boolean useGlobalPools,
- @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
- @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
- @Parameter(name = "retryInterval") long retryInterval,
- @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
- @Parameter(name = "maxRetryInterval") long maxRetryInterval,
- @Parameter(name = "reconnectAttempts") int reconnectAttempts,
- @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
- @Parameter(name = "groupID") String groupID,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "liveTransportClassName") String liveTransportClassName,
- @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void createConnectionFactory(@Parameter(name = "name") String name,
- @Parameter(name = "liveTransportClassName") String liveTransportClassName,
- @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
- @Parameter(name = "clientID") String clientID,
- @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String backupTransportClassName,
- Map<String, Object> backupTransportParams,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String backupTransportClassName,
- Map<String, Object> backupTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
- void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
-
- @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
- String[] listRemoteAddresses() throws Exception;
-
- @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.INFO)
- String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
-
- @Operation(desc = "Closes all the connections for the given IP Address", impact = MBeanOperationInfo.INFO)
- boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
-
- @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
- String[] listConnectionIDs() throws Exception;
-
- @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
- String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,120 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class SubscriptionInfo
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final String queueName;
-
- private final String clientID;
-
- private final String name;
-
- private final boolean durable;
-
- private final String selector;
-
- private final int messageCount;
-
- // Static --------------------------------------------------------
-
- public static SubscriptionInfo[] from(final String jsonString) throws Exception
- {
- JSONArray array = new JSONArray(jsonString);
- SubscriptionInfo[] infos = new SubscriptionInfo[array.length()];
- for (int i = 0; i < array.length(); i++)
- {
- JSONObject sub = array.getJSONObject(i);
- SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"),
- sub.optString("clientID", null),
- sub.optString("name", null),
- sub.getBoolean("durable"),
- sub.optString("selector", null),
- sub.getInt("messageCount"));
- infos[i] = info;
- }
-
- return infos;
- }
-
- // Constructors --------------------------------------------------
-
- private SubscriptionInfo(final String queueName,
- final String clientID,
- final String name,
- final boolean durable,
- final String selector,
- final int messageCount)
- {
- this.queueName = queueName;
- this.clientID = clientID;
- this.name = name;
- this.durable = durable;
- this.selector = selector;
- this.messageCount = messageCount;
- }
-
- // Public --------------------------------------------------------
-
- public String getQueueName()
- {
- return queueName;
- }
-
- public String getClientID()
- {
- return clientID;
- }
-
- public String getName()
- {
- return name;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public String getSelector()
- {
- return selector;
- }
-
- public int getMessageCount()
- {
- return messageCount;
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/TopicControl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/TopicControl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,137 +0,0 @@
-/*
- * 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.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A TopicControl is used to manage a JMS Topic.
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public interface TopicControl extends DestinationControl
-{
- // Attributes ----------------------------------------------------
-
- /**
- * Returns the number of (durable and non-durable) subscribers for this topic.
- */
- int getSubscriptionCount();
-
- /**
- * Returns the number of <em>durable</em> subscribers for this topic.
- */
- int getDurableSubscriptionCount();
-
- /**
- * Returns the number of <em>non-durable</em> subscribers for this topic.
- */
- int getNonDurableSubscriptionCount();
-
- /**
- * Returns the number of messages for all <em>durable</em> subscribers for this topic.
- */
- int getDurableMessageCount();
-
- /**
- * Returns the number of messages for all <em>non-durable</em> subscribers for this topic.
- */
- int getNonDurableMessageCount();
-
- // Operations ----------------------------------------------------
-
- /**
- * Lists all the subscriptions for this topic (both durable and non-durable).
- */
- @Operation(desc = "List all subscriptions")
- Object[] listAllSubscriptions() throws Exception;
-
- /**
- * Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
- * <br>
- * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
- */
- @Operation(desc = "List all subscriptions")
- String listAllSubscriptionsAsJSON() throws Exception;
-
- /**
- * Lists all the <em>durable</em> subscriptions for this topic.
- */
- @Operation(desc = "List only the durable subscriptions")
- Object[] listDurableSubscriptions() throws Exception;
-
- /**
- * Lists all the <em>durable</em> subscriptions using JSON serialization.
- * <br>
- * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
- */
- @Operation(desc = "List only the durable subscriptions")
- String listDurableSubscriptionsAsJSON() throws Exception;
-
- /**
- * Lists all the <em>non-durable</em> subscriptions for this topic.
- */
- @Operation(desc = "List only the non durable subscriptions")
- Object[] listNonDurableSubscriptions() throws Exception;
-
- /**
- * Lists all the <em>non-durable</em> subscriptions using JSON serialization.
- * <br>
- * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
- */
- @Operation(desc = "List only the non durable subscriptions")
- String listNonDurableSubscriptionsAsJSON() throws Exception;
-
- /**
- * Lists all the messages in this queue matching the specified queue representing the subscription.
- * <br>
- * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
- */
- @Operation(desc = "List all the message for the given subscription")
- public Map<String, Object>[] listMessagesForSubscription(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
-
- /**
- * Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
- */
- @Operation(desc = "List all the message for the given subscription")
- public String listMessagesForSubscriptionAsJSON(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
-
- /**
- * Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
- * <br>
- * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
- */
- @Operation(desc = "Count the number of messages matching the filter for the given subscription")
- public int countMessagesForSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
- @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName,
- @Parameter(name = "filter", desc = "a JMS filter (can be empty)") String filter) throws Exception;
-
- /**
- * Drops the subscription specified by the specified client ID and subscription name.
- */
- @Operation(desc = "Drop a durable subscription", impact = MBeanOperationInfo.ACTION)
- void dropDurableSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
- @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName) throws Exception;
-
- /**
- * Drops all subscriptions.
- */
- @Operation(desc = "Drop all subscriptions from this topic", impact = MBeanOperationInfo.ACTION)
- void dropAllSubscriptions() throws Exception;
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,192 +0,0 @@
-/*
- * 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.hornetq.jms.server.management.impl;
-
-import java.util.List;
-
-import javax.management.MBeanInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSConnectionFactoryControlImpl extends StandardMBean implements ConnectionFactoryControl
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final HornetQConnectionFactory cf;
-
- private final List<String> bindings;
-
- private final String name;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public JMSConnectionFactoryControlImpl(final HornetQConnectionFactory cf,
- final String name,
- final List<String> bindings) throws NotCompliantMBeanException
- {
- super(ConnectionFactoryControl.class);
- this.cf = cf;
- this.name = name;
- this.bindings = bindings;
- }
-
- // Public --------------------------------------------------------
-
- // ManagedConnectionFactoryMBean implementation ------------------
-
- public List<String> getBindings()
- {
- return bindings;
- }
-
- public String getClientID()
- {
- return cf.getClientID();
- }
-
- public long getClientFailureCheckPeriod()
- {
- return cf.getClientFailureCheckPeriod();
- }
-
- public long getCallTimeout()
- {
- return cf.getCallTimeout();
- }
-
- public int getConsumerMaxRate()
- {
- return cf.getConsumerMaxRate();
- }
-
- public int getConsumerWindowSize()
- {
- return cf.getConsumerWindowSize();
- }
-
- public int getProducerMaxRate()
- {
- return cf.getProducerMaxRate();
- }
-
- public int getConfirmationWindowSize()
- {
- return cf.getConfirmationWindowSize();
- }
-
- public int getDupsOKBatchSize()
- {
- return cf.getDupsOKBatchSize();
- }
-
- public boolean isBlockOnAcknowledge()
- {
- return cf.isBlockOnAcknowledge();
- }
-
- public boolean isBlockOnNonDurableSend()
- {
- return cf.isBlockOnNonDurableSend();
- }
-
- public boolean isBlockOnDurableSend()
- {
- return cf.isBlockOnDurableSend();
- }
-
- public boolean isPreAcknowledge()
- {
- return cf.isPreAcknowledge();
- }
-
- public String getName()
- {
- return name;
- }
-
- public long getConnectionTTL()
- {
- return cf.getConnectionTTL();
- }
-
- public int getReconnectAttempts()
- {
- return cf.getReconnectAttempts();
- }
-
- public boolean isFailoverOnNodeShutdown()
- {
- return cf.isFailoverOnServerShutdown();
- }
-
- public long getMinLargeMessageSize()
- {
- return cf.getMinLargeMessageSize();
- }
-
- public long getRetryInterval()
- {
- return cf.getRetryInterval();
- }
-
- public double getRetryIntervalMultiplier()
- {
- return cf.getRetryIntervalMultiplier();
- }
-
- public long getTransactionBatchSize()
- {
- return cf.getTransactionBatchSize();
- }
-
- public boolean isAutoGroup()
- {
- return cf.isAutoGroup();
- }
-
- @Override
- public MBeanInfo getMBeanInfo()
- {
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class),
- info.getNotifications());
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,131 +0,0 @@
-/*
- * 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.hornetq.jms.server.management.impl;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.jms.client.HornetQMessage;
-
-/*
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- */
-public class JMSManagementHelper
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- // Static --------------------------------------------------------
-
- private static org.hornetq.core.message.Message getCoreMessage(final Message jmsMessage)
- {
- if (jmsMessage instanceof HornetQMessage == false)
- {
- throw new IllegalArgumentException("Cannot send a non JBoss message as a management message " + jmsMessage.getClass()
- .getName());
- }
-
- return ((HornetQMessage)jmsMessage).getCoreMessage();
- }
-
- public static void putAttribute(final Message message, final String resourceName, final String attribute) throws JMSException
- {
- ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
- }
-
- public static void putOperationInvocation(final Message message,
- final String resourceName,
- final String operationName) throws JMSException
- {
- try
- {
- ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
- resourceName,
- operationName);
- }
- catch (Exception e)
- {
- throw JMSManagementHelper.convertFromException(e);
- }
- }
-
- private static JMSException convertFromException(final Exception e)
- {
- JMSException jmse = new JMSException(e.getMessage());
-
- jmse.initCause(e);
-
- return jmse;
- }
-
- public static void putOperationInvocation(final Message message,
- final String resourceName,
- final String operationName,
- final Object... parameters) throws JMSException
- {
- try
- {
- ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
- resourceName,
- operationName,
- parameters);
- }
- catch (Exception e)
- {
- throw JMSManagementHelper.convertFromException(e);
- }
- }
-
- public static boolean isOperationResult(final Message message) throws JMSException
- {
- return ManagementHelper.isOperationResult(JMSManagementHelper.getCoreMessage(message));
- }
-
- public static boolean isAttributesResult(final Message message) throws JMSException
- {
- return ManagementHelper.isAttributesResult(JMSManagementHelper.getCoreMessage(message));
- }
-
- public static boolean hasOperationSucceeded(final Message message) throws JMSException
- {
- return ManagementHelper.hasOperationSucceeded(JMSManagementHelper.getCoreMessage(message));
- }
-
- public static Object[] getResults(final Message message) throws Exception
- {
- return ManagementHelper.getResults(JMSManagementHelper.getCoreMessage(message));
- }
-
- public static Object getResult(final Message message) throws Exception
- {
- return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message));
- }
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Modified: trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,12 +26,16 @@
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.HornetQTopic;
import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.jms.management.impl.JMSConnectionFactoryControlImpl;
+import org.hornetq.jms.management.impl.JMSQueueControlImpl;
+import org.hornetq.jms.management.impl.JMSServerControlImpl;
+import org.hornetq.jms.management.impl.JMSTopicControlImpl;
import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
import org.hornetq.jms.server.management.JMSManagementService;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
/*
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,360 +0,0 @@
-/*
- * 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.hornetq.jms.server.management.impl;
-
-import java.util.Map;
-
-import javax.management.MBeanInfo;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.MessageCounterInfo;
-import org.hornetq.core.management.QueueControl;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.core.messagecounter.MessageCounter;
-import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
-import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.client.HornetQMessage;
-import org.hornetq.jms.client.SelectorTranslator;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSQueueControlImpl extends StandardMBean implements JMSQueueControl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(JMSQueueControlImpl.class);
-
- // Attributes ----------------------------------------------------
-
- private final HornetQQueue managedQueue;
-
- private final QueueControl coreQueueControl;
-
- private final String binding;
-
- private final MessageCounter counter;
-
- // Static --------------------------------------------------------
-
- /**
- * Returns null if the string is null or empty
- */
- public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
- {
- return selectorStr == null || selectorStr.trim().length() == 0 ? null
- : SelectorTranslator.convertToHornetQFilterString(selectorStr);
- }
-
- private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
- {
- return HornetQMessage.HORNETQ_MESSAGE_ID + " = '" + jmsMessageID + "'";
- }
-
- static String toJSON(final Map<String, Object>[] messages)
- {
- JSONArray array = new JSONArray();
- for (Map<String, Object> message : messages)
- {
- array.put(new JSONObject(message));
- }
- return array.toString();
- }
-
- // Constructors --------------------------------------------------
-
- public JMSQueueControlImpl(final HornetQQueue managedQueue,
- final QueueControl coreQueueControl,
- final String jndiBinding,
- final MessageCounter counter) throws Exception
- {
- super(JMSQueueControl.class);
- this.managedQueue = managedQueue;
- this.coreQueueControl = coreQueueControl;
- binding = jndiBinding;
- this.counter = counter;
- }
-
- // Public --------------------------------------------------------
-
- // ManagedJMSQueueMBean implementation ---------------------------
-
- public String getName()
- {
- return managedQueue.getName();
- }
-
- public String getAddress()
- {
- return managedQueue.getAddress();
- }
-
- public boolean isTemporary()
- {
- return managedQueue.isTemporary();
- }
-
- public int getMessageCount()
- {
- return coreQueueControl.getMessageCount();
- }
-
- public int getMessagesAdded()
- {
- return coreQueueControl.getMessagesAdded();
- }
-
- public int getConsumerCount()
- {
- return coreQueueControl.getConsumerCount();
- }
-
- public int getDeliveringCount()
- {
- return coreQueueControl.getDeliveringCount();
- }
-
- public long getScheduledCount()
- {
- return coreQueueControl.getScheduledCount();
- }
-
- public boolean isDurable()
- {
- return coreQueueControl.isDurable();
- }
-
- public String getJNDIBinding()
- {
- return binding;
- }
-
- public String getDeadLetterAddress()
- {
- return coreQueueControl.getDeadLetterAddress();
- }
-
- public void setDeadLetterAddress(final String deadLetterAddress) throws Exception
- {
- coreQueueControl.setDeadLetterAddress(deadLetterAddress);
- }
-
- public String getExpiryAddress()
- {
- return coreQueueControl.getExpiryAddress();
- }
-
- public void setExpiryAddress(final String expiryAddres) throws Exception
- {
- coreQueueControl.setExpiryAddress(expiryAddres);
- }
-
- public boolean removeMessage(final String messageID) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
- int removed = coreQueueControl.removeMessages(filter);
- if (removed != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int removeMessages(final String filterStr) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.removeMessages(filter);
- }
-
- public Map<String, Object>[] listMessages(final String filterStr) throws Exception
- {
- try
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- Map<String, Object>[] coreMessages = coreQueueControl.listMessages(filter);
-
- Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
-
- int i = 0;
-
- for (Map<String, Object> coreMessage : coreMessages)
- {
- Map<String, Object> jmsMessage = HornetQMessage.coreMaptoJMSMap(coreMessage);
- jmsMessages[i++] = jmsMessage;
- }
- return jmsMessages;
- }
- catch (HornetQException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public String listMessagesAsJSON(final String filter) throws Exception
- {
- return JMSQueueControlImpl.toJSON(listMessages(filter));
- }
-
- public int countMessages(final String filterStr) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.countMessages(filter);
- }
-
- public boolean expireMessage(final String messageID) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
- int expired = coreQueueControl.expireMessages(filter);
- if (expired != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int expireMessages(final String filterStr) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.expireMessages(filter);
- }
-
- public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
- int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
- if (dead != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.sendMessagesToDeadLetterAddress(filter);
- }
-
- public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
- int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
- if (changed != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int changeMessagesPriority(final String filterStr, final int newPriority) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.changeMessagesPriority(filter, newPriority);
- }
-
- public boolean moveMessage(final String messageID, final String otherQueueName) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
- HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
- int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress());
- if (moved != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
-
- return true;
- }
-
- public int moveMessages(final String filterStr, final String otherQueueName) throws Exception
- {
- String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
- HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
- return coreQueueControl.moveMessages(filter, otherQueue.getAddress());
- }
-
- public String listMessageCounter()
- {
- try
- {
- return MessageCounterInfo.toJSon(counter);
- }
- catch (Exception e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- public void resetMessageCounter() throws Exception
- {
- coreQueueControl.resetMessageCounter();
- }
-
- public String listMessageCounterAsHTML()
- {
- return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
- }
-
- public String listMessageCounterHistory() throws Exception
- {
- return MessageCounterHelper.listMessageCounterHistory(counter);
- }
-
- public String listMessageCounterHistoryAsHTML()
- {
- return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
- }
-
- public boolean isPaused() throws Exception
- {
- return coreQueueControl.isPaused();
- }
-
- public void pause() throws Exception
- {
- coreQueueControl.pause();
- }
-
- public void resume() throws Exception
- {
- coreQueueControl.resume();
- }
-
- @Override
- public MBeanInfo getMBeanInfo()
- {
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class),
- info.getNotifications());
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,820 +0,0 @@
-/*
- * 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.hornetq.jms.server.management.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.core.config.TransportConfiguration;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
-import org.hornetq.utils.Pair;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSServerControlImpl extends StandardMBean implements JMSServerControl, NotificationEmitter
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final JMSServerManager server;
-
- private final NotificationBroadcasterSupport broadcaster;
-
- private final AtomicLong notifSeq = new AtomicLong(0);
-
- // Static --------------------------------------------------------
-
- private static List<String> convert(final Object[] jndiBindings)
- {
- List<String> bindings = new ArrayList<String>();
- for (Object object : jndiBindings)
- {
- bindings.add(object.toString().trim());
- }
- return bindings;
- }
-
- private static String[] toArray(final String commaSeparatedString)
- {
- if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
- {
- return new String[0];
- }
- String[] values = commaSeparatedString.split(",");
- String[] trimmed = new String[values.length];
- for (int i = 0; i < values.length; i++)
- {
- trimmed[i] = values[i].trim();
- }
- return trimmed;
- }
-
- private static List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams)
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
-
- for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
- {
- Map<String, Object> liveParams = null;
- if (liveConnectorTransportParams.length > i)
- {
- liveParams = (Map<String, Object>)liveConnectorTransportParams[i];
- }
-
- TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
- liveParams);
-
- Map<String, Object> backupParams = null;
- if (backupConnectorTransportParams.length > i)
- {
- backupParams = (Map<String, Object>)backupConnectorTransportParams[i];
- }
-
- TransportConfiguration tcBackup = null;
- if (backupConnectorsTransportClassNames.length > i)
- {
- new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(), backupParams);
- }
- Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
- tcBackup);
-
- pairs.add(pair);
- }
-
- return pairs;
- }
-
- public static MBeanNotificationInfo[] getNotificationInfos()
- {
- NotificationType[] values = NotificationType.values();
- String[] names = new String[values.length];
- for (int i = 0; i < values.length; i++)
- {
- names[i] = values[i].toString();
- }
- return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
- JMSServerControl.class.getName(),
- "Notifications emitted by a JMS Server") };
- }
-
- // Constructors --------------------------------------------------
-
- public JMSServerControlImpl(final JMSServerManager server) throws Exception
- {
- super(JMSServerControl.class);
- this.server = server;
- broadcaster = new NotificationBroadcasterSupport();
- }
-
- // Public --------------------------------------------------------
-
- // JMSServerControlMBean implementation --------------------------
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name, pairs, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassNames,
- final String liveTransportParams,
- final String backupTransportClassNames,
- final String backupTransportParams,
- final String jndiBindings) throws Exception
- {
- Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
- Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
- Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
- Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
- Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
- createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, bindings);
- }
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
-
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassNames,
- final String liveTransportParams,
- final String backupTransportClassNames,
- final String backupTransportParams,
- final String clientID,
- final String jndiBindings) throws Exception
- {
- Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
- Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
- Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
- Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
- Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
- }
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final String clientID,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final boolean cacheLargeMessageClient,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int confirmationWindowSize,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnDurableSend,
- final boolean blockOnNonDurableSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final long maxRetryInterval,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final String groupID,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
-
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name,
- pairs,
- clientID,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- cacheLargeMessageClient,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- confirmationWindowSize,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnDurableSend,
- blockOnNonDurableSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- maxRetryInterval,
- reconnectAttempts,
- failoverOnServerShutdown,
- groupID,
- jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassNames,
- final String liveTransportParams,
- final String backupTransportClassNames,
- final String backupTransportParams,
- final String clientID,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final boolean cacheLargeMessageClient,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int confirmationWindowSize,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnDurableSend,
- final boolean blockOnNonDurableSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final long maxRetryInterval,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final String groupID,
- final String jndiBindings) throws Exception
- {
- Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
- Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
- Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
- Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);
- Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name,
- liveClassNames,
- liveParams,
- backupClassNames,
- backupParams,
- clientID,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- cacheLargeMessageClient,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- confirmationWindowSize,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnDurableSend,
- blockOnNonDurableSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- maxRetryInterval,
- reconnectAttempts,
- failoverOnServerShutdown,
- groupID,
- bindings);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final String jndiBindings) throws Exception
- {
- Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, bindings);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final long discoveryRefreshTimeout,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final boolean cacheLargeMessageClient,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int confirmationWindowSize,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnDurableSend,
- final boolean blockOnNonDurableSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final long initialWaitTimeout,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final long maxRetryInterval,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final String groupID,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name,
- discoveryAddress,
- discoveryPort,
- clientID,
- discoveryRefreshTimeout,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- cacheLargeMessageClient,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- confirmationWindowSize,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnDurableSend,
- blockOnNonDurableSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- initialWaitTimeout,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- maxRetryInterval,
- reconnectAttempts,
- failoverOnServerShutdown,
- groupID,
- jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final long discoveryRefreshTimeout,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final boolean cacheLargeMessageClient,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int confirmationWindowSize,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnDurableSend,
- final boolean blockOnNonDurableSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final long initialWaitTimeout,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final long maxRetryInterval,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final String groupID,
- final String jndiBindings) throws Exception
- {
- Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name,
- discoveryAddress,
- discoveryPort,
- clientID,
- discoveryRefreshTimeout,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- cacheLargeMessageClient,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- confirmationWindowSize,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnDurableSend,
- blockOnNonDurableSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- initialWaitTimeout,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- maxRetryInterval,
- reconnectAttempts,
- failoverOnServerShutdown,
- groupID,
- bindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- server.createConnectionFactory(name, liveTC, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final String liveTransportParams,
- final String jndiBindings) throws Exception
- {
- Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
- String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name, liveTransportClassName, params, bindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- server.createConnectionFactory(name, liveTC, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final String liveTransportParams,
- final String clientID,
- final String jndiBindings) throws Exception
- {
- Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
- String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name, liveTransportClassName, params, clientID, bindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String backupTransportClassName,
- final Map<String, Object> backupTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
-
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name, liveTC, backupTC, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String backupTransportClassName,
- final Map<String, Object> backupTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
-
- List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
- server.createConnectionFactory(name, liveTC, backupTC, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public boolean createQueue(final String name, final String jndiBinding) throws Exception
- {
- boolean created = server.createQueue(name, jndiBinding, null, true);
- if (created)
- {
- sendNotification(NotificationType.QUEUE_CREATED, name);
- }
- return created;
- }
-
- public boolean destroyQueue(final String name) throws Exception
- {
- boolean destroyed = server.destroyQueue(name);
- if (destroyed)
- {
- sendNotification(NotificationType.QUEUE_DESTROYED, name);
- }
- return destroyed;
- }
-
- public boolean createTopic(final String topicName, final String jndiBinding) throws Exception
- {
- boolean created = server.createTopic(topicName, jndiBinding);
- if (created)
- {
- sendNotification(NotificationType.TOPIC_CREATED, topicName);
- }
- return created;
- }
-
- public boolean destroyTopic(final String name) throws Exception
- {
- boolean destroyed = server.destroyTopic(name);
- if (destroyed)
- {
- sendNotification(NotificationType.TOPIC_DESTROYED, name);
- }
- return destroyed;
- }
-
- public void destroyConnectionFactory(final String name) throws Exception
- {
- boolean destroyed = server.destroyConnectionFactory(name);
- if (destroyed)
- {
- sendNotification(NotificationType.CONNECTION_FACTORY_DESTROYED, name);
- }
- }
-
- public boolean isStarted()
- {
- return server.isStarted();
- }
-
- public String getVersion()
- {
- return server.getVersion();
- }
-
- public String[] getQueueNames()
- {
- Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
- String[] names = new String[queueControls.length];
- for (int i = 0; i < queueControls.length; i++)
- {
- JMSQueueControl queueControl = (JMSQueueControl)queueControls[i];
- names[i] = queueControl.getName();
- }
- return names;
- }
-
- public String[] getTopicNames()
- {
- Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
- String[] names = new String[topicControls.length];
- for (int i = 0; i < topicControls.length; i++)
- {
- TopicControl topicControl = (TopicControl)topicControls[i];
- names[i] = topicControl.getName();
- }
- return names;
- }
-
- public String[] getConnectionFactoryNames()
- {
- Object[] cfControls = server.getHornetQServer()
- .getManagementService()
- .getResources(ConnectionFactoryControl.class);
- String[] names = new String[cfControls.length];
- for (int i = 0; i < cfControls.length; i++)
- {
- ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
- names[i] = cfControl.getName();
- }
- return names;
- }
-
- // NotificationEmitter implementation ----------------------------
-
- public void removeNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener, filter, handback);
- }
-
- public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener);
- }
-
- public void addNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws IllegalArgumentException
- {
- broadcaster.addNotificationListener(listener, filter, handback);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- return JMSServerControlImpl.getNotificationInfos();
- }
-
- public String[] listRemoteAddresses() throws Exception
- {
- return server.listRemoteAddresses();
- }
-
- public String[] listRemoteAddresses(final String ipAddress) throws Exception
- {
- return server.listRemoteAddresses(ipAddress);
- }
-
- public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
- {
- return server.closeConnectionsForAddress(ipAddress);
- }
-
- public String[] listConnectionIDs() throws Exception
- {
- return server.listConnectionIDs();
- }
-
- public String[] listSessions(final String connectionID) throws Exception
- {
- return server.listSessions(connectionID);
- }
-
- @Override
- public MBeanInfo getMBeanInfo()
- {
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
- info.getNotifications());
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private void sendNotification(final NotificationType type, final String message)
- {
- Notification notif = new Notification(type.toString(), this, notifSeq.incrementAndGet(), message);
- broadcaster.sendNotification(notif);
- }
-
- // Inner classes -------------------------------------------------
-
- public static enum NotificationType
- {
- QUEUE_CREATED,
- QUEUE_DESTROYED,
- TOPIC_CREATED,
- TOPIC_DESTROYED,
- CONNECTION_FACTORY_CREATED,
- CONNECTION_FACTORY_DESTROYED;
- }
-
-}
Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,371 +0,0 @@
-/*
- * 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.hornetq.jms.server.management.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.MBeanInfo;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.AddressControl;
-import org.hornetq.core.management.HornetQServerControl;
-import org.hornetq.core.management.QueueControl;
-import org.hornetq.core.management.ResourceNames;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.core.server.management.ManagementService;
-import org.hornetq.jms.HornetQTopic;
-import org.hornetq.jms.client.HornetQMessage;
-import org.hornetq.jms.client.SelectorTranslator;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
-import org.hornetq.utils.Pair;
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSTopicControlImpl extends StandardMBean implements TopicControl
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(JMSTopicControlImpl.class);
-
- // Attributes ----------------------------------------------------
-
- private final HornetQTopic managedTopic;
-
- private final String binding;
-
- private final AddressControl addressControl;
-
- private final ManagementService managementService;
-
- // Static --------------------------------------------------------
-
- public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
- {
- return selectorStr == null || selectorStr.trim().length() == 0 ? null
- : SelectorTranslator.convertToHornetQFilterString(selectorStr);
- }
-
- // Constructors --------------------------------------------------
-
- public JMSTopicControlImpl(final HornetQTopic topic,
- final AddressControl addressControl,
- final String jndiBinding,
- final ManagementService managementService) throws Exception
- {
- super(TopicControl.class);
- managedTopic = topic;
- this.addressControl = addressControl;
- binding = jndiBinding;
- this.managementService = managementService;
- }
-
- // TopicControlMBean implementation ------------------------------
-
- public String getName()
- {
- return managedTopic.getName();
- }
-
- public boolean isTemporary()
- {
- return managedTopic.isTemporary();
- }
-
- public String getAddress()
- {
- return managedTopic.getAddress();
- }
-
- public String getJNDIBinding()
- {
- return binding;
- }
-
- public int getMessageCount()
- {
- return getMessageCount(DurabilityType.ALL);
- }
-
- public int getDurableMessageCount()
- {
- return getMessageCount(DurabilityType.DURABLE);
- }
-
- public int getNonDurableMessageCount()
- {
- return getMessageCount(DurabilityType.NON_DURABLE);
- }
-
- public int getSubscriptionCount()
- {
- return getQueues(DurabilityType.ALL).size();
- }
-
- public int getDurableSubscriptionCount()
- {
- return getQueues(DurabilityType.DURABLE).size();
- }
-
- public int getNonDurableSubscriptionCount()
- {
- return getQueues(DurabilityType.NON_DURABLE).size();
- }
-
- public Object[] listAllSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.ALL);
- }
-
- public String listAllSubscriptionsAsJSON() throws Exception
- {
- return listSubscribersInfosAsJSON(DurabilityType.ALL);
- }
-
- public Object[] listDurableSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.DURABLE);
- }
-
- public String listDurableSubscriptionsAsJSON() throws Exception
- {
- return listSubscribersInfosAsJSON(DurabilityType.DURABLE);
- }
-
- public Object[] listNonDurableSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.NON_DURABLE);
- }
-
- public String listNonDurableSubscriptionsAsJSON() throws Exception
- {
- return listSubscribersInfosAsJSON(DurabilityType.NON_DURABLE);
- }
-
- public Map<String, Object>[] listMessagesForSubscription(final String queueName) throws Exception
- {
- QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName);
- }
-
- Map<String, Object>[] coreMessages = coreQueueControl.listMessages(null);
-
- Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
-
- int i = 0;
-
- for (Map<String, Object> coreMessage : coreMessages)
- {
- jmsMessages[i++] = HornetQMessage.coreMaptoJMSMap(coreMessage);
- }
- return jmsMessages;
- }
-
- public String listMessagesForSubscriptionAsJSON(final String queueName) throws Exception
- {
- return JMSQueueControlImpl.toJSON(listMessagesForSubscription(queueName));
- }
-
- public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
- {
- String queueName = HornetQTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
- }
- String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
- return coreQueueControl.listMessages(filter).length;
- }
-
- public int removeMessages(final String filterStr) throws Exception
- {
- String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
- int count = 0;
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
- count += coreQueueControl.removeMessages(filter);
- }
-
- return count;
- }
-
- public void dropDurableSubscription(final String clientID, final String subscriptionName) throws Exception
- {
- String queueName = HornetQTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
- }
- HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
- serverControl.destroyQueue(queueName);
- }
-
- public void dropAllSubscriptions() throws Exception
- {
- HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- serverControl.destroyQueue(queue);
- }
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private Object[] listSubscribersInfos(final DurabilityType durability)
- {
- List<QueueControl> queues = getQueues(durability);
- List<Object[]> subInfos = new ArrayList<Object[]>(queues.size());
-
- for (QueueControl queue : queues)
- {
- String clientID = null;
- String subName = null;
-
- if (queue.isDurable())
- {
- Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
- .toString());
- clientID = pair.a;
- subName = pair.b;
- }
-
- String filter = queue.getFilter() != null ? queue.getFilter() : null;
-
- Object[] subscriptionInfo = new Object[6];
- subscriptionInfo[0] = queue.getName();
- subscriptionInfo[1] = clientID;
- subscriptionInfo[2] = subName;
- subscriptionInfo[3] = queue.isDurable();
- subscriptionInfo[4] = queue.getMessageCount();
-
- subInfos.add(subscriptionInfo);
- }
- return subInfos.toArray(new Object[subInfos.size()]);
- }
-
- private String listSubscribersInfosAsJSON(final DurabilityType durability) throws Exception
- {
- List<QueueControl> queues = getQueues(durability);
- JSONArray array = new JSONArray();
-
- for (QueueControl queue : queues)
- {
- String clientID = null;
- String subName = null;
-
- if (queue.isDurable())
- {
- Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
- .toString());
- clientID = pair.a;
- subName = pair.b;
- }
-
- String filter = queue.getFilter() != null ? queue.getFilter() : null;
-
- JSONObject info = new JSONObject();
- info.put("queueName", queue.getName());
- info.put("clientID", clientID);
- info.put("selector", filter);
- info.put("name", subName);
- info.put("durable", queue.isDurable());
- info.put("messageCount", queue.getMessageCount());
- array.put(info);
- }
-
- return array.toString();
- }
-
- private int getMessageCount(final DurabilityType durability)
- {
- List<QueueControl> queues = getQueues(durability);
- int count = 0;
- for (QueueControl queue : queues)
- {
- count += queue.getMessageCount();
- }
- return count;
- }
-
- private List<QueueControl> getQueues(final DurabilityType durability)
- {
- try
- {
- List<QueueControl> matchingQueues = new ArrayList<QueueControl>();
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
-
- // Ignore the "special" subscription
- if (!coreQueueControl.getName().equals(addressControl.getAddress()))
- {
- if (durability == DurabilityType.ALL || durability == DurabilityType.DURABLE &&
- coreQueueControl.isDurable() ||
- durability == DurabilityType.NON_DURABLE &&
- !coreQueueControl.isDurable())
- {
- matchingQueues.add(coreQueueControl);
- }
- }
- }
- return matchingQueues;
- }
- catch (Exception e)
- {
- return Collections.emptyList();
- }
- }
-
- @Override
- public MBeanInfo getMBeanInfo()
- {
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class),
- info.getNotifications());
- }
-
- // Inner classes -------------------------------------------------
-
- private enum DurabilityType
- {
- ALL, DURABLE, NON_DURABLE
- }
-}
Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -1381,6 +1381,15 @@
// TODO Auto-generated method stub
return false;
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.client.ClientSession#createQueue(org.hornetq.utils.SimpleString, org.hornetq.utils.SimpleString)
+ */
+ public void createQueue(SimpleString address, SimpleString queueName) throws HornetQException
+ {
+ // TODO Auto-generated method stub
+
+ }
}
}
Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,9 +34,9 @@
import org.hornetq.core.security.Role;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.integration.bootstrap.HornetQBootstrapServer;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
import org.hornetq.utils.Pair;
import org.jboss.kernel.plugins.config.property.PropertyKernelConfig;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -49,10 +49,10 @@
import org.hornetq.jms.bridge.QualityOfServiceMode;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
import org.hornetq.jms.server.JMSServerManager;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.UnitTestCase;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -19,7 +19,7 @@
import javax.jms.QueueSession;
import javax.jms.Session;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
/**
* A MBeanUsingCoreMessage
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -37,8 +37,8 @@
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.JMSQueueControl;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSQueueControl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
import org.hornetq.tests.integration.management.ManagementTestBase;
import org.hornetq.tests.unit.util.InVMContext;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -25,7 +25,7 @@
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
/**
*
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,8 +34,8 @@
import org.hornetq.core.server.HornetQServer;
import org.hornetq.integration.transports.netty.NettyAcceptorFactory;
import org.hornetq.integration.transports.netty.NettyConnectorFactory;
+import org.hornetq.jms.management.JMSServerControl;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSServerControl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
import org.hornetq.tests.integration.management.ManagementTestBase;
import org.hornetq.tests.unit.util.InVMContext;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,9 +34,9 @@
import org.hornetq.core.remoting.impl.invm.TransportConstants;
import org.hornetq.core.server.HornetQ;
import org.hornetq.core.server.HornetQServer;
+import org.hornetq.jms.management.JMSServerControl;
import org.hornetq.jms.server.JMSServerManager;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSServerControl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
import org.hornetq.tests.integration.management.ManagementTestBase;
import org.hornetq.tests.unit.util.InVMContext;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -25,7 +25,7 @@
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.jms.HornetQQueue;
import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.JMSServerControl;
+import org.hornetq.jms.management.JMSServerControl;
/**
* A JMSServerControlUsingCoreTest
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -28,9 +28,9 @@
import org.hornetq.core.server.HornetQ;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.jms.HornetQTopic;
+import org.hornetq.jms.management.SubscriptionInfo;
+import org.hornetq.jms.management.TopicControl;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.SubscriptionInfo;
-import org.hornetq.jms.server.management.TopicControl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
import org.hornetq.tests.integration.management.ManagementTestBase;
import org.hornetq.tests.util.RandomUtil;
Modified: trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java 2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java 2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,10 +29,10 @@
import org.hornetq.core.management.HornetQServerControl;
import org.hornetq.core.management.ObjectNameBuilder;
import org.hornetq.core.management.QueueControl;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
import org.hornetq.utils.SimpleString;
/**
16 years, 7 months
JBoss hornetq SVN: r8673 - in trunk/src/main/org/hornetq/core/client: impl and 1 other directory.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-12-11 06:17:40 -0500 (Fri, 11 Dec 2009)
New Revision: 8673
Modified:
trunk/src/main/org/hornetq/core/client/ClientSession.java
trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
Log:
added missing method to api
Modified: trunk/src/main/org/hornetq/core/client/ClientSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientSession.java 2009-12-11 11:02:23 UTC (rev 8672)
+++ trunk/src/main/org/hornetq/core/client/ClientSession.java 2009-12-11 11:17:40 UTC (rev 8673)
@@ -187,6 +187,15 @@
* @throws HornetQException in an exception occurs while creating the queue
*/
void createQueue(String address, String queueName) throws HornetQException;
+
+ /**
+ * Creates a <em>non-temporary</em> queue <em>non-durable</em> queue.
+ *
+ * @param address the queue will be bound to this address
+ * @param queueName the name of the queue
+ * @throws HornetQException in an exception occurs while creating the queue
+ */
+ void createQueue(SimpleString address, SimpleString queueName) throws HornetQException;
/**
* Creates a <em>non-temporary</em> queue.
Modified: trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2009-12-11 11:02:23 UTC (rev 8672)
+++ trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2009-12-11 11:17:40 UTC (rev 8673)
@@ -257,6 +257,11 @@
{
session.createQueue(address, queueName);
}
+
+ public void createQueue(final SimpleString address, final SimpleString queueName) throws HornetQException
+ {
+ session.createQueue(address, queueName);
+ }
public void createQueue(final SimpleString address, final SimpleString queueName, final boolean durable) throws HornetQException
{
16 years, 7 months
JBoss hornetq SVN: r8672 - in trunk/src/main/org/hornetq/core/remoting: impl and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2009-12-11 06:02:23 -0500 (Fri, 11 Dec 2009)
New Revision: 8672
Modified:
trunk/src/main/org/hornetq/core/remoting/Channel.java
trunk/src/main/org/hornetq/core/remoting/ChannelHandler.java
trunk/src/main/org/hornetq/core/remoting/CloseListener.java
trunk/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java
trunk/src/main/org/hornetq/core/remoting/FailureListener.java
trunk/src/main/org/hornetq/core/remoting/Interceptor.java
trunk/src/main/org/hornetq/core/remoting/Packet.java
trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java
trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
Log:
remoting javadocs
Modified: trunk/src/main/org/hornetq/core/remoting/Channel.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/Channel.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/Channel.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -17,53 +17,165 @@
import org.hornetq.core.exception.HornetQException;
/**
- * A Channel A Channel *does not* support concurrent access by more than one thread!
- *
+ * A channel is a way of interleaving data meant for different endpoints over the same {@link org.hornetq.core.remoting.RemotingConnection}.
+ * <p/>
+ * Any packet sent will have its channel id set to the specific channel sending so it can be routed to its correct channel
+ * when received by the {@link org.hornetq.core.remoting.RemotingConnection}. see {@link org.hornetq.core.remoting.Packet#setChannelID(long)}.
+ * <p/>
+ * Each Channel should will forward any packets received to its {@link org.hornetq.core.remoting.ChannelHandler}.
+ * <p/>
+ * A Channel *does not* support concurrent access by more than one thread!
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
public interface Channel
{
+ /**
+ * returns the id of this channel.
+ *
+ * @return the id
+ */
long getID();
+ /**
+ * sends a packet on this channel.
+ *
+ * @param packet the packet to send
+ */
void send(Packet packet);
+ /**
+ * sends a packet on this channel and then blocks until it has been written to the connection.
+ *
+ * @param packet the packet to send
+ */
void sendAndFlush(Packet packet);
+ /**
+ * sends a packet on this channel and then blocks until a response is received or a timeout occurs.
+ *
+ * @param packet the packet to send
+ * @return the response
+ * @throws HornetQException if an error occurs during the send
+ */
Packet sendBlocking(Packet packet) throws HornetQException;
+ /**
+ * sets the {@link org.hornetq.core.remoting.ChannelHandler} that this channel should forward received packets to.
+ *
+ * @param handler the handler
+ */
void setHandler(ChannelHandler handler);
- ChannelHandler getHandler();
-
+ /**
+ * closes this channel.
+ * <p/>
+ * once closed no packets can be sent.
+ */
void close();
+ /**
+ * transfers the connection used by this channel to the one specified.
+ * <p/>
+ * All new packets will be sent via this connection.
+ *
+ * @param newConnection the new connection
+ */
void transferConnection(RemotingConnection newConnection);
+ /**
+ * resends any packets that have not received confirmations yet.
+ * <p/>
+ * Typically called after a connection has been transferred.
+ *
+ * @param lastConfirmedCommandID the last confirmed packet
+ * @param newID the new id to use
+ */
void replayCommands(int lastConfirmedCommandID, final long newID);
+ /**
+ * returns the last confirmed packet command id
+ *
+ * @return the id
+ */
int getLastConfirmedCommandID();
+ /**
+ * locks the channel.
+ * <p/>
+ * While locked no packets can be sent or received
+ */
void lock();
+ /**
+ * unlocks the channel.
+ */
void unlock();
+ /**
+ * forces any {@link org.hornetq.core.remoting.Channel#sendBlocking(Packet)} request to return with an exception.
+ */
void returnBlocking();
+ /**
+ * returns the channel lock
+ *
+ * @return the lock
+ */
Lock getLock();
+ /**
+ * returns the Remoting Connection being used by the channel
+ *
+ * @return
+ */
RemotingConnection getConnection();
+ /**
+ * sends a confirmation of a packet being received.
+ *
+ * @param packet the packet to confirm
+ */
void confirm(Packet packet);
+ /**
+ * sets the handler to use when a confirmation is received.
+ *
+ * @param handler the handler to call
+ */
void setCommandConfirmationHandler(CommandConfirmationHandler handler);
+ /**
+ * flushes any confirmations on to the connection.
+ */
void flushConfirmations();
+ /**
+ * Called by {@link org.hornetq.core.remoting.RemotingConnection} when a packet is received.
+ * <p/>
+ * This method should then call its {@link org.hornetq.core.remoting.ChannelHandler} after appropriate processing of
+ * the packet
+ *
+ * @param packet the packet to process.
+ */
void handlePacket(Packet packet);
+ /**
+ * clears any commands from the cache that are yet to be confirmed.
+ */
void clearCommands();
+ /**
+ * returns the confirmation window size this channel is using.
+ *
+ * @return the window size
+ */
int getConfirmationWindowSize();
-
+
+ /**
+ * notifies the channel if it is transferring its connection. When true it is illegal to send messages.
+ *
+ * @param transferring whether the channel is transferring
+ */
void setTransferring(boolean transferring);
}
Modified: trunk/src/main/org/hornetq/core/remoting/ChannelHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/ChannelHandler.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/ChannelHandler.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -13,12 +13,17 @@
package org.hornetq.core.remoting;
/**
- * A ChannelHandler
- *
+ * A ChannelHandler is used by {@link Channel}. When a channel receives a packet it will call its handler to deal with the
+ * packet.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
*/
public interface ChannelHandler
{
+ /**
+ * called by the channel when a packet is received..
+ *
+ * @param packet the packet received
+ */
void handlePacket(Packet packet);
}
Modified: trunk/src/main/org/hornetq/core/remoting/CloseListener.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/CloseListener.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/CloseListener.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -13,9 +13,16 @@
package org.hornetq.core.remoting;
/**
+ * CloseListeners can be registered with a {@link org.hornetq.core.remoting.RemotingConnection} to get notified when the connection is closed.
+ * <p/>
+ * {@link org.hornetq.core.remoting.RemotingConnection#addCloseListener(CloseListener)}
+ *
* @author <a href="mailto:andy.taylor@jboss.org">Andy Taylor</a>
*/
public interface CloseListener
{
+ /**
+ * called when the connection is closed
+ */
void connectionClosed();
}
Modified: trunk/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/CommandConfirmationHandler.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -14,15 +14,18 @@
package org.hornetq.core.remoting;
/**
- * A CommandConfirmationHandler
+ * A CommandConfirmationHandler is used by the channel to confirm confirmations of packets.
*
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
- * Created 9 Feb 2009 12:39:11
- *
- *
+ * <p/>
+ * Created 9 Feb 2009 12:39:11
*/
public interface CommandConfirmationHandler
{
+ /**
+ * called by channel after a confirmation has been received.
+ *
+ * @param packet the packet confirmed
+ */
void commandConfirmed(Packet packet);
}
Modified: trunk/src/main/org/hornetq/core/remoting/FailureListener.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/FailureListener.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/FailureListener.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -16,18 +16,16 @@
import org.hornetq.core.exception.HornetQException;
/**
- *
- * A FailureListener notifies the user when a connection failure occured.
- *
+ * A FailureListener notifies the user when a connection failure occurred.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
*/
public interface FailureListener
{
/**
* Notifies that a connection has failed due to the specified exception.
- *
+ *
* @param exception exception which has caused the connection to fail
*/
void connectionFailed(HornetQException exception);
Modified: trunk/src/main/org/hornetq/core/remoting/Interceptor.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/Interceptor.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/Interceptor.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -16,20 +16,20 @@
import org.hornetq.core.exception.HornetQException;
/**
- *
* This is class is a simple way to intercepting server calls on HornetQ.
- *
+ * <p/>
* To Add this interceptor, you have to modify hornetq-configuration.xml
- *
+ *
* @author clebert.suconic(a)jboss.com
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
*/
public interface Interceptor
{
/**
- *
- * @param packet
- * @param connection
+ * gets called when a packet is received prior to be sent to the channel
+ *
+ * @param packet the packet being received
+ * @param connection the connection the packet was received on
* @return true to process the next interceptor and handle the packet,
* false to abort processing of the packet
* @throws HornetQException
Modified: trunk/src/main/org/hornetq/core/remoting/Packet.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/Packet.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/Packet.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -16,31 +16,68 @@
import org.hornetq.core.buffers.HornetQBuffer;
/**
- *
- * A Packet
- *
+ * A Packet represents a pcaket of data transmitted over a connection.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
- *
*/
public interface Packet
{
+ /**
+ * This sets the channel id that should be used once the packet has been successfully decoded it is sent to the correct channel.
+ *
+ * @param channelID the id of the channel to handle the packet
+ */
void setChannelID(long channelID);
+ /**
+ * returns the channel id of the channel that should handle this pcaket
+ *
+ * @return the id of the channel
+ */
long getChannelID();
+ /**
+ * returns true if this packet is being sent in response to a previously received packet
+ *
+ * @return true if a response
+ */
boolean isResponse();
+ /**
+ * returns the type of the packet.
+ * <p/>
+ * This is needed when decoding the packet
+ *
+ * @return the packet type
+ */
byte getType();
+ /**
+ * Encodes the packet and returns a {@link org.hornetq.core.buffers.HornetQBuffer} containing the data
+ *
+ * @param connection the connection
+ * @return the buffer to encode to
+ */
HornetQBuffer encode(RemotingConnection connection);
+ /**
+ * decodes the buffer into this packet
+ *
+ * @param buffer the buffer to decode from
+ */
void decode(HornetQBuffer buffer);
/**
- *
+ * returns the size needed to encode this packet.
+ *
* @return The size of the entire packet including headers, and extra data
*/
int getPacketSize();
+ /**
+ * returns true if a confirmation should be sent on receipt of this packet.
+ *
+ * @return true if confirmation is required
+ */
boolean isRequiresConfirmations();
}
Modified: trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/RemotingConnection.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -21,60 +21,197 @@
import org.hornetq.core.remoting.spi.Connection;
/**
- * A RemotingConnection
- *
+ * A RemotingConnection is a connection between a client and a server.
+ * <p/>
+ * It allows multiple {@link org.hornetq.core.remoting.Channel}'s to be created and data multiplexed over them. It uses
+ * and a {@link Connection} implementation and takes care of failures etc.
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*/
public interface RemotingConnection extends BufferHandler
{
+ /**
+ * returns the unique id of the Remoting Connection
+ *
+ * @return the id
+ */
Object getID();
+ /**
+ * returns a string representation of the remote address of this connection
+ *
+ * @return the remote address
+ */
String getRemoteAddress();
+ /**
+ * return the channel with the channel id specified.
+ * <p/>
+ * If it does not exist create it with the confirmation window size.
+ *
+ * @param channelID the channel id
+ * @param confWindowSize the confirmation window size
+ * @return the channel
+ */
Channel getChannel(long channelID, int confWindowSize);
+ /**
+ * add the channel with the specified channel id
+ *
+ * @param channelID the channel id
+ * @param channel the channel
+ */
void putChannel(long channelID, Channel channel);
+ /**
+ * remove the channel with the specified channel id
+ *
+ * @param channelID the channel id
+ * @return true if removed
+ */
boolean removeChannel(long channelID);
+ /**
+ * generate a unique (within this connection) channel id
+ *
+ * @return the id
+ */
long generateChannelID();
+ /**
+ * add a failure listener.
+ * <p/>
+ * The listener will be called in the event of connection failure.
+ *
+ * @param listener the listener
+ */
void addFailureListener(FailureListener listener);
+ /**
+ * remove the failure listener
+ *
+ * @param listener the lister to remove
+ * @return true if removed
+ */
boolean removeFailureListener(FailureListener listener);
+ /**
+ * add a CloseListener.
+ * <p/>
+ * This will be called in the event of the connection being closed.
+ *
+ * @param listener the listener to add
+ */
void addCloseListener(CloseListener listener);
+ /**
+ * remove a Close Listener
+ *
+ * @param listener the listener to remove
+ * @return true if removed
+ */
boolean removeCloseListener(CloseListener listener);
+ /**
+ * return all the failure listeners
+ *
+ * @return the listeners
+ */
List<FailureListener> getFailureListeners();
+ /**
+ * set the failure listeners.
+ * <p/>
+ * These will be called in the event of the connection being closed. Any previosuly added listeners will be removed.
+ *
+ * @param listeners the listeners to add.
+ */
void setFailureListeners(List<FailureListener> listeners);
+ /**
+ * creates a new HornetQBuffer of the specified size.
+ *
+ * @param size the size of buffer required
+ * @return the buffer
+ */
HornetQBuffer createBuffer(int size);
+ /**
+ * called when the underlying connection fails.
+ *
+ * @param me the exception that caused the failure
+ */
void fail(HornetQException me);
+ /**
+ * destroys this connection.
+ */
void destroy();
+ /**
+ * resets the id generator used to when generating id's
+ *
+ * @param id the first id to set it to
+ */
void syncIDGeneratorSequence(long id);
+ /**
+ * return the next id that will be chosen.
+ *
+ * @return the id
+ */
long getIDGeneratorSequence();
+ /**
+ * return the underlying Connection.
+ *
+ * @return the connection
+ */
Connection getTransportConnection();
+ /**
+ * returns whether or not the Remoting Connection is a client
+ *
+ * @return true if client, false if a server
+ */
boolean isClient();
+ /**
+ * returns true if this Remoting Connection has been destroyed.
+ *
+ * @return true if destroyed, otherwise false
+ */
boolean isDestroyed();
+ /**
+ * return the current tomeout for blocking calls
+ *
+ * @return the timeout in milliseconds
+ */
long getBlockingCallTimeout();
+ /**
+ * return the transfer lock used when transferring connections.
+ *
+ * @return the lock
+ */
Object getTransferLock();
+ /**
+ * returns true if any data has been received since the last time this method was called.
+ *
+ * @return true if data has been received.
+ */
boolean checkDataReceived();
+ /**
+ * remove all channels from the remoting connection
+ */
void removeAllChannels();
-
+
+ /**
+ * flush all outstanding confirmations onto the connection.
+ */
void flushConfirmations();
}
Modified: trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-12-11 10:08:41 UTC (rev 8671)
+++ trunk/src/main/org/hornetq/core/remoting/impl/ChannelImpl.java 2009-12-11 11:02:23 UTC (rev 8672)
@@ -301,11 +301,6 @@
this.handler = handler;
}
- public ChannelHandler getHandler()
- {
- return handler;
- }
-
public void close()
{
if (closed)
16 years, 7 months
JBoss hornetq SVN: r8671 - trunk/src/bin.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-11 05:08:41 -0500 (Fri, 11 Dec 2009)
New Revision: 8671
Modified:
trunk/src/bin/run.sh
Log:
HORNETQ-224: run.sh script print out wrong stars lines
* added quotes to echo
Modified: trunk/src/bin/run.sh
===================================================================
--- trunk/src/bin/run.sh 2009-12-11 09:53:47 UTC (rev 8670)
+++ trunk/src/bin/run.sh 2009-12-11 10:08:41 UTC (rev 8671)
@@ -17,7 +17,7 @@
CLASSPATH=$i:$CLASSPATH
done
-echo ***********************************************************************************
+echo "***********************************************************************************"
echo "java $JVM_ARGS -classpath $CLASSPATH org.hornetq.integration.bootstrap.HornetQBootstrapServer $FILENAME"
-echo ***********************************************************************************
+echo "***********************************************************************************"
java $JVM_ARGS -classpath $CLASSPATH -Dcom.sun.management.jmxremote org.hornetq.integration.bootstrap.HornetQBootstrapServer $FILENAME
\ No newline at end of file
16 years, 7 months
JBoss hornetq SVN: r8670 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: timfox
Date: 2009-12-11 04:53:47 -0500 (Fri, 11 Dec 2009)
New Revision: 8670
Modified:
trunk/docs/user-manual/en/logging.xml
Log:
fixed typo in logging chapter
Modified: trunk/docs/user-manual/en/logging.xml
===================================================================
--- trunk/docs/user-manual/en/logging.xml 2009-12-10 17:33:45 UTC (rev 8669)
+++ trunk/docs/user-manual/en/logging.xml 2009-12-11 09:53:47 UTC (rev 8670)
@@ -28,7 +28,7 @@
<para>You can configure a different Logging Delegate programatically or via a System
Property.</para>
<para>To do this programatically simply do the
- following<programlisting>org.hornetq.core.logging.setDelegateFactory(new Log4jLogDelegateFactory())</programlisting></para>
+ following<programlisting>org.hornetq.core.logging.Logger.setDelegateFactory(new Log4jLogDelegateFactory())</programlisting></para>
<para>Where <literal>Log4jLogDelegateFactory</literal> is the implementation of <literal
>org.hornetq.core.logging.LogDelegateFactory </literal>that you would like to
use.</para>
16 years, 7 months
JBoss hornetq SVN: r8669 - in trunk/src/main/org/hornetq: jms/server/management and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-10 12:33:45 -0500 (Thu, 10 Dec 2009)
New Revision: 8669
Modified:
trunk/src/main/org/hornetq/core/management/AddressControl.java
trunk/src/main/org/hornetq/core/management/QueueControl.java
trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
Log:
HORNETQ-186: fill in Javadocs for core API
* added javadoc for org.hornetq.jms.server.management API
Modified: trunk/src/main/org/hornetq/core/management/AddressControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/AddressControl.java 2009-12-10 16:28:39 UTC (rev 8668)
+++ trunk/src/main/org/hornetq/core/management/AddressControl.java 2009-12-10 17:33:45 UTC (rev 8669)
@@ -38,6 +38,8 @@
/**
* Returns the roles (name and permissions) associated to this address
* using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link RoleInfo#from(String)}.
*/
String getRolesAsJSON() throws Exception;
Modified: trunk/src/main/org/hornetq/core/management/QueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/QueueControl.java 2009-12-10 16:28:39 UTC (rev 8668)
+++ trunk/src/main/org/hornetq/core/management/QueueControl.java 2009-12-10 17:33:45 UTC (rev 8669)
@@ -69,7 +69,6 @@
*/
long getScheduledCount();
-
/**
* Returns the number of consumers consuming messages from this queue.
*/
@@ -122,21 +121,27 @@
String listScheduledMessagesAsJSON() throws Exception;
/**
- * Lists all the messages in this queue matching the specified filter.
+ * Lists all the messages in this queue matching the specified filter.
* <br>
* 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
*/
@Operation(desc = "List all the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
/**
* Lists all the messages in this queue matching the specified filter using JSON serialization.
- */
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+ */
@Operation(desc = "List all the messages in the queue matching the given filter and returns them using JSON", impact = MBeanOperationInfo.INFO)
String listMessagesAsJSON(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
/**
* Counts the number of messages in this queue matching the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
*/
@Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
int countMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
@@ -228,6 +233,8 @@
/**
* Changes the priority for all the message corresponding to the specified filter to the specified priority.
+ * <br>
+ * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
*
* @return the number of changed messages
*/
@@ -278,7 +285,7 @@
void resume() throws Exception;
/**
- * Returns whether the queue is pause.
+ * Returns whether the queue is paused.
*/
@Operation(desc = "Inspects if the queue is paused", impact = MBeanOperationInfo.INFO)
boolean isPaused() throws Exception;
Modified: trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java 2009-12-10 16:28:39 UTC (rev 8668)
+++ trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java 2009-12-10 17:33:45 UTC (rev 8669)
@@ -19,27 +19,48 @@
import org.hornetq.core.server.management.Parameter;
/**
+ * A DestinationControl is used to manage a JMS Destination.
+ *
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
*/
public interface DestinationControl
{
// Attributes ----------------------------------------------------
+ /**
+ * Returns the name of this destination.
+ */
String getName();
+ /**
+ * Returns the JNDI binding of this destination.
+ */
String getJNDIBinding();
+ /**
+ * Returns the HornetQ address corresponding to this destination.
+ */
String getAddress();
+ /**
+ * Returns whether this destination is temporary.
+ */
boolean isTemporary();
+ /**
+ * Returns the number of messages currently in this destination.
+ */
int getMessageCount() throws Exception;
// Operations ----------------------------------------------------
+ /**
+ * Removed all the messages which matches the specified JMS filter from this destination.
+ * <br>
+ * Using {@code null} or an empty filter will remove <em>all</em> messages from this destination.
+ *
+ * @return the number of removed messages
+ */
@Operation(desc = "Remove messages matching the given filter from the destination", impact = MBeanOperationInfo.ACTION)
int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
Modified: trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java 2009-12-10 16:28:39 UTC (rev 8668)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java 2009-12-10 17:33:45 UTC (rev 8669)
@@ -21,106 +21,225 @@
import org.hornetq.core.server.management.Parameter;
/**
+ * A JMSQueueControl is used to manage a JMS queue.
+ *
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
*/
public interface JMSQueueControl extends DestinationControl
{
// Attributes ----------------------------------------------------
- String getName();
-
+ /**
+ * Returns the expiry address associated to this queue.
+ */
String getExpiryAddress();
+ /**
+ * Sets the expiry address associated to this queue to the specified expiryAddress.
+ */
void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception;
+ /**
+ * Returns the dead-letter address associated to this queue.
+ */
String getDeadLetterAddress();
+ /**
+ * Sets the dead-letter address associated to this queue to the specified deadLetterAddress.
+ */
void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
+ /**
+ * Returns the number of messages added to this queue since it was created.
+ */
int getMessagesAdded();
- boolean isTemporary();
-
- boolean isDurable();
-
- int getMessageCount();
-
+ /**
+ * Returns the number of scheduled messages in this queue.
+ */
long getScheduledCount();
+ /**
+ * Returns the number of consumers consuming messages from this queue.
+ */
int getConsumerCount();
+ /**
+ * Returns the number of messages that this queue is currently delivering to its consumers.
+ */
int getDeliveringCount();
// Operations ----------------------------------------------------
+ /**
+ * Lists all the JMS messages in this queue matching the specified filter.
+ * <br>
+ * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+ */
@Operation(desc = "List all messages in the queue which matches the filter", impact = MBeanOperationInfo.INFO)
Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter") String filter) throws Exception;
+ /**
+ * Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
+ * <br>
+ * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+ */
@Operation(desc = "List all messages in the queue which matches the filter and return them using JSON", impact = MBeanOperationInfo.INFO)
String listMessagesAsJSON(@Parameter(name = "filter", desc = "A JMS Message filter (can be empty)") String filter) throws Exception;
+ /**
+ * Counts the number of messages in this queue matching the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+ */
@Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
int countMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+ /**
+ * Removes the message corresponding to the specified message ID.
+ *
+ * @return {@code true}�if the message was removed, {@code false} else
+ */
@Operation(desc = "Remove the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+ /**
+ * Removes all the message corresponding to the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will remove <em>all</em> messages from this queue.
+ *
+ * @return the number of removed messages
+ */
@Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = MBeanOperationInfo.ACTION)
int removeMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+ /**
+ * Expires all the message corresponding to the specified filter.
+ * <br>
+ * Using {@code null} or an empty filter will expire <em>all</em> messages from this queue.
+ *
+ * @return the number of expired messages
+ */
@Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = MBeanOperationInfo.ACTION)
int expireMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+ /**
+ * Expires the message corresponding to the specified message ID.
+ *
+ * @return {@code true}�if the message was expired, {@code false} else
+ */
@Operation(desc = "Expire the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
- @Operation(desc = "Send the message corresponding to the given messageID to the queue's Dead Letter Queue", impact = MBeanOperationInfo.ACTION)
+ /**
+ * Sends the message corresponding to the specified message ID to this queue's dead letter address.
+ *
+ * @return {@code true}�if the message was sent to the dead letter address, {@code false} else
+ */
+ @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+ /**
+ * Sends all the message corresponding to the specified filter to this queue's dead letter address.
+ * <br>
+ * Using {@code null} or an empty filter will send <em>all</em> messages from this queue.
+ *
+ * @return the number of sent messages
+ */
@Operation(desc = "Send the messages corresponding to the given filter to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception;
+ /**
+ * Changes the message's priority corresponding to the specified message ID to the specified priority.
+ *
+ * @param newPriority between 0 and 9 inclusive.
+ *
+ * @return {@code true}�if the message priority was changed
+ */
@Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
boolean changeMessagePriority(@Parameter(name = "messageID", desc = "A message ID") String messageID,
@Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+ /**
+ * Changes the priority for all the message corresponding to the specified filter to the specified priority.
+ * <br>
+ * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
+ *
+ * @return the number of changed messages
+ */
@Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = MBeanOperationInfo.ACTION)
int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter") String filter,
@Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+ /**
+ * Moves the message corresponding to the specified message ID to the specified other queue.
+ *
+ * @return {@code true}�if the message was moved, {@code false} else
+ */
@Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = MBeanOperationInfo.ACTION)
boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID,
@Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to") String otherQueueName) throws Exception;
+ /**
+ * Moves all the message corresponding to the specified filter to the specified other queue.
+ * <br>
+ * Using {@code null} or an empty filter will move <em>all</em> messages from this queue.
+ *
+ * @return the number of moved messages
+ */
@Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = MBeanOperationInfo.ACTION)
int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
+ /**
+ * Lists the message counter for this queue.
+ */
@Operation(desc = "List the message counters", impact = MBeanOperationInfo.INFO)
String listMessageCounter() throws Exception;
+ /**
+ * Resets the message counter for this queue.
+ */
@Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
void resetMessageCounter() throws Exception;
+
+ /**
+ * Lists the message counter for this queue as a HTML table.
+ */
@Operation(desc = "List the message counters as HTML", impact = MBeanOperationInfo.INFO)
String listMessageCounterAsHTML() throws Exception;
+ /**
+ * Lists the message counter history for this queue.
+ */
@Operation(desc = "List the message counters history", impact = MBeanOperationInfo.INFO)
String listMessageCounterHistory() throws Exception;
+ /**
+ * Lists the message counter history for this queue as a HTML table.
+ */
@Operation(desc = "List the message counters history as HTML", impact = MBeanOperationInfo.INFO)
String listMessageCounterHistoryAsHTML() throws Exception;
- @Operation(desc = "Pauses the queue.", impact = MBeanOperationInfo.INFO)
+ /**
+ * Pauses the queue. Messages are no longer delivered to its consumers.
+ */
+ @Operation(desc = "Pause the queue.", impact = MBeanOperationInfo.ACTION)
void pause() throws Exception;
+ /**
+ * Returns whether the queue is paused.
+ */
@Operation(desc = "Returns true if the queue is paused.", impact = MBeanOperationInfo.INFO)
boolean isPaused() throws Exception;
- @Operation(desc = "Resumes the queue.", impact = MBeanOperationInfo.INFO)
+ /**
+ * Resumes the queue. Messages are again delivered to its consumers.
+ */
+ @Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
void resume() throws Exception;
}
Modified: trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/TopicControl.java 2009-12-10 16:28:39 UTC (rev 8668)
+++ trunk/src/main/org/hornetq/jms/server/management/TopicControl.java 2009-12-10 17:33:45 UTC (rev 8669)
@@ -21,60 +21,117 @@
import org.hornetq.core.server.management.Parameter;
/**
+ * A TopicControl is used to manage a JMS Topic.
+ *
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
*/
public interface TopicControl extends DestinationControl
{
// Attributes ----------------------------------------------------
+ /**
+ * Returns the number of (durable and non-durable) subscribers for this topic.
+ */
int getSubscriptionCount();
+ /**
+ * Returns the number of <em>durable</em> subscribers for this topic.
+ */
int getDurableSubscriptionCount();
+ /**
+ * Returns the number of <em>non-durable</em> subscribers for this topic.
+ */
int getNonDurableSubscriptionCount();
+ /**
+ * Returns the number of messages for all <em>durable</em> subscribers for this topic.
+ */
int getDurableMessageCount();
+ /**
+ * Returns the number of messages for all <em>non-durable</em> subscribers for this topic.
+ */
int getNonDurableMessageCount();
// Operations ----------------------------------------------------
+ /**
+ * Lists all the subscriptions for this topic (both durable and non-durable).
+ */
@Operation(desc = "List all subscriptions")
Object[] listAllSubscriptions() throws Exception;
+ /**
+ * Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
@Operation(desc = "List all subscriptions")
String listAllSubscriptionsAsJSON() throws Exception;
+ /**
+ * Lists all the <em>durable</em> subscriptions for this topic.
+ */
@Operation(desc = "List only the durable subscriptions")
Object[] listDurableSubscriptions() throws Exception;
+ /**
+ * Lists all the <em>durable</em> subscriptions using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
@Operation(desc = "List only the durable subscriptions")
String listDurableSubscriptionsAsJSON() throws Exception;
+ /**
+ * Lists all the <em>non-durable</em> subscriptions for this topic.
+ */
@Operation(desc = "List only the non durable subscriptions")
Object[] listNonDurableSubscriptions() throws Exception;
+ /**
+ * Lists all the <em>non-durable</em> subscriptions using JSON serialization.
+ * <br>
+ * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+ */
@Operation(desc = "List only the non durable subscriptions")
String listNonDurableSubscriptionsAsJSON() throws Exception;
+ /**
+ * Lists all the messages in this queue matching the specified queue representing the subscription.
+ * <br>
+ * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+ */
@Operation(desc = "List all the message for the given subscription")
public Map<String, Object>[] listMessagesForSubscription(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
+ /**
+ * Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
+ */
@Operation(desc = "List all the message for the given subscription")
public String listMessagesForSubscriptionAsJSON(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
+ /**
+ * Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
+ * <br>
+ * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+ */
@Operation(desc = "Count the number of messages matching the filter for the given subscription")
public int countMessagesForSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
@Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName,
@Parameter(name = "filter", desc = "a JMS filter (can be empty)") String filter) throws Exception;
+ /**
+ * Drops the subscription specified by the specified client ID and subscription name.
+ */
@Operation(desc = "Drop a durable subscription", impact = MBeanOperationInfo.ACTION)
void dropDurableSubscription(@Parameter(name = "clientID", desc = "the client ID") String clientID,
@Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName) throws Exception;
+ /**
+ * Drops all subscriptions.
+ */
@Operation(desc = "Drop all subscriptions from this topic", impact = MBeanOperationInfo.ACTION)
void dropAllSubscriptions() throws Exception;
}
16 years, 7 months
JBoss hornetq SVN: r8668 - trunk/src/main/org/hornetq/core/management.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2009-12-10 11:28:39 -0500 (Thu, 10 Dec 2009)
New Revision: 8668
Added:
trunk/src/main/org/hornetq/core/management/package-info.java
Removed:
trunk/src/main/org/hornetq/core/management/package.html
Log:
HORNETQ-186: fill in Javadocs for core API
* removed management package javadoc (was old, user manual is the reference for more info on management)
Added: trunk/src/main/org/hornetq/core/management/package-info.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/package-info.java (rev 0)
+++ trunk/src/main/org/hornetq/core/management/package-info.java 2009-12-10 16:28:39 UTC (rev 8668)
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * API management to manage HornetQ server and its Core resources.
+ * <br>
+ * HornetQ can be managed either using JMX or by sending management messages to the
+ * server's special management address. Please refer to the user manual for more information.
+ */
+package org.hornetq.core.management;
+
Deleted: trunk/src/main/org/hornetq/core/management/package.html
===================================================================
--- trunk/src/main/org/hornetq/core/management/package.html 2009-12-10 16:19:49 UTC (rev 8667)
+++ trunk/src/main/org/hornetq/core/management/package.html 2009-12-10 16:28:39 UTC (rev 8668)
@@ -1,80 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
- <head>
- <!--
-
- JBoss: The OpenSource J2EE WebOS
-
- Distributable under LGPL license.
- See terms of license at gnu.org.
-
- -->
- </head>
- <body>
-
-<p>Provides management for HornetQ</p>
-
-<h2>Usage</h2>
-
-<p>HornetQ can be managed by sending well-formatted <em>messages</em> to a well-known <em>management address</em>.
-The invocation of management operations (and retrieval of management attributes) is based on JMX semantics. Managed resources are identified
-by <code>ObjectNames</code> (defined in <code>ManagementServiceImpl.getXXXObjectName()</code> methods).</p>
-
-<p>To create a well-formatted management message, use the helper methods defined in <code>ManagementHelper</code>.
-A management message corresponds either to one operation invocation or one (or many) attribute retrievals.
-If a reply is expected (when the operation returns a value or when retrieving an attribute), a reply-to address
-<strong>must</strong> be set on the message using the <code>ClientMessageImpl.REPLYTO_HEADER_NAME</code> header.</p>
-
-<h2>Configuration</h2>
-
-<p>Management is configured in <code>hornetq-configuration.xml</code>:</p>
-
-<pre><code>
- <management-address>admin.management</management-address>
- <management-notification-address>admin.notification</management-notification-address>
-
- <!-- true to expose HornetQ resources through JMX -->
- <jmx-management-enabled>true</jmx-management-enabled>
-</code></pre>
-
-<h2>Management using JMX</h2>
-
-<p>In addition to using messages, HornetQ can also be managed using JMX (if the configuration property
-<code>jmx-management-enabled</code> is set to <code>true</code>).<br />
-HornetQ is run in standalone to allow remote JMX management from the same machine (<code>-Dcom.sun.management.jmxremote</code>).
-A JMX client (e.g. <code>jconsole</code>) can be used locally to manage HornetQ.</p>
-
-<h2>Design</h2>
-
-<p>The core of the management support in HornetQ is the ManagementServiceImpl class.<br />
-This class is responsible to:</p>
-
-<ul>
- <li>keep track of the managed resources in a registry (and a MBeanServer when JMX management is enabled)</li>
- <li>handle "management" messages (which are sent to the address configured in <code>management-address</code> property)</li>
-</ul>
-
-<p>Each managed "Resources" (e.g. the server, the queues, the addresses, etc.) is managed through a ControlMBean class
-(the MBean is appended to make them JMX-compliant). The <code>ControlMBean</code> implementation handles user input
-validation, type conversion, etc. and delegates to the real resource.</p>
-
-<p>When the ManagementService handles a management message, it uses the registry to find the corresponding ControlMBean
-(identified by an ObjectName set on the management message) and invoke the operation (or retrieve the attribute value) using Java reflection.</p>
-
-<h2>Management in a clustered environment and JMX</h2>
-
-<p>Using core messages to manage HornetQ also works in a clustered environment: the management messages are
-replicated on the nodes of the cluster, ensuring that the state is replicated on all the nodes.</p>
-
-<p>To allow JMX to work in a clustered environment, the MBean implementation do not delegates directly to the resources
- when a management operation is invoked through JMX.<br />
-Instead, the MBean implementation translates the operation invocation into a management messages which is sent from
-</em>inside</em> the server. In turn, this triggers the replication of the messages to all the nodes
-of the clustered. All the MBean implementations are based on the <code>ReplicationAwareStandardMBeanWrapper</code>
-which provides method to ensure a management operation is correctly replicated.</p>
-
-<p><em>All management operation invocations which alters state are replicated, the operations without side-effect
- (and retrieval of attributes) are delegated directly to the resource control implementation.</em></p>
-
- </body>
-</html>
\ No newline at end of file
16 years, 7 months