Author: rajdavies
Date: Wed Jun 4 03:20:47 2008
New Revision: 663048
URL: http://svn.apache.org/viewvc?rev=663048&view=rev
Log:
Apply patch for https://issues.apache.org/activemq/browse/AMQ-1761
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java?rev=663048&r1=663047&r2=663048&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationView.java
Wed Jun 4 03:20:47 2008
@@ -239,8 +239,16 @@
public String sendTextMessage(String body) throws Exception {
return sendTextMessage(Collections.EMPTY_MAP, body);
}
-
+
public String sendTextMessage(Map headers, String body) throws Exception {
+ return sendTextMessage(headers,body,null,null);
+ }
+
+ public String sendTextMessage(String body, String user, String password)
throws Exception {
+ return sendTextMessage(Collections.EMPTY_MAP,body,null,null);
+ }
+
+ public String sendTextMessage(Map headers, String body,String
userName,String password) throws Exception {
String brokerUrl = "vm://" + broker.getBrokerName();
ActiveMQDestination dest = destination.getActiveMQDestination();
@@ -249,7 +257,7 @@
Connection connection = null;
try {
- connection = cf.createConnection();
+ connection = cf.createConnection(userName,password);
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(dest);
ActiveMQTextMessage msg =
(ActiveMQTextMessage)session.createTextMessage(body);
@@ -333,6 +341,5 @@
public void setUseCache(boolean value) {
destination.setUseCache(value);
- }
-
+ }
}
Modified:
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java?rev=663048&r1=663047&r2=663048&view=diff
==============================================================================
---
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
(original)
+++
activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/DestinationViewMBean.java
Wed Jun 4 03:20:47 2008
@@ -134,6 +134,27 @@
String sendTextMessage(Map headers, String body) throws Exception;
/**
+ * Sends a TextMesage to the destination.
+ * @param body the text to send
+ * @param user
+ * @param password
+ * @return
+ * @throws Exception
+ */
+ String sendTextMessage(String body, String user, String password) throws
Exception;
+
+ /**
+ *
+ * @param headers the message headers and properties to set. Can only
+ * container Strings maped to primitive types.
+ * @param body the text to send
+ * @param user
+ * @param password
+ * @return
+ * @throws Exception
+ */
+ String sendTextMessage(Map headers, String body, String user, String
password) throws Exception;
+ /**
* @return the percentage of amount of memory used
*/
int getMemoryPercentUsage();