JBoss hornetq SVN: r8895 - in trunk: tests/src/org/hornetq/tests/integration/stomp and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-02-23 08:55:56 -0500 (Tue, 23 Feb 2010)
New Revision: 8895
Modified:
trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java
trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* skip empty lines at the start of the frame decoding
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java 2010-02-22 14:50:36 UTC (rev 8894)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java 2010-02-23 13:55:56 UTC (rev 8895)
@@ -42,16 +42,21 @@
{
try
{
- String command = StompFrameDecoder.readLine(buffer, StompFrameDecoder.MAX_COMMAND_LENGTH, "The maximum command length was exceeded");
- if (command == null)
- {
- return null;
+ String command = null;
+
+ // skip white space to next real action line
+ while (true) {
+ command = StompFrameDecoder.readLine(buffer, StompFrameDecoder.MAX_COMMAND_LENGTH, "The maximum command length was exceeded");
+ if (command == null) {
+ return null;
+ }
+ else {
+ command = command.trim();
+ if (command.length() > 0) {
+ break;
+ }
+ }
}
- command = command.trim();
- if (command.length() == 0)
- {
- return null;
- }
// Parse the headers
HashMap<String, Object> headers = new HashMap<String, Object>(25);
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-22 14:50:36 UTC (rev 8894)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-23 13:55:56 UTC (rev 8895)
@@ -171,7 +171,7 @@
Assert.assertTrue(frame.startsWith("CONNECTED"));
frame =
- "SEND\n" +
+ "\nSEND\n" +
"destination:" + getQueuePrefix() + getQueueName() + "\n\n" +
"Hello World" +
Stomp.NULL;
15 years
JBoss hornetq SVN: r8894 - in trunk: tests/src/org/hornetq/tests/integration/stomp and 1 other directory.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-02-22 09:50:36 -0500 (Mon, 22 Feb 2010)
New Revision: 8894
Modified:
trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java
trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2010-02-22 11:16:15 UTC (rev 8893)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2010-02-22 14:50:36 UTC (rev 8894)
@@ -65,7 +65,8 @@
private final Map<String, StompSession> transactedSessions = new HashMap<String, StompSession>();
- private final Map<RemotingConnection, StompSession> sessions = new HashMap<RemotingConnection, StompSession>();
+ // key => connection ID, value => Stomp session
+ private final Map<Object, StompSession> sessions = new HashMap<Object, StompSession>();
// Static --------------------------------------------------------
@@ -140,20 +141,14 @@
public void handleBuffer(final RemotingConnection connection, final HornetQBuffer buffer)
{
- executor.execute(new Runnable()
+ try
{
- public void run()
- {
- try
- {
- doHandleBuffer(connection, buffer);
- }
- finally
- {
- server.getStorageManager().clearContext();
- }
- }
- });
+ doHandleBuffer(connection, buffer);
+ }
+ finally
+ {
+ server.getStorageManager().clearContext();
+ }
}
private void doHandleBuffer(final RemotingConnection connection, final HornetQBuffer buffer)
@@ -424,7 +419,7 @@
private StompSession getSession(StompConnection connection) throws Exception
{
- StompSession stompSession = sessions.get(connection);
+ StompSession stompSession = sessions.get(connection.getID());
if (stompSession == null)
{
stompSession = new StompSession(connection, this, server.getStorageManager().newContext(executor));
@@ -440,7 +435,7 @@
false,
stompSession);
stompSession.setServerSession(session);
- sessions.put(connection, stompSession);
+ sessions.put(connection.getID(), stompSession);
}
server.getStorageManager().setContext(stompSession.getContext());
return stompSession;
@@ -557,7 +552,7 @@
connection.setValid(false);
try {
- StompSession session = sessions.remove(connection);
+ StompSession session = sessions.remove(connection.getID());
if (session != null)
{
try
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2010-02-22 11:16:15 UTC (rev 8893)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2010-02-22 14:50:36 UTC (rev 8894)
@@ -19,6 +19,7 @@
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.api.core.SimpleString;
+import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.impl.MessageImpl;
import org.hornetq.core.persistence.OperationContext;
import org.hornetq.core.protocol.stomp.Stomp.Headers;
@@ -37,6 +38,8 @@
*/
class StompSession implements SessionCallback
{
+ private static final Logger log = Logger.getLogger(StompSession.class);
+
private final StompProtocolManager manager;
private final StompConnection connection;
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java 2010-02-22 11:16:15 UTC (rev 8893)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java 2010-02-22 14:50:36 UTC (rev 8894)
@@ -52,6 +52,12 @@
return subID;
}
+ @Override
+ public String toString()
+ {
+ return "StompSubscription[id=" + subID + ", ack=" + ack + "]";
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-22 11:16:15 UTC (rev 8893)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-22 14:50:36 UTC (rev 8894)
@@ -1433,8 +1433,7 @@
frame =
"UNSUBSCRIBE\n" +
- "destination:" + getQueuePrefix() + getQueueName() + "\n" +
- "\n\n" +
+ "destination:" + getQueuePrefix() + getQueueName() + "\n\n" +
Stomp.NULL;
sendFrame(frame);
15 years
JBoss hornetq SVN: r8893 - trunk/tests/src/org/hornetq/tests/stress/stomp.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-02-22 06:16:15 -0500 (Mon, 22 Feb 2010)
New Revision: 8893
Modified:
trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* stress test for Stomp protocol
Modified: trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java 2010-02-22 10:16:42 UTC (rev 8892)
+++ trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java 2010-02-22 11:16:15 UTC (rev 8893)
@@ -40,7 +40,7 @@
{
private static final transient Logger log = Logger.getLogger(StompStressTest.class);
- private static final int COUNT = 100;
+ private static final int COUNT = 1000;
private int port = 61613;
@@ -60,22 +60,24 @@
frame = receiveFrame(10000);
Assert.assertTrue(frame.startsWith("CONNECTED"));
- frame = "SEND\n" + "destination:" + destination + "\n\n";
+ frame = "SUBSCRIBE\n" + "destination:" + destination + "\n" + "ack:auto\n\n" + Stomp.NULL;
+ sendFrame(frame);
+ frame = "SEND\n" + "destination:" + destination + "\n";
+
for (int i = 0; i < COUNT; i++)
{
- sendFrame(frame + "count=" + i + Stomp.NULL);
+ System.out.println(">>> " + i);
+ sendFrame(frame + "count:" + i + "\n\n" + Stomp.NULL);
}
- frame = "SUBSCRIBE\n" + "destination:" + destination + "\n" + "ack:auto\n\n" + Stomp.NULL;
- sendFrame(frame);
-
for (int i = 0; i < COUNT; i++)
{
+ System.out.println("<<< " + i);
frame = receiveFrame(10000);
Assert.assertTrue(frame.startsWith("MESSAGE"));
Assert.assertTrue(frame.indexOf("destination:") > 0);
- Assert.assertTrue(frame.indexOf("count=" + i) > 0);
+ Assert.assertTrue(frame.indexOf("count:" + i) > 0);
}
frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
15 years
JBoss hornetq SVN: r8892 - in trunk: src/main/org/hornetq/core/protocol/stomp and 4 other directories.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-02-22 05:16:42 -0500 (Mon, 22 Feb 2010)
New Revision: 8892
Added:
trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java
trunk/tests/src/org/hornetq/tests/stress/stomp/
trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
Removed:
trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDelimiter.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameError.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompMarshaller.java
Modified:
trunk/docs/user-manual/en/interoperability.xml
trunk/src/main/org/hornetq/core/protocol/stomp/Stomp.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompFrame.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java
trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
Log:
https://jira.jboss.org/jira/browse/HORNETQ-129: Implement STOMP v1.0
* refactoring to handle correctly frame body with null bytes
Modified: trunk/docs/user-manual/en/interoperability.xml
===================================================================
--- trunk/docs/user-manual/en/interoperability.xml 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/docs/user-manual/en/interoperability.xml 2010-02-22 10:16:42 UTC (rev 8892)
@@ -72,11 +72,14 @@
to an address.
When a Stomp client subscribes (or unsubscribes) for a destination (using a <literal>SUBSCRIBE</literal>
or <literal>UNSUBSCRIBE</literal> frame), the destination is mapped to a HornetQ queue.</para>
- <section>
- <title>Using JMS destinations</title>
- <para>As explained in <xref linkend="jms-core-mapping" />, JMS destinations are also mapped to HornetQ addresses and queues.
- If you want to use Stomp to send messages to JMS destinations, the Stomp destinations must follow the same convention:</para>
- <itemizedlist>
+ </section>
+ <section>
+ <title>Stomp and JMS interoperabilty</title>
+ <section>
+ <title>Using JMS destinations</title>
+ <para>As explained in <xref linkend="jms-core-mapping" />, JMS destinations are also mapped to HornetQ addresses and queues.
+ If you want to use Stomp to send messages to JMS destinations, the Stomp destinations must follow the same convention:</para>
+ <itemizedlist>
<listitem>
<para>send or subscribe to a JMS <emphasis>Queue</emphasis> by prepending the queue name by <literal>jms.queue.</literal>.</para>
<para>For example, to send a message to the <literal>orders</literal> JMS Queue, the Stomp client must send the frame:</para>
@@ -92,15 +95,34 @@
<para>send or subscribe to a JMS <emphasis>Topic</emphasis> by prepending the topic name by <literal>jms.topic.</literal>.</para>
<para>For example to subscribe to the <literal>stocks</literal> JMS Topic, the Stomp client must send the frame:</para>
<programlisting>
-SUBSCRIBE
-destination:jms.topic.stocks
-
-^@
+ SUBSCRIBE
+ destination:jms.topic.stocks
+
+ ^@
</programlisting>
</listitem>
</itemizedlist>
-
</section>
+
+ <section>
+ <title>Send and consuming Stomp message from JMS</title>
+ <para>Stomp messages can be sent and consumed from a JMS Destination by using <literal>BytesMessage</literal> where
+ the Stomp message body is stored in the JMS BytesMessage body.</para>
+ <para>If the Stomp message contained a UTF-8 String, the corresponding code to read the string from a JMS BytesMessage is:</para>
+ <programlisting>
+BytesMessage message = (BytesMessage)consumer.receive();
+byte[] data = new byte[1024];
+int size = message.readBytes(data);
+String text = new String(data, 0, size, "UTF-8");
+ </programlisting>
+ <para>Conversely, to send a JMS BytesMessage destined to be consumed by Stomp as a UTF-8 String, the code is:</para>
+ <programlisting>
+String text = ...
+BytesMessage message = session.createBytesMessage();
+message.writeBytes(text.getBytes("UTF-8"));
+producer.send(message);
+ </programlisting>
+ </section>
</section>
</section>
<section>
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/Stomp.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/Stomp.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/Stomp.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -68,7 +68,7 @@
public interface Headers
{
- String SEPERATOR = ":";
+ String SEPARATOR = ":";
String RECEIPT_REQUESTED = "receipt";
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompFrame.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompFrame.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompFrame.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -17,10 +17,11 @@
*/
package org.hornetq.core.protocol.stomp;
-import java.io.IOException;
-import java.util.HashMap;
import java.util.Map;
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.api.core.HornetQBuffers;
+
/**
* Represents all the data in a STOMP frame.
*
@@ -28,27 +29,29 @@
*/
class StompFrame
{
- private static final byte[] NO_DATA = new byte[] {};
+ public static final byte[] NO_DATA = new byte[] {};
+ private static final byte[] END_OF_FRAME = new byte[] { 0, '\n' };
- private String command;
+ private final String command;
+ private final Map<String, Object> headers;
+ private final byte[] content;
+
+ private HornetQBuffer buffer = null;
+ private int size;
- private Map<String, Object> headers;
-
- private byte[] content = StompFrame.NO_DATA;
-
- private int size = -1;
-
- public StompFrame()
- {
- this.headers = new HashMap<String, Object>();
- }
-
public StompFrame(String command, Map<String, Object> headers, byte[] data)
{
this.command = command;
this.headers = headers;
this.content = data;
}
+
+ public StompFrame(String command, Map<String, Object> headers)
+ {
+ this.command = command;
+ this.headers = headers;
+ this.content = NO_DATA;
+ }
public String getCommand()
{
@@ -65,22 +68,13 @@
return headers;
}
- public int getEncodedSize()
+ public int getEncodedSize() throws Exception
{
- if (size == -1)
+ if (buffer == null)
{
- StompMarshaller marshaller = new StompMarshaller();
- try
- {
- size = marshaller.marshal(this).length;
- }
- catch (IOException e)
- {
- return -1;
- }
+ buffer = toHornetQBuffer();
}
-
- return size ;
+ return size;
}
@Override
@@ -88,5 +82,33 @@
{
return "StompFrame[command=" + command + ", headers=" + headers + ", content-length=" + content.length + "]";
}
+
+ public HornetQBuffer toHornetQBuffer() throws Exception
+ {
+ if (buffer == null)
+ {
+ buffer = HornetQBuffers.dynamicBuffer(content.length + 512);
+ StringBuffer head = new StringBuffer();
+ head.append(command);
+ head.append(Stomp.NEWLINE);
+ // Output the headers.
+ for (Map.Entry<String, Object> header : headers.entrySet())
+ {
+ head.append(header.getKey());
+ head.append(Stomp.Headers.SEPARATOR);
+ head.append(header.getValue());
+ head.append(Stomp.NEWLINE);
+ }
+ // Add a newline to separate the headers from the content.
+ head.append(Stomp.NEWLINE);
+
+ buffer.writeBytes(head.toString().getBytes("UTF-8"));
+ buffer.writeBytes(content);
+ buffer.writeBytes(END_OF_FRAME);
+
+ size = buffer.writerIndex();
+ }
+ return buffer;
+ }
}
Copied: trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java (from rev 8887, trunk/src/main/org/hornetq/core/protocol/stomp/StompMarshaller.java)
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java (rev 0)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDecoder.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -0,0 +1,200 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.core.protocol.stomp;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.logging.Logger;
+
+/**
+ * Implements marshalling and unmarsalling the <a href="http://stomp.codehaus.org/">Stomp</a> protocol.
+ */
+class StompFrameDecoder
+{
+ private static final Logger log = Logger.getLogger(StompFrameDecoder.class);
+
+ private static final int MAX_COMMAND_LENGTH = 1024;
+
+ private static final int MAX_HEADER_LENGTH = 1024 * 10;
+
+ private static final int MAX_HEADERS = 1000;
+
+ private static final int MAX_DATA_LENGTH = 1024 * 1024 * 10;
+
+ public StompFrame decode(HornetQBuffer buffer)
+ {
+ try
+ {
+ String command = StompFrameDecoder.readLine(buffer, StompFrameDecoder.MAX_COMMAND_LENGTH, "The maximum command length was exceeded");
+ if (command == null)
+ {
+ return null;
+ }
+ command = command.trim();
+ if (command.length() == 0)
+ {
+ return null;
+ }
+
+ // Parse the headers
+ HashMap<String, Object> headers = new HashMap<String, Object>(25);
+ while (true)
+ {
+ String line = StompFrameDecoder.readLine(buffer, StompFrameDecoder.MAX_HEADER_LENGTH, "The maximum header length was exceeded");
+ if (line == null)
+ {
+ return null;
+ }
+
+ if (headers.size() > StompFrameDecoder.MAX_HEADERS)
+ {
+ throw new StompException("The maximum number of headers was exceeded", true);
+ }
+
+ if (line.trim().length() == 0)
+ {
+ break;
+ }
+
+ try
+ {
+ int seperator_index = line.indexOf(Stomp.Headers.SEPARATOR);
+ if (seperator_index == -1)
+ {
+ return null;
+ }
+ String name = line.substring(0, seperator_index).trim();
+ String value = line.substring(seperator_index + 1, line.length()).trim();
+ headers.put(name, value);
+ }
+ catch (Exception e)
+ {
+ throw new StompException("Unable to parse header line [" + line + "]", true);
+ }
+ }
+ // Read in the data part.
+ byte[] data = StompFrame.NO_DATA;
+ String contentLength = (String)headers.get(Stomp.Headers.CONTENT_LENGTH);
+ if (contentLength != null)
+ {
+
+ // Bless the client, he's telling us how much data to read in.
+ int length;
+ try
+ {
+ length = Integer.parseInt(contentLength.trim());
+ }
+ catch (NumberFormatException e)
+ {
+ throw new StompException("Specified content-length is not a valid integer", true);
+ }
+
+ if (length > StompFrameDecoder.MAX_DATA_LENGTH)
+ {
+ throw new StompException("The maximum data length was exceeded", true);
+ }
+
+ if (buffer.readableBytes() < length)
+ {
+ return null;
+ }
+
+ data = new byte[length];
+ buffer.readBytes(data);
+
+ if (buffer.readByte() != 0)
+ {
+ throw new StompException(Stomp.Headers.CONTENT_LENGTH + " bytes were read and " +
+ "there was no trailing null byte", true);
+ }
+ }
+ else
+ {
+ byte[] body = new byte[StompFrameDecoder.MAX_DATA_LENGTH];
+ boolean bodyCorrectlyEnded = false;
+ int count = 0;
+ while (buffer.readable())
+ {
+ byte b = buffer.readByte();
+
+ if (b == (byte)'\0')
+ {
+ bodyCorrectlyEnded = true;
+ break;
+ }
+ else
+ {
+ body[count++] = b;
+ }
+ }
+
+ if (!bodyCorrectlyEnded)
+ {
+ return null;
+ }
+
+ data = new byte[count];
+ System.arraycopy(body, 0, data, 0, count);
+ }
+
+ return new StompFrame(command, headers, data);
+ }
+ catch (IOException e)
+ {
+ log.error("Unable to decode stomp frame", e);
+ return null;
+ }
+ }
+
+ private static String readLine(HornetQBuffer in, int maxLength, String errorMessage) throws IOException
+ {
+ char[] chars = new char[MAX_HEADER_LENGTH];
+
+ if (!in.readable())
+ {
+ return null;
+ }
+
+ boolean properString = false;
+ int count = 0;
+ while (in.readable())
+ {
+ byte b = in.readByte();
+
+ if (b == (byte)'\n')
+ {
+ properString = true;
+ break;
+ }
+ else
+ {
+ chars[count++] = (char)b;
+ }
+ }
+ if (properString)
+ {
+ return new String(chars, 0, count);
+ }
+ else
+ {
+ return null;
+ }
+ }
+}
Deleted: trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDelimiter.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDelimiter.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameDelimiter.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -1,33 +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.core.protocol.stomp;
-
-import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
-import org.jboss.netty.handler.codec.frame.Delimiters;
-
-/**
- * A StompFrameDelimiter
- *
- * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
- */
-public class StompFrameDelimiter extends DelimiterBasedFrameDecoder
-{
-
- private static final int MAX_DATA_LENGTH = 1024 * 1024 * 100;
-
- public StompFrameDelimiter()
- {
- super(MAX_DATA_LENGTH, false, Delimiters.nulDelimiter());
- }
-}
Deleted: trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameError.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameError.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompFrameError.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -1,38 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.core.protocol.stomp;
-
-/**
- * Command indicating that an invalid Stomp Frame was received.
- *
- * @author <a href="http://hiramchirino.com">chirino</a>
- */
-class StompFrameError extends StompFrame
-{
- private final StompException exception;
-
- public StompFrameError(StompException exception)
- {
- this.exception = exception;
- }
-
- public StompException getException()
- {
- return exception;
- }
-}
Deleted: trunk/src/main/org/hornetq/core/protocol/stomp/StompMarshaller.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompMarshaller.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompMarshaller.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -1,235 +0,0 @@
-/**
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.core.protocol.stomp;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutput;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.hornetq.api.core.HornetQBuffer;
-
-/**
- * Implements marshalling and unmarsalling the <a href="http://stomp.codehaus.org/">Stomp</a> protocol.
- */
-class StompMarshaller
-{
- public static final byte[] NO_DATA = new byte[] {};
-
- private static final byte[] END_OF_FRAME = new byte[] { 0, '\n' };
-
- private static final int MAX_COMMAND_LENGTH = 1024;
-
- private static final int MAX_HEADER_LENGTH = 1024 * 10;
-
- private static final int MAX_HEADERS = 1000;
-
- private static final int MAX_DATA_LENGTH = 1024 * 1024 * 100;
-
- private int version = 1;
-
- public int getVersion()
- {
- return version;
- }
-
- public void setVersion(int version)
- {
- this.version = version;
- }
-
- public byte[] marshal(StompFrame command) throws IOException
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(baos);
- marshal(command, dos);
- dos.close();
- return baos.toByteArray();
- }
-
- public void marshal(StompFrame stomp, DataOutput os) throws IOException
- {
- StringBuffer buffer = new StringBuffer();
- buffer.append(stomp.getCommand());
- buffer.append(Stomp.NEWLINE);
-
- // Output the headers.
- for (Iterator<Map.Entry<String, Object>> iter = stomp.getHeaders().entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry<String, Object> entry = iter.next();
- buffer.append(entry.getKey());
- buffer.append(Stomp.Headers.SEPERATOR);
- buffer.append(entry.getValue());
- buffer.append(Stomp.NEWLINE);
- }
-
- // Add a newline to seperate the headers from the content.
- buffer.append(Stomp.NEWLINE);
-
- os.write(buffer.toString().getBytes("UTF-8"));
- os.write(stomp.getContent());
- os.write(END_OF_FRAME);
- }
-
- public StompFrame unmarshal(HornetQBuffer in) throws IOException
- {
-
- try
- {
- String action = null;
-
- // skip white space to next real action line
- while (true)
- {
- action = readLine(in, MAX_COMMAND_LENGTH, "The maximum command length was exceeded");
- if (action == null)
- {
- throw new IOException("connection was closed");
- }
- else
- {
- action = action.trim();
- if (action.length() > 0)
- {
- break;
- }
- }
- }
-
- // Parse the headers
- HashMap<String, Object> headers = new HashMap<String, Object>(25);
- while (true)
- {
- String line = readLine(in, MAX_HEADER_LENGTH, "The maximum header length was exceeded");
- if (line != null && line.trim().length() > 0)
- {
-
- if (headers.size() > MAX_HEADERS)
- {
- throw new StompException("The maximum number of headers was exceeded", true);
- }
-
- try
- {
- int seperator_index = line.indexOf(Stomp.Headers.SEPERATOR);
- String name = line.substring(0, seperator_index).trim();
- String value = line.substring(seperator_index + 1, line.length()).trim();
- headers.put(name, value);
- }
- catch (Exception e)
- {
- throw new StompException("Unable to parser header line [" + line + "]", true);
- }
- }
- else
- {
- break;
- }
- }
-
- // Read in the data part.
- byte[] data = NO_DATA;
- String contentLength = (String)headers.get(Stomp.Headers.CONTENT_LENGTH);
- if (contentLength != null)
- {
-
- // Bless the client, he's telling us how much data to read in.
- int length;
- try
- {
- length = Integer.parseInt(contentLength.trim());
- }
- catch (NumberFormatException e)
- {
- throw new StompException("Specified content-length is not a valid integer", true);
- }
-
- if (length > MAX_DATA_LENGTH)
- {
- throw new StompException("The maximum data length was exceeded", true);
- }
-
- data = new byte[length];
- in.readBytes(data);
-
- if (in.readByte() != 0)
- {
- throw new StompException(Stomp.Headers.CONTENT_LENGTH + " bytes were read and " +
- "there was no trailing null byte", true);
- }
- }
- else
- {
-
- // We don't know how much to read.. data ends when we hit a 0
- byte b;
- ByteArrayOutputStream baos = null;
- while (in.readableBytes() > 0 && (b = in.readByte()) != 0)
- {
-
- if (baos == null)
- {
- baos = new ByteArrayOutputStream();
- }
- else if (baos.size() > MAX_DATA_LENGTH)
- {
- throw new StompException("The maximum data length was exceeded", true);
- }
-
- baos.write(b);
- }
-
- if (baos != null)
- {
- baos.close();
- data = baos.toByteArray();
- }
- }
-
- return new StompFrame(action, headers, data);
- }
- catch (StompException e)
- {
- return new StompFrameError(e);
- }
- }
-
- protected String readLine(HornetQBuffer in, int maxLength, String errorMessage) throws IOException
- {
- char[] chars = new char[MAX_HEADER_LENGTH];
-
- int count = 0;
- while (in.readable())
- {
- byte b = in.readByte();
-
- if (b == (byte)'\n')
- {
- break;
- }
- else
- {
- chars[count++] = (char)b;
- }
- }
- return new String(chars, 0, count);
- }
-}
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompProtocolManager.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -14,7 +14,6 @@
package org.hornetq.core.protocol.stomp;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
@@ -26,7 +25,6 @@
import java.util.concurrent.Executor;
import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.HornetQBuffers;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
import org.hornetq.api.core.Message;
@@ -61,7 +59,7 @@
private final HornetQServer server;
- private final StompMarshaller marshaller;
+ private final StompFrameDecoder frameDecoder;
private final Executor executor;
@@ -106,7 +104,7 @@
public StompProtocolManager(final HornetQServer server, final List<Interceptor> interceptors)
{
this.server = server;
- this.marshaller = new StompMarshaller();
+ this.frameDecoder = new StompFrameDecoder();
this.executor = server.getExecutorFactory().getExecutor();
}
@@ -125,9 +123,21 @@
public int isReadyToHandle(HornetQBuffer buffer)
{
- return -1;
+ int start = buffer.readerIndex();
+
+ StompFrame frame = frameDecoder.decode(buffer);
+
+ if (frame == null)
+ {
+ return -1;
+ }
+ else
+ {
+ return buffer.readerIndex() - start;
+ }
}
+
public void handleBuffer(final RemotingConnection connection, final HornetQBuffer buffer)
{
executor.execute(new Runnable()
@@ -146,21 +156,21 @@
});
}
- private void doHandleBuffer(RemotingConnection connection, HornetQBuffer buffer)
+ private void doHandleBuffer(final RemotingConnection connection, final HornetQBuffer buffer)
{
StompConnection conn = (StompConnection)connection;
StompFrame request = null;
try
{
- request = marshaller.unmarshal(buffer);
+ request = frameDecoder.decode(buffer);
if (log.isTraceEnabled())
{
log.trace("received " + request);
}
String command = request.getCommand();
-
StompFrame response = null;
+
if (Stomp.Commands.CONNECT.equals(command))
{
response = onConnect(request, conn);
@@ -199,7 +209,6 @@
}
else
{
-
log.error("Unsupported Stomp frame: " + request);
response = new StompFrame(Stomp.Responses.ERROR,
new HashMap<String, Object>(),
@@ -211,7 +220,7 @@
if (response == null)
{
Map<String, Object> h = new HashMap<String, Object>();
- response = new StompFrame(Stomp.Responses.RECEIPT, h, StompMarshaller.NO_DATA);
+ response = new StompFrame(Stomp.Responses.RECEIPT, h);
}
response.getHeaders().put(Stomp.Headers.Response.RECEIPT_ID,
request.getHeaders().get(Stomp.Headers.RECEIPT_REQUESTED));
@@ -325,7 +334,7 @@
boolean unsubscribed = stompSession.unsubscribe(subscriptionID);
if (!unsubscribed)
{
- throw new StompException("Cannot unsubscribe as a subscription exists for id: " + subscriptionID);
+ throw new StompException("Cannot unsubscribe as no subscription exists for id: " + subscriptionID);
}
return null;
}
@@ -473,11 +482,7 @@
Map<String, Object> headers = frame.getHeaders();
String destination = (String)headers.remove(Stomp.Headers.Send.DESTINATION);
String txID = (String)headers.remove(Stomp.Headers.TRANSACTION);
- byte type = Message.TEXT_TYPE;
- if (headers.containsKey(Stomp.Headers.CONTENT_LENGTH))
- {
- type = Message.BYTES_TYPE;
- }
+ byte type = Message.BYTES_TYPE;
long timestamp = System.currentTimeMillis();
ServerMessageImpl message = new ServerMessageImpl(server.getStorageManager().generateUniqueID(), 512);
@@ -485,15 +490,7 @@
message.setTimestamp(timestamp);
message.setAddress(SimpleString.toSimpleString(destination));
StompUtils.copyStandardHeadersFromFrameToMessage(frame, message);
- byte[] content = frame.getContent();
- if (type == Message.TEXT_TYPE)
- {
- message.getBodyBuffer().writeNullableSimpleString(SimpleString.toSimpleString(new String(content)));
- }
- else
- {
- message.getBodyBuffer().writeBytes(content);
- }
+ message.getBodyBuffer().writeBytes(frame.getContent());
StompSession stompSession = null;
if (txID == null)
@@ -533,7 +530,7 @@
{
h.put(Stomp.Headers.Connected.RESPONSE_ID, requestID);
}
- return new StompFrame(Stomp.Responses.CONNECTED, h, StompMarshaller.NO_DATA);
+ return new StompFrame(Stomp.Responses.CONNECTED, h);
}
public void send(final StompConnection connection, final StompFrame frame)
@@ -619,16 +616,16 @@
try
{
- byte[] bytes = marshaller.marshal(frame);
- HornetQBuffer buffer = HornetQBuffers.wrappedBuffer(bytes);
+ HornetQBuffer buffer = frame.toHornetQBuffer();
connection.getTransportConnection().write(buffer, true);
}
- catch (IOException e)
+ catch (Exception e)
{
log.error("Unable to send frame " + frame, e);
}
}
}
+
// Inner classes -------------------------------------------------
}
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompSession.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -18,7 +18,6 @@
import java.util.Map.Entry;
import org.hornetq.api.core.HornetQBuffer;
-import org.hornetq.api.core.Message;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.message.impl.MessageImpl;
import org.hornetq.core.persistence.OperationContext;
@@ -28,6 +27,7 @@
import org.hornetq.core.server.ServerSession;
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.protocol.SessionCallback;
+import org.hornetq.utils.DataConstants;
import org.hornetq.utils.UUIDGenerator;
/**
@@ -85,32 +85,20 @@
{
headers.put(Stomp.Headers.Message.SUBSCRIPTION, subscription.getID());
}
- byte[] data = new byte[] {};
- serverMessage.getBodyBuffer().markReaderIndex();
- if (serverMessage.getType() == Message.TEXT_TYPE)
- {
- SimpleString text = serverMessage.getBodyBuffer().readNullableSimpleString();
- if (text != null)
- {
- data = text.toString().getBytes("UTF-8");
- }
- }
- else
- {
- HornetQBuffer buffer = serverMessage.getBodyBuffer();
- buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE);
- int size = serverMessage.getEndOfBodyPosition() - buffer.readerIndex();
- data = new byte[size];
- buffer.readBytes(data);
- headers.put(Headers.CONTENT_LENGTH, data.length);
- }
+ HornetQBuffer buffer = serverMessage.getBodyBuffer();
+ buffer.readerIndex(MessageImpl.BUFFER_HEADER_SPACE + DataConstants.SIZE_INT);
+ int bodyPos = serverMessage.getEndOfBodyPosition() == -1 ? buffer.writerIndex() : serverMessage.getEndOfBodyPosition();
+ int size = bodyPos - buffer.readerIndex();
+ byte[] data = new byte[size];
+ buffer.readBytes(data);
+ headers.put(Headers.CONTENT_LENGTH, data.length);
serverMessage.getBodyBuffer().resetReaderIndex();
-
+
StompFrame frame = new StompFrame(Stomp.Responses.MESSAGE, headers, data);
StompUtils.copyStandardHeadersFromMessageToFrame(serverMessage, frame, deliveryCount);
manager.send(connection, frame);
- int size = frame.getEncodedSize();
+ int length = frame.getEncodedSize();
if (subscription.getAck().equals(Stomp.Headers.Subscribe.AckModeValues.AUTO))
{
@@ -121,7 +109,7 @@
{
messagesToAck.put(serverMessage.getMessageID(), consumerID);
}
- return size;
+ return length;
}
catch (Exception e)
@@ -183,7 +171,7 @@
// Already exists
if (query.getConsumerCount() > 0)
{
- throw new IllegalStateException("Cannot create a subscriber on the durable subscription since it already has subscriber(s)");
+ throw new IllegalStateException("Cannot create a subscriber on the durable subscription since it already has a subscriber: " + queue);
}
}
} else
@@ -194,7 +182,7 @@
}
session.createConsumer(consumerID, queue, SimpleString.toSimpleString(selector), false);
session.receiveConsumerCredits(consumerID, -1);
- StompSubscription subscription = new StompSubscription(subscriptionID, destination, ack);
+ StompSubscription subscription = new StompSubscription(subscriptionID, ack);
subscriptions.put(consumerID, subscription);
// FIXME not very smart: since we can't start the consumer, we start the session
// every time to start the new consumer (and all previous consumers...)
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompSubscription.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -28,18 +28,15 @@
private final String subID;
- private final String destination;
-
private final String ack;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public StompSubscription(String subID, String destination, String ack)
+ public StompSubscription(String subID, String ack)
{
this.subID = subID;
- this.destination = destination;
this.ack = ack;
}
@@ -50,11 +47,6 @@
return ack;
}
- public String getDestination()
- {
- return destination;
- }
-
public String getID()
{
return subID;
Modified: trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java
===================================================================
--- trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/src/main/org/hornetq/integration/transports/netty/ChannelPipelineSupport.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -16,7 +16,6 @@
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
-import org.hornetq.core.protocol.stomp.StompFrameDelimiter;
import org.hornetq.spi.core.protocol.ProtocolType;
import org.hornetq.spi.core.remoting.BufferDecoder;
import org.jboss.netty.channel.ChannelPipeline;
@@ -55,10 +54,6 @@
//Core protocol uses it's own optimised decoder
pipeline.addLast("decoder", new HornetQFrameDecoder2());
}
- else if (protocol == ProtocolType.STOMP)
- {
- pipeline.addLast("decoder", new StompFrameDelimiter());
- }
else
{
pipeline.addLast("decoder", new HornetQFrameDecoder(decoder));
Modified: trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-22 09:33:27 UTC (rev 8891)
+++ trunk/tests/src/org/hornetq/tests/integration/stomp/StompTest.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -25,6 +25,8 @@
import java.net.SocketTimeoutException;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -33,12 +35,12 @@
import javax.jms.ConnectionFactory;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
-import javax.jms.JMSException;
+import javax.jms.Message;
import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
import javax.jms.MessageProducer;
import javax.jms.Queue;
import javax.jms.Session;
-import javax.jms.TextMessage;
import javax.jms.Topic;
import junit.framework.Assert;
@@ -76,6 +78,45 @@
private Topic topic;
private JMSServerManager server;
+ public void _testSendManyMessages() throws Exception {
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ String frame =
+ "CONNECT\n" +
+ "login: brianm\n" +
+ "passcode: wombats\n\n" +
+ Stomp.NULL;
+ sendFrame(frame);
+ frame = receiveFrame(10000);
+
+ Assert.assertTrue(frame.startsWith("CONNECTED"));
+ int count = 1000;
+ final CountDownLatch latch = new CountDownLatch(count);
+ consumer.setMessageListener(new MessageListener()
+ {
+
+ public void onMessage(Message arg0)
+ {
+ System.out.println("<<< " + (1000 - latch.getCount()));
+ latch.countDown();
+ }
+ });
+
+ frame =
+ "SEND\n" +
+ "destination:" + getQueuePrefix() + getQueueName() + "\n\n" +
+ "Hello World" +
+ Stomp.NULL;
+ for (int i=1; i <= count; i++) {
+ // Thread.sleep(1);
+ System.out.println(">>> " + i);
+ sendFrame(frame);
+ }
+
+ assertTrue(latch.await(60, TimeUnit.SECONDS));
+
+ }
+
public void testConnect() throws Exception {
String connect_frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n" + "request-id: 1\n" + "\n" + Stomp.NULL;
@@ -137,9 +178,9 @@
sendFrame(frame);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
- Assert.assertEquals("Hello World", message.getText());
+ Assert.assertEquals("Hello World", readContent(message));
// Make sure that the timestamp is valid - should
// be very close to the current time.
@@ -175,9 +216,9 @@
Assert.assertTrue(f.startsWith("RECEIPT"));
Assert.assertTrue(f.indexOf("receipt-id:1234") >= 0);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
- Assert.assertEquals("Hello World", message.getText());
+ Assert.assertEquals("Hello World", readContent(message));
// Make sure that the timestamp is valid - should
// be very close to the current time.
@@ -200,16 +241,17 @@
frame = receiveFrame(10000);
Assert.assertTrue(frame.startsWith("CONNECTED"));
- byte[] data = new byte[] {1, 2, 3, 4};
-
+ byte[] data = new byte[] {1, 0, 0, 4};
+
frame =
"SEND\n" +
"destination:" + getQueuePrefix() + getQueueName() + "\n" +
- "content-length:" + data.length + "\n\n" +
- new String(data) +
- Stomp.NULL;
-
- sendFrame(frame);
+ "content-length:" + data.length + "\n\n";
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ baos.write(frame.getBytes("UTF-8"));
+ baos.write(data);
+ baos.write('\0');
+ sendFrame(baos.toByteArray());
BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
@@ -218,12 +260,6 @@
assertEquals(data[1], message.readByte());
assertEquals(data[2], message.readByte());
assertEquals(data[3], message.readByte());
-
- // Make sure that the timestamp is valid - should
- // be very close to the current time.
- long tnow = System.currentTimeMillis();
- long tmsg = message.getJMSTimestamp();
- Assert.assertTrue(Math.abs(tnow - tmsg) < 1000);
}
public void testJMSXGroupIdCanBeSet() throws Exception {
@@ -249,10 +285,11 @@
sendFrame(frame);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
+ Assert.assertEquals("Hello World", readContent(message));
// differ from StompConnect
- Assert.assertEquals("TEST", ((TextMessage) message).getStringProperty("JMSXGroupID"));
+ Assert.assertEquals("TEST", message.getStringProperty("JMSXGroupID"));
}
public void testSendMessageWithCustomHeadersAndSelector() throws Exception {
@@ -279,9 +316,9 @@
sendFrame(frame);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
- Assert.assertEquals("Hello World", message.getText());
+ Assert.assertEquals("Hello World", readContent(message));
Assert.assertEquals("foo", "abc", message.getStringProperty("foo"));
Assert.assertEquals("bar", "123", message.getStringProperty("bar"));
}
@@ -315,9 +352,9 @@
sendFrame(frame);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
- Assert.assertEquals("Hello World", message.getText());
+ Assert.assertEquals("Hello World", readContent(message));
Assert.assertEquals("JMSCorrelationID", "c123", message.getJMSCorrelationID());
Assert.assertEquals("getJMSType", "t345", message.getJMSType());
Assert.assertEquals("getJMSPriority", 3, message.getJMSPriority());
@@ -364,7 +401,7 @@
// message should not be received as it was auto-acked
MessageConsumer consumer = session.createConsumer(queue);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ Message message = consumer.receive(1000);
Assert.assertNull(message);
}
@@ -389,7 +426,7 @@
sendFrame(frame);
byte[] payload = new byte[]{1, 2, 3, 4, 5};
- sendBytesMessage(payload);
+ sendMessage(payload, queue);
frame = receiveFrame(10000);
Assert.assertTrue(frame.startsWith("MESSAGE"));
@@ -429,7 +466,7 @@
sendFrame(frame);
MessageProducer producer = session.createProducer(queue);
- TextMessage message = session.createTextMessage("Hello World");
+ BytesMessage message = session.createBytesMessage();
message.setStringProperty("S", "value");
message.setBooleanProperty("n", false);
message.setByteProperty("byte", (byte) 9);
@@ -438,6 +475,7 @@
message.setIntProperty("i", 10);
message.setLongProperty("l", 121);
message.setShortProperty("s", (short) 12);
+ message.writeBytes("Hello World".getBytes("UTF-8"));
producer.send(message);
frame = receiveFrame(10000);
@@ -532,12 +570,6 @@
"\n\n" +
Stomp.NULL;
sendFrame(frame);
-
- // message should not be received as it was auto-acked
- MessageConsumer consumer = session.createConsumer(queue);
- TextMessage message = (TextMessage) consumer.receive(1000);
- Assert.assertNull(message);
-
}
public void testMessagesAreInOrder() throws Exception {
@@ -667,7 +699,7 @@
// message should not be received since message was acknowledged by the client
MessageConsumer consumer = session.createConsumer(queue);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ Message message = consumer.receive(1000);
Assert.assertNull(message);
}
@@ -703,7 +735,7 @@
// message should be received since message was not acknowledged
MessageConsumer consumer = session.createConsumer(queue);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ Message message = consumer.receive(1000);
Assert.assertNotNull(message);
Assert.assertTrue(message.getJMSRedelivered());
}
@@ -957,7 +989,7 @@
sendFrame(frame);
waitForReceipt();
- TextMessage message = (TextMessage) consumer.receive(1000);
+ Message message = consumer.receive(1000);
Assert.assertNotNull("Should have received a message", message);
}
@@ -998,7 +1030,7 @@
Stomp.NULL;
sendFrame(frame);
- TextMessage message = (TextMessage) consumer.receive(1000);
+ Message message = consumer.receive(1000);
Assert.assertNotNull("Should have received a message", message);
// 2nd tx with same tx ID
@@ -1025,7 +1057,7 @@
Stomp.NULL;
sendFrame(frame);
- message = (TextMessage) consumer.receive(1000);
+ message = consumer.receive(1000);
Assert.assertNotNull("Should have received a message", message);
}
@@ -1123,9 +1155,9 @@
waitForReceipt();
//only second msg should be received since first msg was rolled back
- TextMessage message = (TextMessage) consumer.receive(1000);
+ BytesMessage message = (BytesMessage) consumer.receive(1000);
Assert.assertNotNull(message);
- Assert.assertEquals("second message", message.getText().trim());
+ Assert.assertEquals("second message", readContent(message));
}
public void testSubscribeToTopic() throws Exception {
@@ -1203,25 +1235,21 @@
String subscribeFrame =
"SUBSCRIBE\n" +
"destination:" + getTopicPrefix() + getTopicName() + "\n" +
- "receipt: 12\n" +
"durable-subscription-name: " + getName() + "\n" +
"\n\n" +
Stomp.NULL;
sendFrame(subscribeFrame);
- // wait for SUBSCRIBE's receipt
- frame = receiveFrame(10000);
- Assert.assertTrue(frame.startsWith("RECEIPT"));
+ waitForFrameToTakeEffect();
String disconnectFrame =
"DISCONNECT\n" +
"\n\n" +
Stomp.NULL;
sendFrame(disconnectFrame);
- stompSocket.close();
+ waitForFrameToTakeEffect();
// send the message when the durable subscriber is disconnected
sendMessage(getName(), topic);
-
reconnect(1000);
sendFrame(connectFame);
@@ -1229,9 +1257,6 @@
Assert.assertTrue(frame.startsWith("CONNECTED"));
sendFrame(subscribeFrame);
- // wait for SUBSCRIBE's receipt
- frame = receiveFrame(10000);
- Assert.assertTrue(frame.startsWith("RECEIPT"));
// we must have received the message
frame = receiveFrame(10000);
@@ -1522,6 +1547,14 @@
outputStream.flush();
}
+ public void sendFrame(byte[] data) throws Exception {
+ OutputStream outputStream = stompSocket.getOutputStream();
+ for (int i = 0; i < data.length; i++) {
+ outputStream.write(data[i]);
+ }
+ outputStream.flush();
+ }
+
public String receiveFrame(long timeOut) throws Exception {
stompSocket.setSoTimeout((int) timeOut);
InputStream is = stompSocket.getInputStream();
@@ -1550,31 +1583,36 @@
}
public void sendMessage(String msg) throws Exception {
- sendMessage(msg, "foo", "xyz", queue);
+ sendMessage(msg.getBytes("UTF-8"), "foo", "xyz", queue);
}
public void sendMessage(String msg, Destination destination) throws Exception {
- sendMessage(msg, "foo", "xyz", destination);
+ sendMessage(msg.getBytes("UTF-8"), "foo", "xyz", destination);
}
- public void sendMessage(String msg, String propertyName, String propertyValue) throws JMSException {
- sendMessage(msg, propertyName, propertyValue, queue);
- }
+ public void sendMessage(byte[] data, Destination destination) throws Exception {
+ sendMessage(data, "foo", "xyz", destination);
+ }
- public void sendMessage(String msg, String propertyName, String propertyValue, Destination destination) throws JMSException {
- MessageProducer producer = session.createProducer(destination);
- TextMessage message = session.createTextMessage(msg);
- message.setStringProperty(propertyName, propertyValue);
- producer.send(message);
+ public void sendMessage(String msg, String propertyName, String propertyValue) throws Exception {
+ sendMessage(msg.getBytes("UTF-8"), propertyName, propertyValue, queue);
}
- public void sendBytesMessage(byte[] msg) throws Exception {
- MessageProducer producer = session.createProducer(queue);
+ public void sendMessage(byte[] data, String propertyName, String propertyValue, Destination destination) throws Exception {
+ MessageProducer producer = session.createProducer(destination);
BytesMessage message = session.createBytesMessage();
- message.writeBytes(msg);
+ message.setStringProperty(propertyName, propertyValue);
+ message.writeBytes(data);
producer.send(message);
}
-
+
+ public String readContent(BytesMessage message) throws Exception
+ {
+ byte[] data = new byte[1024];
+ int size = message.readBytes(data);
+ return new String(data, 0, size, "UTF-8");
+ }
+
protected void waitForReceipt() throws Exception {
String frame = receiveFrame(50000);
assertNotNull(frame);
Added: trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java (rev 0)
+++ trunk/tests/src/org/hornetq/tests/stress/stomp/StompStressTest.java 2010-02-22 10:16:42 UTC (rev 8892)
@@ -0,0 +1,182 @@
+/*
+ * 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.tests.stress.stomp;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.Socket;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.CoreQueueConfiguration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.protocol.stomp.Stomp;
+import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.HornetQServers;
+import org.hornetq.integration.transports.netty.NettyAcceptorFactory;
+import org.hornetq.integration.transports.netty.TransportConstants;
+import org.hornetq.spi.core.protocol.ProtocolType;
+import org.hornetq.tests.util.UnitTestCase;
+
+public class StompStressTest extends UnitTestCase
+{
+ private static final transient Logger log = Logger.getLogger(StompStressTest.class);
+
+ private static final int COUNT = 100;
+
+ private int port = 61613;
+
+ private Socket stompSocket;
+
+ private ByteArrayOutputStream inputBuffer;
+
+ private String destination = "stomp.stress.queue";
+
+ private HornetQServer server;
+
+ public void testSendAndReceiveMessage() throws Exception
+ {
+ String frame = "CONNECT\n" + "login: brianm\n" + "passcode: wombats\n\n" + Stomp.NULL;
+ sendFrame(frame);
+
+ frame = receiveFrame(10000);
+ Assert.assertTrue(frame.startsWith("CONNECTED"));
+
+ frame = "SEND\n" + "destination:" + destination + "\n\n";
+
+ for (int i = 0; i < COUNT; i++)
+ {
+ sendFrame(frame + "count=" + i + Stomp.NULL);
+ }
+
+ frame = "SUBSCRIBE\n" + "destination:" + destination + "\n" + "ack:auto\n\n" + Stomp.NULL;
+ sendFrame(frame);
+
+ for (int i = 0; i < COUNT; i++)
+ {
+ frame = receiveFrame(10000);
+ Assert.assertTrue(frame.startsWith("MESSAGE"));
+ Assert.assertTrue(frame.indexOf("destination:") > 0);
+ Assert.assertTrue(frame.indexOf("count=" + i) > 0);
+ }
+
+ frame = "DISCONNECT\n" + "\n\n" + Stomp.NULL;
+ sendFrame(frame);
+ }
+
+ // Implementation methods
+ // -------------------------------------------------------------------------
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ server = createServer();
+ server.start();
+
+ stompSocket = createSocket();
+ inputBuffer = new ByteArrayOutputStream();
+ }
+
+ private HornetQServer createServer() throws Exception
+ {
+ Configuration config = new ConfigurationImpl();
+ config.setSecurityEnabled(false);
+ config.setPersistenceEnabled(false);
+
+ Map<String, Object> params = new HashMap<String, Object>();
+ params.put(TransportConstants.PROTOCOL_PROP_NAME, ProtocolType.STOMP.toString());
+ params.put(TransportConstants.PORT_PROP_NAME, TransportConstants.DEFAULT_STOMP_PORT);
+ TransportConfiguration stompTransport = new TransportConfiguration(NettyAcceptorFactory.class.getName(), params);
+ config.getAcceptorConfigurations().add(stompTransport);
+ config.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
+ config.getQueueConfigurations().add(new CoreQueueConfiguration(destination, destination, null, false));
+ return HornetQServers.newHornetQServer(config);
+ }
+
+ protected void tearDown() throws Exception
+ {
+ if (stompSocket != null)
+ {
+ stompSocket.close();
+ }
+ server.stop();
+
+ super.tearDown();
+ }
+
+ protected Socket createSocket() throws IOException
+ {
+ return new Socket("127.0.0.1", port);
+ }
+
+ public void sendFrame(String data) throws Exception
+ {
+ byte[] bytes = data.getBytes("UTF-8");
+ OutputStream outputStream = stompSocket.getOutputStream();
+ for (int i = 0; i < bytes.length; i++)
+ {
+ outputStream.write(bytes[i]);
+ }
+ outputStream.flush();
+ }
+
+ public void sendFrame(byte[] data) throws Exception
+ {
+ OutputStream outputStream = stompSocket.getOutputStream();
+ for (int i = 0; i < data.length; i++)
+ {
+ outputStream.write(data[i]);
+ }
+ outputStream.flush();
+ }
+
+ public String receiveFrame(long timeOut) throws Exception
+ {
+ stompSocket.setSoTimeout((int)timeOut);
+ InputStream is = stompSocket.getInputStream();
+ int c = 0;
+ for (;;)
+ {
+ c = is.read();
+ if (c < 0)
+ {
+ throw new IOException("socket closed.");
+ }
+ else if (c == 0)
+ {
+ c = is.read();
+ if (c != '\n')
+ {
+ byte[] ba = inputBuffer.toByteArray();
+ System.out.println(new String(ba, "UTF-8"));
+ }
+ Assert.assertEquals("Expecting stomp frame to terminate with \0\n", c, '\n');
+ byte[] ba = inputBuffer.toByteArray();
+ inputBuffer.reset();
+ return new String(ba, "UTF-8");
+ }
+ else
+ {
+ inputBuffer.write(c);
+ }
+ }
+ }
+}
15 years
JBoss hornetq SVN: r8891 - trunk/tests/src/org/hornetq/tests/integration/jms/server/management.
by do-not-reply@jboss.org
Author: jmesnil
Date: 2010-02-22 04:33:27 -0500 (Mon, 22 Feb 2010)
New Revision: 8891
Modified:
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
Log:
fix build
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-02-20 10:17:41 UTC (rev 8890)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-02-22 09:33:27 UTC (rev 8891)
@@ -149,6 +149,18 @@
jndiBindings);
}
+ public void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ Object[] jndiBindings) throws Exception
+ {
+ proxy.invokeOperation("createConnectionFactory",
+ name,
+ liveTransportClassName,
+ liveTransportParams,
+ jndiBindings);
+ }
+
public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
{
return (Boolean)proxy.invokeOperation("closeConnectionsForAddress", ipAddress);
15 years
JBoss hornetq SVN: r8890 - in trunk: src/main/org/hornetq/jms/management/impl and 1 other directories.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-02-20 05:17:41 -0500 (Sat, 20 Feb 2010)
New Revision: 8890
Modified:
trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java
trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.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:
https://jira.jboss.org/jira/browse/HORNETQ-305 removed unwanted createconnectionfactory methods and added set/get's to ConnectionFactoryControl
Modified: trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2010-02-18 23:12:11 UTC (rev 8889)
+++ trunk/src/main/org/hornetq/api/jms/management/ConnectionFactoryControl.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -15,6 +15,8 @@
import java.util.List;
+import org.hornetq.api.core.Pair;
+import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.client.ClientSessionFactory;
/**
@@ -46,16 +48,31 @@
String getClientID();
/**
+ * @see ClientSessionFactory.setClientID
+ */
+ void setClientID(String clientID);
+
+ /**
* @see ClientSessionFactory#getClientFailureCheckPeriod()
*/
long getClientFailureCheckPeriod();
/**
+ * @see ClientSessionFactory#setClientFailureCheckPeriod
+ */
+ void setClientFailureCheckPeriod(long clientFailureCheckPeriod);
+
+ /**
* @see ClientSessionFactory#getCallTimeout()
*/
long getCallTimeout();
/**
+ * @see ClientSessionFactory#setCallTimeout(long)
+ */
+ void setCallTimeout(long callTimeout);
+
+ /**
* Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode.
*
* @see ClientSessionFactory#getAckBatchSize()
@@ -64,84 +81,310 @@
int getDupsOKBatchSize();
/**
+ * @see ClientSessionFactory#setDupsOKBatchSize(int)
+ */
+ void setDupsOKBatchSize(int dupsOKBatchSize);
+
+ /**
* @see ClientSessionFactory#getConsumerMaxRate()
*/
int getConsumerMaxRate();
/**
+ * @see ClientSessionFactory#setConsumerMaxRate(int)
+ */
+ void setConsumerMaxRate(int consumerMaxRate);
+
+ /**
* @see ClientSessionFactory#getConsumerWindowSize()
*/
int getConsumerWindowSize();
/**
+ * @see ClientSessionFactory#setConfirmationWindowSize(int)
+ */
+ void setConsumerWindowSize(int consumerWindowSize);
+
+ /**
* @see ClientSessionFactory#getProducerMaxRate()
*/
int getProducerMaxRate();
/**
+ * @see ClientSessionFactory#setProducerMaxRate(int)
+ */
+ void setProducerMaxRate(int producerMaxRate);
+
+ /**
* @see ClientSessionFactory#getConfirmationWindowSize()
*/
int getConfirmationWindowSize();
+ /**
+ * @see ClientSessionFactory#setConfirmationWindowSize(int)
+ */
+ void setConfirmationWindowSize(int confirmationWindowSize);
+
/**
* @see ClientSessionFactory#isBlockOnAcknowledge()
*/
boolean isBlockOnAcknowledge();
+ /**
+ * @see ClientSessionFactory#setBlockOnAcknowledge(boolean)
+ */
+ void setBlockOnAcknowledge(boolean blockOnAcknowledge);
+
/**
* @see ClientSessionFactory#isBlockOnDurableSend()
*/
boolean isBlockOnDurableSend();
+ /**
+ * @see ClientSessionFactory#setBlockOnDurableSend(boolean)
+ */
+ void setBlockOnDurableSend(boolean blockOnDurableSend);
+
/**
* @see ClientSessionFactory#isBlockOnNonDurableSend()
*/
boolean isBlockOnNonDurableSend();
+ /**
+ * @see ClientSessionFactory#setBlockOnNonDurableSend(boolean)
+ */
+ void setBlockOnNonDurableSend(boolean blockOnNonDurableSend);
+
/**
* @see ClientSessionFactory#isPreAcknowledge()
*/
boolean isPreAcknowledge();
+ /**
+ * @see ClientSessionFactory#setPreAcknowledge(boolean)
+ */
+ void setPreAcknowledge(boolean preAcknowledge);
+
+
/**
* @see ClientSessionFactory#getConnectionTTL()
*/
long getConnectionTTL();
+ /**
+ * @see ClientSessionFactory#setConnectionTTL(long)
+ */
+ void setConnectionTTL(long connectionTTL);
+
/**
* Returns the batch size (in bytes) between acknowledgements when using a transacted session.
*
* @see ClientSessionFactory#getAckBatchSize()
*/
- long getTransactionBatchSize();
+ int getTransactionBatchSize();
+ /**
+ * @see ClientSessionFactory#setTransactionBatchSize(int)
+ */
+ void setTransactionBatchSize(int transactionBatchSize);
+
/**
* @see ClientSessionFactory#getMinLargeMessageSize()
*/
- long getMinLargeMessageSize();
+ int getMinLargeMessageSize();
+ /**
+ * @see ClientSessionFactory#setMinLargeMessageSize(int)
+ */
+ void setMinLargeMessageSize(int minLargeMessageSize);
+
/**
* @see ClientSessionFactory#isAutoGroup()
*/
boolean isAutoGroup();
+ /**
+ * @see ClientSessionFactory#setAutoGroup(boolean)
+ */
+ void setAutoGroup(boolean autoGroup);
+
/**
* @see ClientSessionFactory#getRetryInterval()
*/
long getRetryInterval();
+ /**
+ * @see ClientSessionFactory#setRetryInterval(long)
+ */
+ void setRetryInterval(long retryInterval);
+
/**
* @see ClientSessionFactory#getRetryIntervalMultiplier()
*/
double getRetryIntervalMultiplier();
+ /**
+ * @see ClientSessionFactory#setRetryIntervalMultiplier(double)
+ */
+ void setRetryIntervalMultiplier(double retryIntervalMultiplier);
+
/**
* @see ClientSessionFactory#getReconnectAttempts()
*/
int getReconnectAttempts();
+ /**
+ * @see ClientSessionFactory#setReconnectAttempts(int)
+ */
+ void setReconnectAttempts(int reconnectAttempts);
+
/**
* @see ClientSessionFactory#isFailoverOnServerShutdown()
*/
boolean isFailoverOnServerShutdown();
+
+ /**
+ * @see ClientSessionFactory#setFailoverOnServerShutdown(boolean)
+ */
+ void setFailoverOnServerShutdown(boolean failoverOnServerShutdown);
+
+ /**
+ * @see org.hornetq.api.core.client.ClientSessionFactory#getDiscoveryRefreshTimeout()
+ */
+ long getDiscoveryRefreshTimeout();
+
+ /**
+ * @see ClientSessionFactory#setDiscoveryRefreshTimeout(long)
+ */
+ void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout);
+
+ /**
+ * @see org.hornetq.api.core.client.ClientSessionFactory#getDiscoveryInitialWaitTimeout()
+ */
+ long getDiscoveryInitialWaitTimeout();
+
+ /**
+ * @see ClientSessionFactory#setDiscoveryInitialWaitTimeout(long)
+ */
+ void setDiscoveryInitialWaitTimeout(long discoveryInitialWaitTimeout);
+
+ /**
+ * @see org.hornetq.api.core.client.ClientSessionFactory#getProducerWindowSize()
+ */
+ int getProducerWindowSize();
+
+ /**
+ * @see ClientSessionFactory#setProducerWindowSize(int)
+ */
+ void setProducerWindowSize(int producerWindowSize);
+
+ /**
+ * @see ClientSessionFactory#isCacheLargeMessagesClient()
+ */
+ boolean isCacheLargeMessagesClient();
+
+ /**
+ * @see ClientSessionFactory#setCacheLargeMessagesClient(boolean)
+ */
+ void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient);
+
+ /**
+ * @see ClientSessionFactory#getMaxRetryInterval()
+ */
+ long getMaxRetryInterval();
+
+ /**
+ * @see ClientSessionFactory#setMaxRetryInterval(long)
+ */
+ void setMaxRetryInterval(long retryInterval);
+
+ /**
+ * @see ClientSessionFactory#getScheduledThreadPoolMaxSize()
+ */
+ int getScheduledThreadPoolMaxSize();
+
+ /**
+ * @see ClientSessionFactory#setScheduledThreadPoolMaxSize(int)
+ */
+ void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize);
+
+ /**
+ * @see ClientSessionFactory#getThreadPoolMaxSize()
+ */
+ int getThreadPoolMaxSize();
+
+ /**
+ * @see ClientSessionFactory#setThreadPoolMaxSize(int)
+ */
+ void setThreadPoolMaxSize(int threadPoolMaxSize);
+
+ /**
+ * @see ClientSessionFactory#getGroupID()
+ */
+ String getGroupID();
+
+ /**
+ * @see ClientSessionFactory#setGroupID(String)
+ */
+ void setGroupID(String groupID);
+
+ /**
+ * @see ClientSessionFactory#getInitialMessagePacketSize()
+ */
+ int getInitialMessagePacketSize();
+
+ /**
+ * @see ClientSessionFactory#setInitialMessagePacketSize(int)
+ */
+ void setInitialMessagePacketSize(int size);
+
+ /**
+ * @see ClientSessionFactory#isUseGlobalPools()
+ */
+ boolean isUseGlobalPools();
+
+ /**
+ * @see ClientSessionFactory#setUseGlobalPools(boolean)
+ */
+ void setUseGlobalPools(boolean useGlobalPools);
+
+ /**
+ * @see ClientSessionFactory#getConnectionLoadBalancingPolicyClassName()
+ */
+ String getConnectionLoadBalancingPolicyClassName();
+
+ /**
+ * @see ClientSessionFactory#setConnectionLoadBalancingPolicyClassName(String)
+ */
+ void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName);
+
+ /**
+ * @see ClientSessionFactory#getStaticConnectors()
+ */
+ List<Pair<TransportConfiguration, TransportConfiguration>> getStaticConnectors();
+
+ /**
+ * @see ClientSessionFactory#setStaticConnectors(java.util.List)
+ */
+ void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors);
+
+ /**
+ * @see ClientSessionFactory#getDiscoveryAddress()
+ */
+ String getDiscoveryAddress();
+
+ /**
+ * @see ClientSessionFactory#setDiscoveryAddress(String)
+ */
+ void setDiscoveryAddress(String discoveryAddress);
+
+ /**
+ * @see ClientSessionFactory#getDiscoveryPort()
+ */
+ int getDiscoveryPort();
+
+ /**
+ * @see ClientSessionFactory#setDiscoveryPort(int)
+ */
+ void setDiscoveryPort(int discoveryPort);
}
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-02-18 23:12:11 UTC (rev 8889)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -95,6 +95,15 @@
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 single HornetQ server.
+ * <br>
+ * The ConnectionFactory is bound to JNDI for all the specified bindings.
+ */
+ void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final Object[] 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.
@@ -128,143 +137,17 @@
@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,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- 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,
- @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;
-
- /**
- * 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,
- 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;
-
- /**
- * 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,
- @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;
-
- /**
* 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[])
+ * @see #createConnectionFactory(String, Object[], Object[], Object[], Object[])
*/
void createConnectionFactory(String name,
String discoveryAddress,
int discoveryPort,
- String clientID,
Object[] bindings) throws Exception;
/**
@@ -273,191 +156,16 @@
* 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[])
+ * @see #createConnectionFactory(String, 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,
@Parameter(name = "discoveryPort") int discoveryPort,
- @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,
- 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;
-
- /**
- * 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,
- @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;
-
- /**
- * 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,
- @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;
-
- /**
- * 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,
- String backupTransportClassName,
- 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,
- String backupTransportClassName,
- Map<String, Object> backupTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- /**
* Destroy the ConnectionFactory corresponding to the specified name.
*/
@Operation(desc = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java 2010-02-18 23:12:11 UTC (rev 8889)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -19,6 +19,9 @@
import javax.management.NotCompliantMBeanException;
import javax.management.StandardMBean;
+import org.hornetq.api.core.Pair;
+import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.jms.client.HornetQConnectionFactory;
import org.hornetq.api.jms.management.ConnectionFactoryControl;
import org.hornetq.core.management.impl.MBeanInfoHelper;
@@ -74,6 +77,246 @@
return cf.getClientFailureCheckPeriod();
}
+ public long getDiscoveryRefreshTimeout()
+ {
+ return cf.getDiscoveryRefreshTimeout();
+ }
+
+ public String getConnectionLoadBalancingPolicyClassName()
+ {
+ return cf.getConnectionLoadBalancingPolicyClassName();
+ }
+
+ public void setDiscoveryRefreshTimeout(long discoveryRefreshTimeout)
+ {
+ cf.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
+ }
+
+ public long getDiscoveryInitialWaitTimeout()
+ {
+ return cf.getDiscoveryInitialWaitTimeout();
+ }
+
+ public void setDiscoveryInitialWaitTimeout(long discoveryInitialWaitTimeout)
+ {
+ cf.setDiscoveryInitialWaitTimeout(discoveryInitialWaitTimeout);
+ }
+
+ public void setClientID(String clientID)
+ {
+ cf.setClientID(clientID);
+ }
+
+ public void setDupsOKBatchSize(int dupsOKBatchSize)
+ {
+ cf.setDupsOKBatchSize(dupsOKBatchSize);
+ }
+
+ public void setTransactionBatchSize(int transactionBatchSize)
+ {
+ cf.setTransactionBatchSize(transactionBatchSize);
+ }
+
+ public void setClientFailureCheckPeriod(long clientFailureCheckPeriod)
+ {
+ cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+ }
+
+ public void setConnectionTTL(long connectionTTL)
+ {
+ cf.setConnectionTTL(connectionTTL);
+ }
+
+ public void setCallTimeout(long callTimeout)
+ {
+ cf.setCallTimeout(callTimeout);
+ }
+
+ public void setConsumerWindowSize(int consumerWindowSize)
+ {
+ cf.setConsumerWindowSize(consumerWindowSize);
+ }
+
+ public void setConsumerMaxRate(int consumerMaxRate)
+ {
+ cf.setConsumerMaxRate(consumerMaxRate);
+ }
+
+ public void setConfirmationWindowSize(int confirmationWindowSize)
+ {
+ cf.setConfirmationWindowSize(confirmationWindowSize);
+ }
+
+ public void setProducerMaxRate(int producerMaxRate)
+ {
+ cf.setProducerMaxRate(producerMaxRate);
+ }
+
+ public int getProducerWindowSize()
+ {
+ return cf.getProducerWindowSize();
+ }
+
+ public void setProducerWindowSize(int producerWindowSize)
+ {
+ cf.setProducerWindowSize(producerWindowSize);
+ }
+
+ public void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient)
+ {
+ cf.setCacheLargeMessagesClient(cacheLargeMessagesClient);
+ }
+
+ public boolean isCacheLargeMessagesClient()
+ {
+ return cf.isCacheLargeMessagesClient();
+ }
+
+ public void setMinLargeMessageSize(int minLargeMessageSize)
+ {
+ cf.setMinLargeMessageSize(minLargeMessageSize);
+ }
+
+ public void setBlockOnNonDurableSend(boolean blockOnNonDurableSend)
+ {
+ cf.setBlockOnNonDurableSend(blockOnNonDurableSend);
+ }
+
+ public void setBlockOnAcknowledge(boolean blockOnAcknowledge)
+ {
+ cf.setBlockOnAcknowledge(blockOnAcknowledge);
+ }
+
+ public void setBlockOnDurableSend(boolean blockOnDurableSend)
+ {
+ cf.setBlockOnDurableSend(blockOnDurableSend);
+ }
+
+ public void setAutoGroup(boolean autoGroup)
+ {
+ cf.setAutoGroup(autoGroup);
+ }
+
+ public void setPreAcknowledge(boolean preAcknowledge)
+ {
+ cf.setPreAcknowledge(preAcknowledge);
+ }
+
+ public void setMaxRetryInterval(long retryInterval)
+ {
+ cf.setMaxRetryInterval(retryInterval);
+ }
+
+ public void setRetryIntervalMultiplier(double retryIntervalMultiplier)
+ {
+ cf.setRetryIntervalMultiplier(retryIntervalMultiplier);
+ }
+
+ public void setReconnectAttempts(int reconnectAttempts)
+ {
+ cf.setReconnectAttempts(reconnectAttempts);
+ }
+
+ public void setFailoverOnServerShutdown(boolean failoverOnServerShutdown)
+ {
+ cf.setFailoverOnServerShutdown(failoverOnServerShutdown);
+ }
+
+ public boolean isUseGlobalPools()
+ {
+ return cf.isUseGlobalPools();
+ }
+
+ public void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)
+ {
+ cf.setScheduledThreadPoolMaxSize(scheduledThreadPoolMaxSize);
+ }
+
+ public int getThreadPoolMaxSize()
+ {
+ return cf.getThreadPoolMaxSize();
+ }
+
+ public void setThreadPoolMaxSize(int threadPoolMaxSize)
+ {
+ cf.setThreadPoolMaxSize(threadPoolMaxSize);
+ }
+
+ public int getInitialMessagePacketSize()
+ {
+ return cf.getInitialMessagePacketSize();
+ }
+
+ public void setGroupID(String groupID)
+ {
+ cf.setGroupID(groupID);
+ }
+
+ public String getGroupID()
+ {
+ return cf.getGroupID();
+ }
+
+ public void setInitialMessagePacketSize(int size)
+ {
+ cf.setInitialMessagePacketSize(size);
+ }
+
+ public void setUseGlobalPools(boolean useGlobalPools)
+ {
+ cf.setUseGlobalPools(useGlobalPools);
+ }
+
+ public int getScheduledThreadPoolMaxSize()
+ {
+ return cf.getScheduledThreadPoolMaxSize();
+ }
+
+ public void setRetryInterval(long retryInterval)
+ {
+ cf.setRetryInterval(retryInterval);
+ }
+
+ public long getMaxRetryInterval()
+ {
+ return cf.getMaxRetryInterval();
+ }
+
+ public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
+ {
+ cf.setConnectionLoadBalancingPolicyClassName(connectionLoadBalancingPolicyClassName);
+ }
+
+ public List<Pair<TransportConfiguration, TransportConfiguration>> getStaticConnectors()
+ {
+ return cf.getStaticConnectors();
+ }
+
+ public void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors)
+ {
+ cf.setStaticConnectors(staticConnectors);
+ }
+
+ public String getDiscoveryAddress()
+ {
+ return cf.getDiscoveryAddress();
+ }
+
+ public void setDiscoveryAddress(String discoveryAddress)
+ {
+ cf.setDiscoveryAddress(discoveryAddress);
+ }
+
+ public int getDiscoveryPort()
+ {
+ return cf.getDiscoveryPort();
+ }
+
+ public void setDiscoveryPort(int discoveryPort)
+ {
+ cf.setDiscoveryPort(discoveryPort);
+ }
+
public long getCallTimeout()
{
return cf.getCallTimeout();
@@ -144,7 +387,7 @@
return cf.isFailoverOnServerShutdown();
}
- public long getMinLargeMessageSize()
+ public int getMinLargeMessageSize()
{
return cf.getMinLargeMessageSize();
}
@@ -159,7 +402,7 @@
return cf.getRetryIntervalMultiplier();
}
- public long getTransactionBatchSize()
+ public int getTransactionBatchSize()
{
return cf.getTransactionBatchSize();
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-02-18 23:12:11 UTC (rev 8889)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -148,56 +148,33 @@
// Public --------------------------------------------------------
// JMSServerControlMBean implementation --------------------------
-
public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
final Object[] jndiBindings) throws Exception
{
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
- server.createConnectionFactory(name, pairs, jndiBindingsList);
+ server.createConnectionFactory(name, liveTC, 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);
+ server.createConnectionFactory(name, pairs, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
@@ -207,7 +184,6 @@
final String liveTransportParams,
final String backupTransportClassNames,
final String backupTransportParams,
- final String clientID,
final String jndiBindings) throws Exception
{
Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
@@ -215,173 +191,19 @@
Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
- createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
+ 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 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);
+ server.createConnectionFactory(name, discoveryAddress, discoveryPort, jndiBindingsList);
sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
}
@@ -389,250 +211,14 @@
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);
+ createConnectionFactory(name, discoveryAddress, discoveryPort, 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);
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-02-18 23:12:11 UTC (rev 8889)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -208,99 +208,6 @@
Assert.assertEquals(0, control.getTopicNames().length);
}
- public void testCreateConnectionFactory_1() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
-
- control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), bindings);
- }
- });
- }
-
- public void testCreateConnectionFactory_1b() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String jndiBindings = JMSServerControlTest.toCSV(bindings);
- String params = "\"" + TransportConstants.SERVER_ID_PROP_NAME + "\"=1";
-
- control.createConnectionFactory(cfName, InVMConnectorFactory.class.getName(), params, jndiBindings);
- }
- });
- }
-
- public void testCreateConnectionFactory_2() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
-
- control.createConnectionFactory(cfName,
- tcLive.getFactoryClassName(),
- tcLive.getParams(),
- clientID,
- bindings);
- }
- });
- }
-
- public void testCreateConnectionFactory_2b() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- String jndiBindings = JMSServerControlTest.toCSV(bindings);
- String params = "\"" + TransportConstants.SERVER_ID_PROP_NAME + "\"=1";
-
- control.createConnectionFactory(cfName,
- InVMConnectorFactory.class.getName(),
- params,
- clientID,
- jndiBindings);
- }
- });
- }
-
- public void testCreateConnectionFactory_3() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
- TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
-
- control.createConnectionFactory(cfName,
- tcLive.getFactoryClassName(),
- tcLive.getParams(),
- tcBackup.getFactoryClassName(),
- tcBackup.getParams(),
- bindings);
- }
- });
- }
-
public void testCreateConnectionFactory_3b() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -344,52 +251,7 @@
});
}
- public void testCreateConnectionFactory_4() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
- TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
- control.createConnectionFactory(cfName,
- tcLive.getFactoryClassName(),
- tcLive.getParams(),
- tcBackup.getFactoryClassName(),
- tcBackup.getParams(),
- clientID,
- bindings);
- }
- });
- }
-
- // with 1 live and 1 backup
- public void testCreateConnectionFactory_4b() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- String jndiBindings = JMSServerControlTest.toCSV(bindings);
-
- control.createConnectionFactory(cfName,
- InVMConnectorFactory.class.getName(),
- TransportConstants.SERVER_ID_PROP_NAME + "=0",
- InVMConnectorFactory.class.getName(),
- TransportConstants.SERVER_ID_PROP_NAME + "=1",
- clientID,
- jndiBindings);
- }
- });
- }
-
public void testCreateConnectionFactory_5() throws Exception
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -411,217 +273,9 @@
});
}
- public void testCreateConnectionFactory_6() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
- TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
- control.createConnectionFactory(cfName,
- new Object[] { tcLive.getFactoryClassName() },
- new Object[] { tcLive.getParams() },
- new Object[] { tcBackup.getFactoryClassName() },
- new Map[] { tcBackup.getParams() },
- clientID,
- bindings);
- }
- });
- }
- public void testCreateConnectionFactory_7() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
- TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
- control.createConnectionFactory(cfName,
- new Object[] { tcLive.getFactoryClassName() },
- new Object[] { tcLive.getParams() },
- new Object[] { tcBackup.getFactoryClassName() },
- new Object[] { tcBackup.getParams() },
- clientID,
- HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
- HornetQClient.DEFAULT_CONNECTION_TTL,
- HornetQClient.DEFAULT_CALL_TIMEOUT,
- HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT,
- HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
- HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
- HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
- HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE,
- HornetQClient.DEFAULT_PRODUCER_WINDOW_SIZE,
- HornetQClient.DEFAULT_PRODUCER_MAX_RATE,
- HornetQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE,
- HornetQClient.DEFAULT_BLOCK_ON_DURABLE_SEND,
- HornetQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND,
- HornetQClient.DEFAULT_AUTO_GROUP,
- HornetQClient.DEFAULT_PRE_ACKNOWLEDGE,
- HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
- HornetQClient.DEFAULT_ACK_BATCH_SIZE,
- HornetQClient.DEFAULT_ACK_BATCH_SIZE,
- HornetQClient.DEFAULT_USE_GLOBAL_POOLS,
- HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
- HornetQClient.DEFAULT_THREAD_POOL_MAX_SIZE,
- HornetQClient.DEFAULT_RETRY_INTERVAL,
- HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
- HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
- HornetQClient.DEFAULT_RECONNECT_ATTEMPTS,
- HornetQClient.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN,
- null,
- bindings);
- }
- });
- }
-
- public void testCreateConnectionFactory_7b() throws Exception
- {
- doCreateConnectionFactory(new ConnectionFactoryCreator()
- {
- public void createConnectionFactory(final JMSServerControl control,
- final String cfName,
- final Object[] bindings) throws Exception
- {
- String clientID = RandomUtil.randomString();
- String jndiBindings = JMSServerControlTest.toCSV(bindings);
-
- control.createConnectionFactory(cfName,
- InVMConnectorFactory.class.getName(),
- "",
- InVMConnectorFactory.class.getName(),
- TransportConstants.SERVER_ID_PROP_NAME + "=1",
- clientID,
- HornetQClient.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
- HornetQClient.DEFAULT_CONNECTION_TTL,
- HornetQClient.DEFAULT_CALL_TIMEOUT,
- HornetQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT,
- HornetQClient.DEFAULT_MIN_LARGE_MESSAGE_SIZE,
- HornetQClient.DEFAULT_CONSUMER_WINDOW_SIZE,
- HornetQClient.DEFAULT_CONSUMER_MAX_RATE,
- HornetQClient.DEFAULT_CONFIRMATION_WINDOW_SIZE,
- HornetQClient.DEFAULT_PRODUCER_WINDOW_SIZE,
- HornetQClient.DEFAULT_PRODUCER_MAX_RATE,
- HornetQClient.DEFAULT_BLOCK_ON_ACKNOWLEDGE,
- HornetQClient.DEFAULT_BLOCK_ON_DURABLE_SEND,
- HornetQClient.DEFAULT_BLOCK_ON_NON_DURABLE_SEND,
- HornetQClient.DEFAULT_AUTO_GROUP,
- HornetQClient.DEFAULT_PRE_ACKNOWLEDGE,
- HornetQClient.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME,
- HornetQClient.DEFAULT_ACK_BATCH_SIZE,
- HornetQClient.DEFAULT_ACK_BATCH_SIZE,
- HornetQClient.DEFAULT_USE_GLOBAL_POOLS,
- HornetQClient.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE,
- HornetQClient.DEFAULT_THREAD_POOL_MAX_SIZE,
- HornetQClient.DEFAULT_RETRY_INTERVAL,
- HornetQClient.DEFAULT_RETRY_INTERVAL_MULTIPLIER,
- HornetQClient.DEFAULT_MAX_RETRY_INTERVAL,
- HornetQClient.DEFAULT_RECONNECT_ATTEMPTS,
- HornetQClient.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN,
- null,
- jndiBindings);
- }
- });
- }
-
- public void _testCreateConnectionFactoryWithDiscoveryGroup() throws Exception
- {
- String[] cfJNDIBindings = new String[] { RandomUtil.randomString(),
- RandomUtil.randomString(),
- RandomUtil.randomString() };
- String cfName = RandomUtil.randomString();
- String clientID = RandomUtil.randomString();
-
- // restart the server with a discovery group configuration
- serverManager.stop();
- startHornetQServer(8765);
-
- for (String cfJNDIBinding : cfJNDIBindings)
- {
- UnitTestCase.checkNoBinding(context, cfJNDIBinding);
- }
-
- JMSServerControl control = createManagementControl();
-
- control.createConnectionFactory(cfName, "231.7.7.7", 8765, clientID, cfJNDIBindings);
-
- for (String cfJNDIBinding : cfJNDIBindings)
- {
- Object o = UnitTestCase.checkBinding(context, cfJNDIBinding);
- Assert.assertTrue(o instanceof ConnectionFactory);
- ConnectionFactory cf = (ConnectionFactory)o;
- Connection connection = cf.createConnection();
- connection.close();
- }
- }
-
- public void testDestroyConnectionFactory() throws Exception
- {
- String[] cfJNDIBindings = new String[] { RandomUtil.randomString(),
- RandomUtil.randomString(),
- RandomUtil.randomString() };
- String cfName = RandomUtil.randomString();
-
- for (String cfJNDIBinding : cfJNDIBindings)
- {
- UnitTestCase.checkNoBinding(context, cfJNDIBinding);
- }
-
- JMSServerControl control = createManagementControl();
-
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
-
- control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), cfJNDIBindings);
-
- for (String cfJNDIBinding : cfJNDIBindings)
- {
- Object o = UnitTestCase.checkBinding(context, cfJNDIBinding);
- Assert.assertTrue(o instanceof ConnectionFactory);
- ConnectionFactory cf = (ConnectionFactory)o;
- Connection connection = cf.createConnection();
- connection.close();
- }
-
- control.destroyConnectionFactory(cfName);
-
- for (String cfJNDIBinding : cfJNDIBindings)
- {
- UnitTestCase.checkNoBinding(context, cfJNDIBinding);
- }
-
- }
-
- public void testGetConnectionFactoryNames() throws Exception
- {
- String cfBinding = RandomUtil.randomString();
- String cfName = RandomUtil.randomString();
-
- JMSServerControl control = createManagementControl();
- Assert.assertEquals(0, control.getConnectionFactoryNames().length);
-
- TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
- control.createConnectionFactory(cfName,
- tcLive.getFactoryClassName(),
- tcLive.getParams(),
- new String[] { cfBinding });
-
- String[] cfNames = control.getConnectionFactoryNames();
- Assert.assertEquals(1, cfNames.length);
- Assert.assertEquals(cfName, cfNames[0]);
-
- control.destroyConnectionFactory(cfName);
- Assert.assertEquals(0, control.getConnectionFactoryNames().length);
- }
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
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-02-18 23:12:11 UTC (rev 8889)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-02-20 10:17:41 UTC (rev 8890)
@@ -20,6 +20,7 @@
import javax.jms.Session;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.JMSServerControl;
@@ -90,329 +91,37 @@
return new JMSServerControl()
{
- 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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- discoveryAddress,
- discoveryPort,
- clientID,
- 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,
- jndiBindings);
- }
- 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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- discoveryAddress,
- discoveryPort,
- clientID,
- 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,
- jndiBindings);
- }
public void createConnectionFactory(final String name,
final String discoveryAddress,
final int discoveryPort,
- final String clientID,
final Object[] jndiBindings) throws Exception
{
proxy.invokeOperation("createConnectionFactory",
name,
discoveryAddress,
discoveryPort,
- clientID,
jndiBindings);
}
public void createConnectionFactory(final String name,
final String discoveryAddress,
final int discoveryPort,
- final String clientID,
final String jndiBindings) throws Exception
{
proxy.invokeOperation("createConnectionFactory",
name,
discoveryAddress,
discoveryPort,
- clientID,
jndiBindings);
}
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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- backupTransportClassName,
- backupTransportParams,
- clientID,
- jndiBindings);
- }
-
- 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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassNames,
- liveTransportParams,
- backupTransportClassNames,
- backupTransportParams,
- clientID,
- jndiBindings);
- }
-
- 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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- backupTransportClassName,
- backupTransportParams,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassNames,
- final String liveTransportParams,
- final String backupTransportClassNames,
- final String backupTransportParams,
- final String jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassNames,
- liveTransportParams,
- backupTransportClassNames,
- backupTransportParams,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- clientID,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final String liveTransportParams,
- final String clientID,
- final String jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- clientID,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final String liveTransportParams,
- final String jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveTransportClassName,
- liveTransportParams,
- jndiBindings);
- }
-
- 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
{
proxy.invokeOperation("createConnectionFactory",
@@ -421,145 +130,25 @@
liveConnectorTransportParams,
backupConnectorsTransportClassNames,
backupConnectorTransportParams,
- 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,
jndiBindings);
-
}
- public void createConnectionFactory(final String name,
- final String liveConnectorsTransportClassNames,
- final String liveConnectorTransportParams,
- final String backupConnectorsTransportClassNames,
- final String 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 String jndiBindings) throws Exception
+ public void createConnectionFactory(String name,
+ String liveTransportClassNames,
+ String liveTransportParams,
+ String backupTransportClassNames,
+ String backupTransportParams,
+ String jndiBindings) throws Exception
{
proxy.invokeOperation("createConnectionFactory",
- name,
- liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams,
- 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,
- jndiBindings);
-
+ name,
+ liveTransportClassNames,
+ liveTransportParams,
+ backupTransportClassNames,
+ backupTransportParams,
+ jndiBindings);
}
- 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
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams,
- clientID,
- jndiBindings);
- }
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- proxy.invokeOperation("createConnectionFactory",
- name,
- liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams,
- jndiBindings);
- }
-
public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
{
return (Boolean)proxy.invokeOperation("closeConnectionsForAddress", ipAddress);
15 years
JBoss hornetq SVN: r8889 - trunk/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-02-18 18:12:11 -0500 (Thu, 18 Feb 2010)
New Revision: 8889
Modified:
trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java
Log:
tweak
Modified: trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java 2010-02-18 23:10:06 UTC (rev 8888)
+++ trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java 2010-02-18 23:12:11 UTC (rev 8889)
@@ -48,10 +48,13 @@
server.start();
ClientSessionFactory factory = createInVMFactory();
- ClientSession session = factory.createSession();
+ ClientSession session = null;
try
{
+
+ session = factory.createSession();
+
session.createQueue("queue", "queue");
ClientProducer prod = session.createProducer("queue");
@@ -93,7 +96,12 @@
}
finally
{
- session.close();
+ if (session != null)
+ {
+ session.close();
+ }
+
+ factory.close();
server.stop();
}
}
15 years
JBoss hornetq SVN: r8888 - trunk/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-02-18 18:10:06 -0500 (Thu, 18 Feb 2010)
New Revision: 8888
Added:
trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java
Log:
I've created a simple test on core selectors as I wanted to double check my answer before answering the forums today. Well.. why not commit the test then? you can never have enough tests, right?
Added: trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java (rev 0)
+++ trunk/tests/src/org/hornetq/tests/integration/client/CoreSelectorTest.java 2010-02-18 23:10:06 UTC (rev 8888)
@@ -0,0 +1,109 @@
+/*
+ * 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.tests.integration.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.core.server.HornetQServer;
+import org.hornetq.tests.util.ServiceTestBase;
+
+/**
+ * A CoreSelectorTest
+ *
+ * @author <mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ *
+ *
+ */
+public class CoreSelectorTest extends ServiceTestBase
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // Public --------------------------------------------------------
+
+ public void testSelector() throws Exception
+ {
+ HornetQServer server = createServer(false, false);
+
+ server.start();
+
+ ClientSessionFactory factory = createInVMFactory();
+ ClientSession session = factory.createSession();
+
+ try
+ {
+ session.createQueue("queue", "queue");
+ ClientProducer prod = session.createProducer("queue");
+
+
+ ClientMessage msg = session.createMessage(false);
+ msg.putIntProperty("intValue", 1);
+
+ msg.putIntProperty("intValue", 1);
+ msg.putBytesProperty("bValue", new byte[]{'1'});
+
+ prod.send(msg);
+
+ msg = session.createMessage(false);
+ msg.putIntProperty("intValue", 2);
+
+ session.start();
+
+ ClientConsumer cons = session.createConsumer("queue", "bValue=1");
+
+ assertNull(cons.receiveImmediate());
+
+ cons.close();
+
+ cons = session.createConsumer("queue", "intValue=1");
+
+ msg = cons.receive(5000);
+
+ assertNotNull(msg);
+
+ assertEquals(1, (int)msg.getIntProperty("intValue"));
+
+ assertNull(cons.receiveImmediate());
+
+
+
+
+
+
+ }
+ finally
+ {
+ session.close();
+ server.stop();
+ }
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
15 years
JBoss hornetq SVN: r8887 - trunk/tests/src/org/hornetq/tests/integration/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-02-17 20:34:11 -0500 (Wed, 17 Feb 2010)
New Revision: 8887
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
Log:
fixing build / test
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-02-17 22:17:06 UTC (rev 8886)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlUsingCoreTest.java 2010-02-18 01:34:11 UTC (rev 8887)
@@ -143,162 +143,6 @@
session.deleteQueue(queue);
}
- public void testAddRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] roles = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, roles.length);
-
- proxy.invokeOperation("addRole",
- role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- roles = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, roles.length);
- Object[] r = (Object[])roles[0];
- Assert.assertEquals(role.getName(), r[0]);
- Assert.assertEquals(CheckType.SEND.hasRole(role), r[1]);
- Assert.assertEquals(CheckType.CONSUME.hasRole(role), r[2]);
- Assert.assertEquals(CheckType.CREATE_DURABLE_QUEUE.hasRole(role), r[3]);
- Assert.assertEquals(CheckType.DELETE_DURABLE_QUEUE.hasRole(role), r[4]);
- Assert.assertEquals(CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role), r[5]);
- Assert.assertEquals(CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role), r[6]);
- Assert.assertEquals(CheckType.MANAGE.hasRole(role), r[7]);
-
- session.deleteQueue(queue);
- }
-
- public void testAddRoleWhichAlreadyExists() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- proxy.invokeOperation("addRole",
- role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.length);
-
- try
- {
- proxy.invokeOperation("addRole",
- role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
- Assert.fail("can not add a role which already exists");
- }
- catch (Exception e)
- {
- }
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- proxy.invokeOperation("addRole",
- roleName,
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(1, data.length);
-
- proxy.invokeOperation("removeRole", roleName);
-
- data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRoleWhichDoesNotExist() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- CoreMessagingProxy proxy = createProxy(address);
- Object[] data = (Object[])proxy.retrieveAttributeValue("roles");
- Assert.assertEquals(0, data.length);
-
- try
- {
- proxy.invokeOperation("removeRole", roleName);
- Assert.fail("can not remove a role which does not exist");
- }
- catch (Exception e)
- {
- }
-
- session.deleteQueue(queue);
- }
-
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
15 years
JBoss hornetq SVN: r8886 - trunk/tests/src/org/hornetq/tests/integration/management.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-02-17 17:17:06 -0500 (Wed, 17 Feb 2010)
New Revision: 8886
Modified:
trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
Log:
Integration work
Modified: trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-02-17 22:13:31 UTC (rev 8885)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AddressControlTest.java 2010-02-17 22:17:06 UTC (rev 8886)
@@ -177,158 +177,6 @@
session.deleteQueue(queue);
}
- public void testAddRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] roles = addressControl.getRoles();
- Assert.assertEquals(0, roles.length);
-
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- roles = addressControl.getRoles();
- Assert.assertEquals(1, roles.length);
- Object[] r = (Object[])roles[0];
- Assert.assertEquals(role.getName(), r[0]);
- Assert.assertEquals(CheckType.SEND.hasRole(role), r[1]);
- Assert.assertEquals(CheckType.CONSUME.hasRole(role), r[2]);
- Assert.assertEquals(CheckType.CREATE_DURABLE_QUEUE.hasRole(role), r[3]);
- Assert.assertEquals(CheckType.DELETE_DURABLE_QUEUE.hasRole(role), r[4]);
- Assert.assertEquals(CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role), r[5]);
- Assert.assertEquals(CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role), r[6]);
- Assert.assertEquals(CheckType.MANAGE.hasRole(role), r[7]);
-
- session.deleteQueue(queue);
- }
-
- public void testAddRoleWhichAlreadyExists() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- Role role = new Role(RandomUtil.randomString(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- try
- {
- addressControl.addRole(role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role));
- Assert.fail("can not add a role which already exists");
- }
- catch (Exception e)
- {
- }
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRole() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- addressControl.addRole(roleName,
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean(),
- RandomUtil.randomBoolean());
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(1, tabularData.length);
-
- addressControl.removeRole(roleName);
-
- tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- session.deleteQueue(queue);
- }
-
- public void testRemoveRoleWhichDoesNotExist() throws Exception
- {
- SimpleString address = RandomUtil.randomSimpleString();
- SimpleString queue = RandomUtil.randomSimpleString();
- String roleName = RandomUtil.randomString();
-
- session.createQueue(address, queue, true);
-
- AddressControl addressControl = createManagementControl(address);
- Object[] tabularData = addressControl.getRoles();
- Assert.assertEquals(0, tabularData.length);
-
- try
- {
- addressControl.removeRole(roleName);
- Assert.fail("can not remove a role which does not exist");
- }
- catch (Exception e)
- {
- }
-
- session.deleteQueue(queue);
- }
-
public void testGetNumberOfPages() throws Exception
{
session.close();
15 years