JBoss hornetq SVN: r10081 - trunk/src/main/org/hornetq/core/persistence/impl/nullpm.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-28 12:31:02 -0500 (Tue, 28 Dec 2010)
New Revision: 10081
Modified:
trunk/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
Log:
fixing one test
Modified: trunk/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2010-12-28 00:44:28 UTC (rev 10080)
+++ trunk/src/main/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2010-12-28 17:31:02 UTC (rev 10081)
@@ -21,8 +21,6 @@
import javax.transaction.xa.Xid;
-import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.journal.IOAsyncTask;
@@ -61,6 +59,52 @@
private final AtomicLong idSequence = new AtomicLong(0);
private volatile boolean started;
+
+ private static final OperationContext dummyContext = new OperationContext()
+ {
+
+ public void onError(int errorCode, String errorMessage)
+ {
+ }
+
+ public void done()
+ {
+ }
+
+ public void storeLineUp()
+ {
+ }
+
+ public boolean waitCompletion(long timeout) throws Exception
+ {
+ return true;
+ }
+
+ public void waitCompletion() throws Exception
+ {
+ }
+
+ public void replicationLineUp()
+ {
+ }
+
+ public void replicationDone()
+ {
+ }
+
+ public void pageSyncLineUp()
+ {
+ }
+
+ public void pageSyncDone()
+ {
+ }
+
+ public void executeOnCompletion(IOAsyncTask runnable)
+ {
+ runnable.done();
+ }
+ };
public void sync()
{
@@ -352,7 +396,7 @@
*/
public OperationContext getContext()
{
- return null;
+ return dummyContext;
}
/* (non-Javadoc)
@@ -360,7 +404,7 @@
*/
public OperationContext newContext(final Executor executor)
{
- return null;
+ return dummyContext;
}
/* (non-Javadoc)
@@ -440,8 +484,6 @@
*/
public void storeCursorAcknowledge(long queueID, PagePosition position)
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -449,8 +491,6 @@
*/
public void storeCursorAcknowledgeTransactional(long txID, long queueID, PagePosition position)
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -458,8 +498,6 @@
*/
public void deleteCursorAcknowledgeTransactional(long txID, long ackID) throws Exception
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -467,8 +505,6 @@
*/
public void updatePageTransaction(PageTransactionInfo pageTransaction, int depage) throws Exception
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -476,7 +512,6 @@
*/
public long storePageCounter(long txID, long queueID, long value) throws Exception
{
- // TODO Auto-generated method stub
return 0;
}
@@ -485,8 +520,6 @@
*/
public void deleteIncrementRecord(long txID, long recordID) throws Exception
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -494,8 +527,6 @@
*/
public void deletePageCounter(long txID, long recordID) throws Exception
{
- // TODO Auto-generated method stub
-
}
/* (non-Javadoc)
@@ -503,7 +534,6 @@
*/
public long storePageCounterInc(long txID, long queueID, int add) throws Exception
{
- // TODO Auto-generated method stub
return 0;
}
@@ -512,7 +542,6 @@
*/
public long storePageCounterInc(long queueID, int add) throws Exception
{
- // TODO Auto-generated method stub
return 0;
}
13 years, 12 months
JBoss hornetq SVN: r10080 - trunk/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 19:44:28 -0500 (Mon, 27 Dec 2010)
New Revision: 10080
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
Log:
avoiding test hanging
Modified: trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-28 00:10:31 UTC (rev 10079)
+++ trunk/tests/src/org/hornetq/tests/integration/client/ProducerFlowControlTest.java 2010-12-28 00:44:28 UTC (rev 10080)
@@ -12,16 +12,25 @@
*/
package org.hornetq.tests.integration.client;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import junit.framework.Assert;
import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.client.*;
+import org.hornetq.api.core.client.ClientConsumer;
+import org.hornetq.api.core.client.ClientMessage;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.client.ClientSession;
+import org.hornetq.api.core.client.ClientSessionFactory;
+import org.hornetq.api.core.client.MessageHandler;
+import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.core.client.impl.ClientProducerCreditManagerImpl;
import org.hornetq.core.client.impl.ClientProducerCredits;
import org.hornetq.core.client.impl.ClientProducerInternal;
@@ -325,7 +334,7 @@
for (int i = 0; i < numConsumers; i++)
{
- handlers[i].latch.await();
+ assertTrue(handlers[i].latch.await(5, TimeUnit.MINUTES));
Assert.assertNull(handlers[i].exception);
}
13 years, 12 months
JBoss hornetq SVN: r10079 - trunk/tests/jms-tests/src/org/hornetq/jms/tests.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 19:10:31 -0500 (Mon, 27 Dec 2010)
New Revision: 10079
Modified:
trunk/tests/jms-tests/src/org/hornetq/jms/tests/SessionTest.java
Log:
two tests became invalid with the change on XA Sessions
Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/SessionTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/SessionTest.java 2010-12-27 21:56:59 UTC (rev 10078)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/SessionTest.java 2010-12-28 00:10:31 UTC (rev 10079)
@@ -89,22 +89,6 @@
conn.close();
}
- public void testGetSession1() throws Exception
- {
- Connection conn = getConnectionFactory().createConnection();
- Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- try
- {
- ((XASession)sess).getSession();
- ProxyAssertSupport.fail("Should throw IllegalStateException");
- }
- catch (javax.jms.IllegalStateException e)
- {
- }
- conn.close();
- }
-
public void testGetSession2() throws Exception
{
XAConnection conn = getXAConnectionFactory().createXAConnection();
@@ -288,15 +272,6 @@
conn.close();
}
- public void testGetXAResource() throws Exception
- {
- Connection conn = getConnectionFactory().createConnection();
- Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- ((XASession)sess).getXAResource();
- conn.close();
- }
-
public void testGetXAResource2() throws Exception
{
XAConnection conn = getXAConnectionFactory().createXAConnection();
13 years, 12 months
JBoss hornetq SVN: r10078 - trunk/tests/src/org/hornetq/tests/integration/jms/server/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 16:56:59 -0500 (Mon, 27 Dec 2010)
New Revision: 10078
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
fixing tests
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 2010-12-27 21:47:36 UTC (rev 10077)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-12-27 21:56:59 UTC (rev 10078)
@@ -112,6 +112,12 @@
// Constructors --------------------------------------------------
// Public --------------------------------------------------------
+
+ /** Number of consumers used by the test itself */
+ protected int getNumberOfConsumers()
+ {
+ return 0;
+ }
public void testGetVersion() throws Exception
{
@@ -411,16 +417,15 @@
// create a consumer will create a Core queue bound to the topic address
MessageConsumer cons = session.createConsumer(topic);
- System.out.println("jsonString:" + control.listAllConsumersAsJSON());
JSONArray jsonArray = new JSONArray(control.listAllConsumersAsJSON());
- assertEquals(1, jsonArray.length());
+ assertEquals(1 + getNumberOfConsumers(), jsonArray.length());
cons.close();
jsonArray = new JSONArray(control.listAllConsumersAsJSON());
- assertEquals(0, jsonArray.length());
+ assertEquals(getNumberOfConsumers(), jsonArray.length());
String topicAddress = HornetQDestination.createTopicAddressFromName(topicName).toString();
AddressControl addressControl = (AddressControl)server.getManagementService()
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 2010-12-27 21:47:36 UTC (rev 10077)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-12-27 21:56:59 UTC (rev 10078)
@@ -60,7 +60,13 @@
// Constructors --------------------------------------------------
// JMSServerControlTest overrides --------------------------------
+ @Override
+ protected int getNumberOfConsumers()
+ {
+ return 1;
+ }
+
@Override
protected void setUp() throws Exception
{
13 years, 12 months
JBoss hornetq SVN: r10077 - in trunk/src/main/org/hornetq: spi/core/protocol and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 16:47:36 -0500 (Mon, 27 Dec 2010)
New Revision: 10077
Modified:
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
Log:
tweak
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 21:27:30 UTC (rev 10076)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 21:47:36 UTC (rev 10077)
@@ -551,13 +551,17 @@
for (RemotingConnection connection : connections)
{
- JSONObject obj = new JSONObject();
- obj.put("connectionID", connection.getID().toString());
- obj.put("clientAddress", connection.getRemoteAddress());
- obj.put("creationTime", connection.getCreationTime());
- obj.put("clientID", jmsSessions.get(connection.getID()).getMetaData("jms-client-id"));
- obj.put("principal", jmsSessions.get(connection.getID()).getUsername());
- array.put(obj);
+ ServerSession session = jmsSessions.get(connection.getID());
+ if (session != null)
+ {
+ JSONObject obj = new JSONObject();
+ obj.put("connectionID", connection.getID().toString());
+ obj.put("clientAddress", connection.getRemoteAddress());
+ obj.put("creationTime", connection.getCreationTime());
+ obj.put("clientID", session.getMetaData("jms-client-id"));
+ obj.put("principal", session.getUsername());
+ array.put(obj);
+ }
}
return array.toString();
}
Modified: trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-12-27 21:27:30 UTC (rev 10076)
+++ trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-12-27 21:47:36 UTC (rev 10077)
@@ -13,7 +13,6 @@
package org.hornetq.spi.core.protocol;
-import java.util.Collection;
import java.util.List;
import org.hornetq.api.core.HornetQBuffer;
13 years, 12 months
JBoss hornetq SVN: r10076 - in trunk: tests/src/org/hornetq/tests/integration/jms/client and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 16:27:30 -0500 (Mon, 27 Dec 2010)
New Revision: 10076
Added:
trunk/src/main/org/hornetq/jms/client/HornetQXASession.java
Modified:
trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
trunk/src/main/org/hornetq/jms/client/HornetQSession.java
trunk/tests/src/org/hornetq/tests/integration/jms/client/ConnectionTest.java
trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
Log:
HORNETQ-515 - tweak on createSession
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-12-27 21:03:03 UTC (rev 10075)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-12-27 21:27:30 UTC (rev 10076)
@@ -154,7 +154,7 @@
{
checkClosed();
- return createSessionInternal(transacted, acknowledgeMode, false, HornetQConnection.TYPE_GENERIC_CONNECTION);
+ return (Session)createSessionInternal(transacted, acknowledgeMode, false, HornetQConnection.TYPE_GENERIC_CONNECTION);
}
public String getClientID() throws JMSException
@@ -350,7 +350,7 @@
public QueueSession createQueueSession(final boolean transacted, final int acknowledgeMode) throws JMSException
{
checkClosed();
- return createSessionInternal(transacted, acknowledgeMode, false, HornetQSession.TYPE_QUEUE_SESSION);
+ return (QueueSession)createSessionInternal(transacted, acknowledgeMode, false, HornetQSession.TYPE_QUEUE_SESSION);
}
public ConnectionConsumer createConnectionConsumer(final Queue queue,
@@ -368,7 +368,7 @@
public TopicSession createTopicSession(final boolean transacted, final int acknowledgeMode) throws JMSException
{
checkClosed();
- return createSessionInternal(transacted, acknowledgeMode, false, HornetQSession.TYPE_TOPIC_SESSION);
+ return (TopicSession)createSessionInternal(transacted, acknowledgeMode, false, HornetQSession.TYPE_TOPIC_SESSION);
}
public ConnectionConsumer createConnectionConsumer(final Topic topic,
@@ -386,7 +386,7 @@
public XASession createXASession() throws JMSException
{
checkClosed();
- return createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_GENERIC_SESSION);
+ return (XASession)createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_GENERIC_SESSION);
}
// XAQueueConnection implementation -------------------------------------------------------------
@@ -394,7 +394,7 @@
public XAQueueSession createXAQueueSession() throws JMSException
{
checkClosed();
- return createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_QUEUE_SESSION);
+ return (XAQueueSession)createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_QUEUE_SESSION);
}
@@ -403,7 +403,7 @@
public XATopicSession createXATopicSession() throws JMSException
{
checkClosed();
- return createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_TOPIC_SESSION);
+ return (XATopicSession)createSessionInternal(true, Session.SESSION_TRANSACTED, true, HornetQSession.TYPE_TOPIC_SESSION);
}
@@ -468,7 +468,7 @@
}
}
- protected HornetQSession createSessionInternal(final boolean transacted,
+ private Object createSessionInternal(final boolean transacted,
int acknowledgeMode,
final boolean isXA,
final int type) throws JMSException
@@ -536,8 +536,20 @@
// Setting multiple times on different sessions doesn't matter since RemotingConnection maintains
// a set (no duplicates)
session.addFailureListener(listener);
+
+
+
- HornetQSession jbs = new HornetQSession(this, transacted, isXA, acknowledgeMode, session, type);
+ HornetQSession jbs;
+
+ if (isXA)
+ {
+ jbs = new HornetQXASession(this, transacted, isXA, acknowledgeMode, session, type);
+ }
+ else
+ {
+ jbs = new HornetQSession(this, transacted, isXA, acknowledgeMode, session, type);
+ }
sessions.add(jbs);
Modified: trunk/src/main/org/hornetq/jms/client/HornetQSession.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQSession.java 2010-12-27 21:03:03 UTC (rev 10075)
+++ trunk/src/main/org/hornetq/jms/client/HornetQSession.java 2010-12-27 21:27:30 UTC (rev 10076)
@@ -74,7 +74,7 @@
*
* $Id$
*/
-public class HornetQSession implements Session, XASession, QueueSession, XAQueueSession, TopicSession, XATopicSession
+public class HornetQSession implements Session, QueueSession, TopicSession
{
// Constants -----------------------------------------------------
Added: trunk/src/main/org/hornetq/jms/client/HornetQXASession.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQXASession.java (rev 0)
+++ trunk/src/main/org/hornetq/jms/client/HornetQXASession.java 2010-12-27 21:27:30 UTC (rev 10076)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2010 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.client;
+
+import javax.jms.XAQueueSession;
+import javax.jms.XASession;
+import javax.jms.XATopicSession;
+
+import org.hornetq.api.core.client.ClientSession;
+
+/**
+ * A HornetQXASession
+ *
+ * @author clebertsuconic
+ *
+ *
+ */
+public class HornetQXASession extends HornetQSession implements XAQueueSession, XATopicSession, XASession
+{
+
+ /**
+ * @param connection
+ * @param transacted
+ * @param xa
+ * @param ackMode
+ * @param session
+ * @param sessionType
+ */
+ protected HornetQXASession(HornetQConnection connection,
+ boolean transacted,
+ boolean xa,
+ int ackMode,
+ ClientSession session,
+ int sessionType)
+ {
+ super(connection, transacted, xa, ackMode, session, sessionType);
+ }
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/client/ConnectionTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/client/ConnectionTest.java 2010-12-27 21:03:03 UTC (rev 10075)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/client/ConnectionTest.java 2010-12-27 21:27:30 UTC (rev 10076)
@@ -14,6 +14,9 @@
package org.hornetq.tests.integration.jms.client;
import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.XAConnection;
+import javax.jms.XASession;
import org.hornetq.tests.util.JMSTestBase;
@@ -48,6 +51,18 @@
conn.close();
}
+
+ public void testXAInstanceof() throws Exception
+ {
+ Connection conn = cf.createConnection();
+
+ assertFalse(conn instanceof XAConnection);
+ Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ assertFalse(sess instanceof XASession);
+
+ conn.close();
+ }
// Package protected ---------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java 2010-12-27 21:03:03 UTC (rev 10075)
+++ trunk/tests/src/org/hornetq/tests/util/JMSTestBase.java 2010-12-27 21:27:30 UTC (rev 10076)
@@ -21,7 +21,6 @@
import javax.jms.Topic;
import javax.naming.NamingException;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.HornetQClient;
import org.hornetq.api.jms.JMSFactoryType;
13 years, 12 months
JBoss hornetq SVN: r10075 - in trunk: src/main/org/hornetq/core/management/impl and 4 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 16:03:03 -0500 (Mon, 27 Dec 2010)
New Revision: 10075
Modified:
trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
trunk/src/main/org/hornetq/core/server/ServerConsumer.java
trunk/src/main/org/hornetq/core/server/ServerSession.java
trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
Log:
HORNETQ-587 - adding listProducersInfoAsJSON
Modified: trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/api/core/management/HornetQServerControl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -13,8 +13,6 @@
package org.hornetq.api.core.management;
-import java.util.List;
-
import javax.management.MBeanOperationInfo;
import org.hornetq.api.core.HornetQException;
@@ -481,6 +479,8 @@
*/
@Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
String[] listConnectionIDs() throws Exception;
+
+ String listProducersInfoAsJSON() throws Exception;
/**
* Lists all the sessions IDs for the specified connection ID.
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -1258,7 +1258,25 @@
blockOnIO();
}
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.api.core.management.HornetQServerControl#listProducersInfoAsJSON()
+ */
+ public String listProducersInfoAsJSON() throws Exception
+ {
+ JSONArray producers = new JSONArray();
+
+
+ for (ServerSession session : server.getSessions())
+ {
+ session.describeProducersInfo(producers);
+ }
+
+ return producers.toString();
+ }
+
+
public Object[] getConnectors() throws Exception
{
checkStarted();
Modified: trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -813,6 +813,7 @@
JSONObject obj = new JSONObject();
obj.put("consumerID", serverConsumer.getID());
obj.put("connectionID", serverConsumer.getConnectionID().toString());
+ obj.put("sessionID", serverConsumer.getSessionID());
obj.put("browseOnly", serverConsumer.isBrowseOnly());
obj.put("creationTime", serverConsumer.getCreationTime());
Modified: trunk/src/main/org/hornetq/core/server/ServerConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -53,6 +53,8 @@
boolean isBrowseOnly();
long getCreationTime();
+
+ String getSessionID();
}
Modified: trunk/src/main/org/hornetq/core/server/ServerSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerSession.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/server/ServerSession.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -15,11 +15,15 @@
import java.util.List;
import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
import javax.transaction.xa.Xid;
+import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.message.impl.MessageInternal;
+import org.hornetq.utils.json.JSONArray;
/**
*
@@ -120,6 +124,14 @@
String getMetaData(String key);
String[] getTargetAddresses();
+
+ /**
+ * Add all the producers detail to the JSONArray object.
+ * This is a method to be used by the management layer.
+ * @param objs
+ * @throws Exception
+ */
+ void describeProducersInfo(JSONArray objs) throws Exception;
String getLastSentMessageID(String address);
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -206,6 +206,11 @@
{
return this.session.getConnectionID().toString();
}
+
+ public String getSessionID()
+ {
+ return this.session.getName();
+ }
public HandleStatus handle(final MessageReference ref) throws Exception
{
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -24,12 +24,14 @@
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
import javax.transaction.xa.XAException;
import javax.transaction.xa.Xid;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Message;
+import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.management.ManagementHelper;
import org.hornetq.core.client.impl.ClientMessageImpl;
@@ -69,6 +71,8 @@
import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.utils.TypedProperties;
import org.hornetq.utils.UUID;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
/*
* Session implementation
@@ -144,7 +148,7 @@
private Map<String, String> metaData;
// Session's usage should be by definition single threaded, hence it's not needed to use a concurrentHashMap here
- private Map<SimpleString, UUID> targetAddressInfos = new HashMap<SimpleString, UUID>();
+ private Map<SimpleString, Pair<UUID, AtomicLong>> targetAddressInfos = new HashMap<SimpleString, Pair<UUID, AtomicLong>>();
private long creationTime = System.currentTimeMillis();
@@ -1072,7 +1076,80 @@
consumer.setTransferring(transferring);
}
}
+
+ public void addMetaData(String key, String data)
+ {
+ if (metaData == null)
+ {
+ metaData = new HashMap<String, String>();
+ }
+ metaData.put(key, data);
+ }
+
+ public String getMetaData(String key)
+ {
+ String data = null;
+ if (metaData != null)
+ {
+ data = metaData.get(key);
+ }
+ return data;
+ }
+
+ public String[] getTargetAddresses()
+ {
+ Map<SimpleString, Pair<UUID, AtomicLong>> copy = cloneTargetAddresses();
+ Iterator<SimpleString> iter = copy.keySet().iterator();
+ int num = copy.keySet().size();
+ String[] addresses = new String[num];
+ int i = 0;
+ while (iter.hasNext())
+ {
+ addresses[i] = iter.next().toString();
+ i++;
+ }
+ return addresses;
+ }
+
+ public String getLastSentMessageID(String address)
+ {
+ Pair<UUID, AtomicLong> value = targetAddressInfos.get(SimpleString.toSimpleString(address));
+ if (value != null)
+ {
+ return value.a.toString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public long getCreationTime()
+ {
+ return this.creationTime;
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.core.server.ServerSession#getProducersInfoJSON()
+ */
+ public void describeProducersInfo(JSONArray array) throws Exception
+ {
+ Map<SimpleString, Pair<UUID, AtomicLong>> targetCopy = cloneTargetAddresses();
+
+ for (Map.Entry<SimpleString, Pair<UUID, AtomicLong>> entry : targetCopy.entrySet())
+ {
+ JSONObject producerInfo = new JSONObject();
+ producerInfo.put("connectionID", this.getConnectionID().toString());
+ producerInfo.put("sessionID", this.getName());
+ producerInfo.put("destination", entry.getKey().toString());
+ producerInfo.put("lastUUIDSent", entry.getValue().a);
+ producerInfo.put("msgSent", entry.getValue().b.longValue());
+ array.put(producerInfo);
+ }
+ }
+
+
// FailureListener implementation
// --------------------------------------------------------------------
@@ -1099,6 +1176,11 @@
// Private
// ----------------------------------------------------------------------------
+ private Map<SimpleString, Pair<UUID, AtomicLong>> cloneTargetAddresses()
+ {
+ return new HashMap<SimpleString, Pair<UUID, AtomicLong>>(targetAddressInfos);
+ }
+
private void setStarted(final boolean s)
{
Set<ServerConsumer> consumersClone = new HashSet<ServerConsumer>(consumers.values());
@@ -1196,57 +1278,18 @@
postOffice.route(msg, routingContext, direct);
- targetAddressInfos.put(msg.getAddress(), msg.getUserID());
-
- routingContext.clear();
- }
-
- public void addMetaData(String key, String data)
- {
- if (metaData == null)
+ Pair<UUID, AtomicLong> value = targetAddressInfos.get(msg.getAddress());
+
+ if (value == null)
{
- metaData = new HashMap<String, String>();
+ targetAddressInfos.put(msg.getAddress(), new Pair<UUID,AtomicLong>(msg.getUserID(), new AtomicLong(1)));
}
- metaData.put(key, data);
- }
-
- public String getMetaData(String key)
- {
- String data = null;
- if (metaData != null)
+ else
{
- data = metaData.get(key);
+ value.a = msg.getUserID();
+ value.b.incrementAndGet();
}
- return data;
- }
-
- public String[] getTargetAddresses()
- {
- Map<SimpleString, UUID> copy = new HashMap<SimpleString, UUID>(targetAddressInfos);
- Iterator<SimpleString> iter = copy.keySet().iterator();
- int num = copy.keySet().size();
- String[] addresses = new String[num];
- int i = 0;
- while (iter.hasNext())
- {
- addresses[i] = iter.next().toString();
- i++;
- }
- return addresses;
- }
- public String getLastSentMessageID(String address)
- {
- UUID id = targetAddressInfos.get(SimpleString.toSimpleString(address));
- if (id != null)
- {
- return id.toString();
- }
- return null;
+ routingContext.clear();
}
-
- public long getCreationTime()
- {
- return this.creationTime;
- }
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -851,6 +851,7 @@
JSONObject obj = new JSONObject();
obj.put("consumerID", consumer.getID());
obj.put("connectionID", consumer.getConnectionID());
+ obj.put("sessionID", consumer.getSessionID());
obj.put("queueName", consumer.getQueue().getName().toString());
obj.put("browseOnly", consumer.isBrowseOnly());
obj.put("creationTime", consumer.getCreationTime());
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -13,9 +13,7 @@
package org.hornetq.tests.integration.management;
-import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import javax.transaction.xa.XAResource;
@@ -37,7 +35,6 @@
import org.hornetq.api.core.management.DivertControl;
import org.hornetq.api.core.management.HornetQServerControl;
import org.hornetq.api.core.management.ObjectNameBuilder;
-import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.core.management.RoleInfo;
import org.hornetq.core.asyncio.impl.AsynchronousFileImpl;
@@ -712,10 +709,16 @@
clientSession.end(xid, XAResource.TMSUCCESS);
clientSession.prepare(xid);
+ HornetQServerControl serverControl = createManagementControl();
+
+ JSONArray jsonArray = new JSONArray(serverControl.listProducersInfoAsJSON());
+
+ assertEquals(1, jsonArray.length());
+ assertEquals(4, ((JSONObject)jsonArray.get(0)).getInt("msgSent"));
+
clientSession.close();
locator.close();
- HornetQServerControl serverControl = createManagementControl();
String txDetails = serverControl.listPreparedTransactionDetailsAsJSON();
Assert.assertTrue(txDetails.matches(".*m1.*"));
Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-12-27 18:42:39 UTC (rev 10074)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlUsingCoreTest.java 2010-12-27 21:03:03 UTC (rev 10075)
@@ -13,8 +13,6 @@
package org.hornetq.tests.integration.management;
-import java.util.List;
-
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
@@ -618,38 +616,10 @@
password);
}
- public void createBridge(String name,
- String queueName,
- String forwardingAddress,
- String filterString,
- String transformerClassName,
- long retryInterval,
- double retryIntervalMultiplier,
- int reconnectAttempts,
- boolean useDuplicateDetection,
- int confirmationWindowSize,
- long clientFailureCheckPeriod,
- String discoveryGroupName,
- boolean ha,
- String user,
- String password) throws Exception
+
+ public String listProducersInfoAsJSON() throws Exception
{
- proxy.invokeOperation("createBridge",
- name,
- queueName,
- forwardingAddress,
- filterString,
- transformerClassName,
- retryInterval,
- retryIntervalMultiplier,
- reconnectAttempts,
- useDuplicateDetection,
- confirmationWindowSize,
- clientFailureCheckPeriod,
- discoveryGroupName,
- ha,
- user,
- password);
+ return (String)proxy.invokeOperation("listProducersInfoAsJSON");
}
};
}
13 years, 12 months
JBoss hornetq SVN: r10074 - in trunk: src/main/org/hornetq/jms/management/impl and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 13:42:39 -0500 (Mon, 27 Dec 2010)
New Revision: 10074
Modified:
trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.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
Log:
HORNETQ-587 - adding listConsumersAsJSON on JMSQueueControl
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-12-27 18:30:58 UTC (rev 10073)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-12-27 18:42:39 UTC (rev 10074)
@@ -71,7 +71,7 @@
*/
@Operation(desc = "Returns the list of JNDI bindings associated")
String[] getJNDIBindings();
-
+
/**
* Add the JNDI binding to this destination
*/
@@ -212,7 +212,6 @@
@Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
void resetMessageCounter() throws Exception;
-
/**
* Lists the message counter for this queue as a HTML table.
*/
@@ -249,4 +248,7 @@
@Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
void resume() throws Exception;
+ @Operation(desc = "List all the existent consumers on the Queue")
+ String listConsumersAsJSON() throws Exception;
+
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-27 18:30:58 UTC (rev 10073)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java 2010-12-27 18:42:39 UTC (rev 10074)
@@ -21,6 +21,7 @@
import org.hornetq.api.core.FilterConstants;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.management.MessageCounterInfo;
+import org.hornetq.api.core.management.Operation;
import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.core.logging.Logger;
@@ -49,7 +50,7 @@
// Attributes ----------------------------------------------------
private final HornetQDestination managedQueue;
-
+
private final JMSServerManager jmsServerManager;
private final QueueControl coreQueueControl;
@@ -172,13 +173,12 @@
{
jmsServerManager.addQueueToJndi(managedQueue.getName(), jndi);
}
-
+
public String[] getJNDIBindings()
{
return jmsServerManager.getJNDIOnQueue(managedQueue.getName());
}
-
public boolean removeMessage(final String messageID) throws Exception
{
String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
@@ -302,6 +302,12 @@
return coreQueueControl.moveMessages(filter, otherQueue.getAddress());
}
+ @Operation(desc = "List all the existent consumers on the Queue")
+ public String listConsumersAsJSON() throws Exception
+ {
+ return coreQueueControl.listConsumersAsJSON();
+ }
+
public String listMessageCounter()
{
try
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 2010-12-27 18:30:58 UTC (rev 10073)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java 2010-12-27 18:42:39 UTC (rev 10074)
@@ -98,6 +98,10 @@
MessageConsumer consumer = JMSUtil.createConsumer(connection, queue);
Assert.assertEquals(1, queueControl.getConsumerCount());
+
+ JSONArray jsonArray = new JSONArray(queueControl.listConsumersAsJSON());
+
+ assertEquals(1, jsonArray.length());
JMSUtil.sendMessages(queue, 2);
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 2010-12-27 18:30:58 UTC (rev 10073)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2010-12-27 18:42:39 UTC (rev 10074)
@@ -13,7 +13,6 @@
package org.hornetq.tests.integration.jms.server.management;
-import java.util.List;
import java.util.Map;
import javax.jms.QueueConnection;
@@ -27,7 +26,6 @@
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.HornetQQueue;
/**
@@ -285,6 +283,11 @@
// TODO: Add a test for this
return null;
}
+
+ public String listConsumersAsJSON() throws Exception
+ {
+ return (String)proxy.invokeOperation("listConsumersAsJSON");
+ }
};
}
13 years, 12 months
JBoss hornetq SVN: r10073 - in trunk: src/main/org/hornetq/jms/management/impl and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 13:30:58 -0500 (Mon, 27 Dec 2010)
New Revision: 10073
Modified:
trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.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
Log:
HORNETQ-587 - adding listAllConsumersAsJSON method
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-12-27 17:51:48 UTC (rev 10072)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-12-27 18:30:58 UTC (rev 10073)
@@ -214,6 +214,15 @@
String listConsumersAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
/**
+ * Lists all the consumers
+ * The returned String is a JSON string containing an array of JMSConsumerInfo objects.
+ *
+ * @see JMSConsumerInfo#from(String)
+ */
+ @Operation(desc = "List all JMS consumers associated to a JMS Connection")
+ String listAllConsumersAsJSON() throws Exception;
+
+ /**
* Lists all addresses to which the designated server session has sent messages.
*/
@Operation(desc = "Lists all addresses to which the designated session has sent messages", impact = MBeanOperationInfo.INFO)
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 17:51:48 UTC (rev 10072)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-12-27 18:30:58 UTC (rev 10073)
@@ -170,17 +170,17 @@
try
{
- if(useDiscovery)
+ if (useDiscovery)
{
- if(connectorNames == null || connectorNames.length == 0)
+ if (connectorNames == null || connectorNames.length == 0)
{
throw new IllegalArgumentException("no discovery group name supplied");
}
server.createConnectionFactory(name,
- ha,
- JMSFactoryType.valueOf(cfType),
- connectorNames[0],
- JMSServerControlImpl.convert(bindings));
+ ha,
+ JMSFactoryType.valueOf(cfType),
+ connectorNames[0],
+ JMSServerControlImpl.convert(bindings));
}
else
{
@@ -192,13 +192,12 @@
}
server.createConnectionFactory(name,
- ha,
- JMSFactoryType.valueOf(cfType),
- connectorList,
- JMSServerControlImpl.convert(bindings));
+ ha,
+ JMSFactoryType.valueOf(cfType),
+ connectorList,
+ JMSServerControlImpl.convert(bindings));
}
-
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
finally
@@ -213,7 +212,12 @@
* The ConnectionFactory is bound to JNDI for all the specified bindings Strings.
*
*/
- public void createConnectionFactory(String name, boolean ha, boolean useDiscovery, int cfType, String connectors, String jndiBindings) throws Exception
+ public void createConnectionFactory(String name,
+ boolean ha,
+ boolean useDiscovery,
+ int cfType,
+ String connectors,
+ String jndiBindings) throws Exception
{
createConnectionFactory(name, ha, useDiscovery, cfType, toArray(connectors), toArray(jndiBindings));
}
@@ -584,44 +588,11 @@
Set<ServerConsumer> consumers = session.getServerConsumers();
for (ServerConsumer consumer : consumers)
{
- JSONObject obj = new JSONObject();
- obj.put("consumerID", consumer.getID());
- obj.put("connectionID", connectionID);
- obj.put("queueName", consumer.getQueue().getName().toString());
- obj.put("browseOnly", consumer.isBrowseOnly());
- obj.put("creationTime", consumer.getCreationTime());
- // JMS consumer with message filter use the queue's filter
- Filter queueFilter = consumer.getQueue().getFilter();
- if (queueFilter != null)
+ JSONObject obj = toJSONObject(consumer);
+ if (obj != null)
{
- obj.put("filter", queueFilter.getFilterString().toString());
+ array.put(obj);
}
- String[] destinationInfo = determineJMSDestination(consumer.getQueue().getAddress().toString());
- if (destinationInfo == null)
- {
- continue;
- }
- obj.put("destinationName", destinationInfo[0]);
- obj.put("destinationType", destinationInfo[1]);
- if (destinationInfo[1].equals("topic"))
- {
- try
- {
- HornetQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue()
- .getName()
- .toString());
- obj.put("durable", true);
- }
- catch (IllegalArgumentException e)
- {
- obj.put("durable", false);
- }
- }
- else
- {
- obj.put("durable", false);
- }
- array.put(obj);
}
}
}
@@ -634,6 +605,37 @@
}
}
+ public String listAllConsumersAsJSON() throws Exception
+ {
+ checkStarted();
+
+ clearIO();
+
+ try
+ {
+ JSONArray array = new JSONArray();
+
+ Set<ServerSession> sessions = server.getHornetQServer().getSessions();
+ for (ServerSession session : sessions)
+ {
+ Set<ServerConsumer> consumers = session.getServerConsumers();
+ for (ServerConsumer consumer : consumers)
+ {
+ JSONObject obj = toJSONObject(consumer);
+ if (obj != null)
+ {
+ array.put(obj);
+ }
+ }
+ }
+ return array.toString();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
public String[] listSessions(final String connectionID) throws Exception
{
checkStarted();
@@ -844,4 +846,45 @@
return array.toString();
}
+ private JSONObject toJSONObject(ServerConsumer consumer) throws Exception
+ {
+ JSONObject obj = new JSONObject();
+ obj.put("consumerID", consumer.getID());
+ obj.put("connectionID", consumer.getConnectionID());
+ obj.put("queueName", consumer.getQueue().getName().toString());
+ obj.put("browseOnly", consumer.isBrowseOnly());
+ obj.put("creationTime", consumer.getCreationTime());
+ // JMS consumer with message filter use the queue's filter
+ Filter queueFilter = consumer.getQueue().getFilter();
+ if (queueFilter != null)
+ {
+ obj.put("filter", queueFilter.getFilterString().toString());
+ }
+ String[] destinationInfo = determineJMSDestination(consumer.getQueue().getAddress().toString());
+ if (destinationInfo == null)
+ {
+ return null;
+ }
+ obj.put("destinationName", destinationInfo[0]);
+ obj.put("destinationType", destinationInfo[1]);
+ if (destinationInfo[1].equals("topic"))
+ {
+ try
+ {
+ HornetQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue().getName().toString());
+ obj.put("durable", true);
+ }
+ catch (IllegalArgumentException e)
+ {
+ obj.put("durable", false);
+ }
+ }
+ else
+ {
+ obj.put("durable", false);
+ }
+
+ return obj;
+ }
+
}
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 2010-12-27 17:51:48 UTC (rev 10072)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-12-27 18:30:58 UTC (rev 10073)
@@ -23,6 +23,7 @@
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
import javax.jms.Destination;
+import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
@@ -65,6 +66,7 @@
import org.hornetq.tests.unit.util.InVMContext;
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
+import org.hornetq.utils.json.JSONArray;
/**
* A JMSServerControlTest
@@ -387,6 +389,56 @@
Assert.assertNull(fakeJMSStorageManager.destinationMap.get(topicName));
}
+
+ public void testListAllConsumers() throws Exception
+ {
+ String topicJNDIBinding = RandomUtil.randomString();
+ String topicName = RandomUtil.randomString();
+
+ UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+ checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
+
+ JMSServerControl control = createManagementControl();
+ control.createTopic(topicName, topicJNDIBinding);
+
+ checkResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
+ Topic topic = (Topic)context.lookup(topicJNDIBinding);
+ assertNotNull(topic);
+ HornetQConnectionFactory cf = new HornetQConnectionFactory(false,
+ new TransportConfiguration(InVMConnectorFactory.class.getName()));
+ Connection connection = cf.createConnection();
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ // create a consumer will create a Core queue bound to the topic address
+ MessageConsumer cons = session.createConsumer(topic);
+
+ System.out.println("jsonString:" + control.listAllConsumersAsJSON());
+ JSONArray jsonArray = new JSONArray(control.listAllConsumersAsJSON());
+
+ assertEquals(1, jsonArray.length());
+
+ cons.close();
+
+ jsonArray = new JSONArray(control.listAllConsumersAsJSON());
+
+ assertEquals(0, jsonArray.length());
+
+ String topicAddress = HornetQDestination.createTopicAddressFromName(topicName).toString();
+ AddressControl addressControl = (AddressControl)server.getManagementService()
+ .getResource(ResourceNames.CORE_ADDRESS + topicAddress);
+ assertNotNull(addressControl);
+
+ assertTrue(addressControl.getQueueNames().length > 0);
+
+ connection.close();
+ control.destroyTopic(topicName);
+
+ assertNull(server.getManagementService().getResource(ResourceNames.CORE_ADDRESS + topicAddress));
+ UnitTestCase.checkNoBinding(context, topicJNDIBinding);
+ checkNoResource(ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(topicName));
+
+ Assert.assertNull(fakeJMSStorageManager.destinationMap.get(topicName));
+ }
+
public void testGetTopicNames() throws Exception
{
String topicJNDIBinding = RandomUtil.randomString();
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 2010-12-27 17:51:48 UTC (rev 10072)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-12-27 18:30:58 UTC (rev 10073)
@@ -261,7 +261,12 @@
proxy.invokeOperation("createConnectionFactory", name, ha, useDiscovery, cfType, connectors, jndiBindings);
}
+ public String listAllConsumersAsJSON() throws Exception
+ {
+ return (String)proxy.invokeOperation("listAllConsumersAsJSON");
+ }
+
};
}
// Public --------------------------------------------------------
13 years, 12 months
JBoss hornetq SVN: r10072 - in trunk: src/main/org/hornetq/core/management/impl and 5 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-12-27 12:51:48 -0500 (Mon, 27 Dec 2010)
New Revision: 10072
Modified:
trunk/src/main/org/hornetq/api/core/management/QueueControl.java
trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
trunk/src/main/org/hornetq/core/server/ServerConsumer.java
trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
trunk/tests/src/org/hornetq/tests/integration/management/QueueControlUsingCoreTest.java
Log:
HORNETQ-586 - adding consumer information on listSubscriptions
Modified: trunk/src/main/org/hornetq/api/core/management/QueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/management/QueueControl.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/src/main/org/hornetq/api/core/management/QueueControl.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -281,6 +281,9 @@
*/
@Operation(desc = "Resumes delivery of queued messages and gets the queue out of paused state.", impact = MBeanOperationInfo.ACTION)
void resume() throws Exception;
+
+ @Operation(desc = "List all the existent consumers on the Queue")
+ String listConsumersAsJSON() throws Exception;
/**
* Returns whether the queue is paused.
Modified: trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/src/main/org/hornetq/core/management/impl/QueueControlImpl.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -14,6 +14,7 @@
package org.hornetq.core.management.impl;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -33,8 +34,10 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.PostOffice;
+import org.hornetq.core.server.Consumer;
import org.hornetq.core.server.MessageReference;
import org.hornetq.core.server.Queue;
+import org.hornetq.core.server.ServerConsumer;
import org.hornetq.core.settings.HierarchicalRepository;
import org.hornetq.core.settings.impl.AddressSettings;
import org.hornetq.utils.json.JSONArray;
@@ -328,7 +331,7 @@
public void setExpiryAddress(final String expiryAddress) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -352,7 +355,7 @@
public Map<String, Object>[] listScheduledMessages() throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -375,7 +378,7 @@
public String listScheduledMessagesAsJSON() throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -390,12 +393,12 @@
public Map<String, Object>[] listMessages(final String filterStr) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
Filter filter = FilterImpl.createFilter(filterStr);
- List<Map<String, Object>> messages = new ArrayList<Map<String,Object>>();
+ List<Map<String, Object>> messages = new ArrayList<Map<String, Object>>();
queue.blockOnExecutorFuture();
Iterator<MessageReference> iterator = queue.iterator();
while (iterator.hasNext())
@@ -422,7 +425,7 @@
public String listMessagesAsJSON(final String filter) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -437,7 +440,7 @@
public long countMessages(final String filterStr) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -455,7 +458,7 @@
MessageReference ref = (MessageReference)iterator.next();
if (filter.match(ref.getMessage()))
{
- count ++;
+ count++;
}
}
return count;
@@ -470,7 +473,7 @@
public boolean removeMessage(final long messageID) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -521,7 +524,7 @@
public int expireMessages(final String filterStr) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -541,7 +544,7 @@
public boolean moveMessage(final long messageID, final String otherQueueName) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -645,7 +648,7 @@
public boolean changeMessagePriority(final long messageID, final int newPriority) throws Exception
{
checkStarted();
-
+
clearIO();
try
{
@@ -665,7 +668,7 @@
public String listMessageCounter()
{
checkStarted();
-
+
clearIO();
try
{
@@ -684,7 +687,7 @@
public void resetMessageCounter()
{
checkStarted();
-
+
clearIO();
try
{
@@ -699,7 +702,7 @@
public String listMessageCounterAsHTML()
{
checkStarted();
-
+
clearIO();
try
{
@@ -786,13 +789,52 @@
}
}
+ /* (non-Javadoc)
+ * @see org.hornetq.api.core.management.QueueControl#listConsumersAsJSON()
+ */
+ public String listConsumersAsJSON() throws Exception
+ {
+ checkStarted();
+
+ clearIO();
+ try
+ {
+ Collection<Consumer> consumers = queue.getConsumers();
+
+ JSONArray jsonArray = new JSONArray();
+
+ for (Consumer consumer : consumers)
+ {
+
+ if (consumer instanceof ServerConsumer)
+ {
+ ServerConsumer serverConsumer = (ServerConsumer)consumer;
+
+ JSONObject obj = new JSONObject();
+ obj.put("consumerID", serverConsumer.getID());
+ obj.put("connectionID", serverConsumer.getConnectionID().toString());
+ obj.put("browseOnly", serverConsumer.isBrowseOnly());
+ obj.put("creationTime", serverConsumer.getCreationTime());
+
+ jsonArray.put(obj);
+ }
+
+ }
+
+ return jsonArray.toString();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
@Override
MBeanOperationInfo[] fillMBeanOperationInfo()
{
return MBeanInfoHelper.getMBeanOperationsInfo(QueueControl.class);
}
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -806,6 +848,6 @@
throw new IllegalStateException("HornetQ Server is not started. Queue can not be managed yet");
}
}
-
+
// Inner classes -------------------------------------------------
}
Modified: trunk/src/main/org/hornetq/core/server/ServerConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -27,6 +27,8 @@
public interface ServerConsumer extends Consumer
{
long getID();
+
+ Object getConnectionID();
void close(boolean failed) throws Exception;
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -201,6 +201,11 @@
{
return creationTime;
}
+
+ public String getConnectionID()
+ {
+ return this.session.getConnectionID().toString();
+ }
public HandleStatus handle(final MessageReference ref) throws Exception
{
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -57,7 +57,7 @@
private final AddressControl addressControl;
private final ManagementService managementService;
-
+
private final JMSServerManager jmsServerManager;
// Static --------------------------------------------------------
@@ -83,7 +83,7 @@
}
// TopicControlMBean implementation ------------------------------
-
+
/* (non-Javadoc)
* @see org.hornetq.api.jms.management.JMSQueueControl#addJNDI(java.lang.String)
*/
@@ -91,13 +91,12 @@
{
jmsServerManager.addTopicToJndi(managedTopic.getName(), jndi);
}
-
+
public String[] getJNDIBindings()
{
- return jmsServerManager.getJNDIOnTopic(managedTopic.getName());
+ return jmsServerManager.getJNDIOnTopic(managedTopic.getName());
}
-
public String getName()
{
return managedTopic.getName();
@@ -128,7 +127,7 @@
}
return count;
}
-
+
public long getMessagesAdded()
{
List<QueueControl> queues = getQueues(DurabilityType.ALL);
@@ -139,7 +138,7 @@
}
return count;
}
-
+
public int getDurableMessageCount()
{
return getMessageCount(DurabilityType.DURABLE);
@@ -291,7 +290,7 @@
if (queue.isDurable())
{
Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
- .toString());
+ .toString());
clientID = pair.a;
subName = pair.b;
}
@@ -312,36 +311,46 @@
private String listSubscribersInfosAsJSON(final DurabilityType durability) throws Exception
{
- List<QueueControl> queues = getQueues(durability);
- JSONArray array = new JSONArray();
-
- for (QueueControl queue : queues)
+ try
{
- String clientID = null;
- String subName = null;
+ List<QueueControl> queues = getQueues(durability);
+ JSONArray array = new JSONArray();
- if (queue.isDurable())
+ for (QueueControl queue : queues)
{
- Pair<String, String> pair = HornetQDestination.decomposeQueueNameForDurableSubscription(queue.getName()
- .toString());
- clientID = pair.a;
- subName = pair.b;
+ String clientID = null;
+ String subName = null;
+
+ if (queue.isDurable())
+ {
+ Pair<String, String> pair = HornetQDestination.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());
+ info.put("deliveringCount", queue.getDeliveringCount());
+ info.put("consumers", new JSONArray(queue.listConsumersAsJSON()) );
+ array.put(info);
}
- 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());
- info.put("deliveringCount", queue.getDeliveringCount());
- array.put(info);
+ return array.toString();
}
-
- return array.toString();
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return e.toString();
+ }
}
private int getMessageCount(final DurabilityType durability)
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 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -13,8 +13,6 @@
package org.hornetq.tests.integration.jms.server.management;
-import static junit.framework.Assert.assertEquals;
-
import java.util.Map;
import javax.jms.Connection;
@@ -25,10 +23,7 @@
import junit.framework.Assert;
-import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientProducer;
-import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.SubscriptionInfo;
import org.hornetq.api.jms.management.TopicControl;
@@ -145,16 +140,22 @@
{
// 1 non-durable subscriber, 2 durable subscribers
Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
- JMSUtil.createConsumer(connection_1, topic);
+ MessageConsumer cons = JMSUtil.createConsumer(connection_1, topic);
Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
- JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
+ TopicSubscriber subs1 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
- JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
+ TopicSubscriber subs2 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
TopicControl topicControl = createManagementControl();
Assert.assertEquals(3, topicControl.listAllSubscriptions().length);
Assert.assertEquals(1, topicControl.listNonDurableSubscriptions().length);
Assert.assertEquals(2, topicControl.listDurableSubscriptions().length);
+
+ String json = topicControl.listAllSubscriptionsAsJSON();
+ System.out.println("Json: " + json);
+ JSONArray jsonArray = new JSONArray(json);
+
+ assertEquals(3, jsonArray.length());
connection_1.close();
connection_2.close();
Modified: trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/tests/src/org/hornetq/tests/integration/management/QueueControlTest.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -36,6 +36,7 @@
import org.hornetq.tests.util.RandomUtil;
import org.hornetq.tests.util.UnitTestCase;
import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
/**
* A QueueControlTest
@@ -53,6 +54,7 @@
protected HornetQServer server;
protected ClientSession session;
+
private ServerLocator locator;
// Static --------------------------------------------------------
@@ -196,6 +198,37 @@
session.deleteQueue(queue);
}
+ public void testGetConsumerJSON() throws Exception
+ {
+ SimpleString address = RandomUtil.randomSimpleString();
+ SimpleString queue = RandomUtil.randomSimpleString();
+
+ session.createQueue(address, queue, null, false);
+
+ QueueControl queueControl = createManagementControl(address, queue);
+
+ Assert.assertEquals(0, queueControl.getConsumerCount());
+
+ ClientConsumer consumer = session.createConsumer(queue);
+ Assert.assertEquals(1, queueControl.getConsumerCount());
+
+
+ System.out.println("Consumers: " + queueControl.listConsumersAsJSON());
+
+ JSONArray obj = new JSONArray(queueControl.listConsumersAsJSON());
+
+ assertEquals(1, obj.length());
+
+ consumer.close();
+ Assert.assertEquals(0, queueControl.getConsumerCount());
+
+ obj = new JSONArray(queueControl.listConsumersAsJSON());
+
+ assertEquals(0, obj.length());
+
+ session.deleteQueue(queue);
+ }
+
public void testGetMessageCount() throws Exception
{
SimpleString address = RandomUtil.randomSimpleString();
@@ -374,7 +407,7 @@
ClientMessage message = session.createMessage(false);
message.putIntProperty(new SimpleString("key"), intValue);
producer.send(message);
-
+
String jsonString = queueControl.listMessagesAsJSON(null);
Assert.assertNotNull(jsonString);
JSONArray array = new JSONArray(jsonString);
Modified: trunk/tests/src/org/hornetq/tests/integration/management/QueueControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/QueueControlUsingCoreTest.java 2010-12-23 02:11:49 UTC (rev 10071)
+++ trunk/tests/src/org/hornetq/tests/integration/management/QueueControlUsingCoreTest.java 2010-12-27 17:51:48 UTC (rev 10072)
@@ -261,6 +261,11 @@
return (Boolean)proxy.invokeOperation("isPaused");
}
+ public String listConsumersAsJSON() throws Exception
+ {
+ return (String)proxy.invokeOperation("listConsumersAsJSON");
+ }
+
};
}
13 years, 12 months