JBoss hornetq SVN: r11481 - in branches/Branch_2_2_EAP/src/main/org/hornetq: utils and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 16:27:03 -0400 (Thu, 06 Oct 2011)
New Revision: 11481
Added:
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java
Log:
Back porting HORNETQ-681
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java 2011-10-06 19:51:38 UTC (rev 11480)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/core/logging/Logger.java 2011-10-06 20:27:03 UTC (rev 11481)
@@ -19,6 +19,7 @@
import org.hornetq.core.logging.impl.JULLogDelegateFactory;
import org.hornetq.spi.core.logging.LogDelegate;
import org.hornetq.spi.core.logging.LogDelegateFactory;
+import org.hornetq.utils.ClassloadingUtil;
/**
*
@@ -80,16 +81,7 @@
if (className != null)
{
- ClassLoader loader = Thread.currentThread().getContextClassLoader();
- try
- {
- Class<?> clz = loader.loadClass(className);
- delegateFactory = (LogDelegateFactory)clz.newInstance();
- }
- catch (Exception e)
- {
- throw new IllegalArgumentException("Error instantiating transformer class \"" + className + "\"", e);
- }
+ delegateFactory = (LogDelegateFactory) ClassloadingUtil.safeInitNewInstance(className);
}
else
{
Added: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java (rev 0)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ClassloadingUtil.java 2011-10-06 20:27:03 UTC (rev 11481)
@@ -0,0 +1,79 @@
+package org.hornetq.utils;
+
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+* A ClassloadingUtil *
+* @author <a href="mailto:hgao@redhat.com">Howard Gao</a>
+*/
+
+public class ClassloadingUtil
+{
+ public static Object safeInitNewInstance(final String className)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ ClassLoader loader = ClassloadingUtil.class.getClassLoader();
+ try
+ {
+ Class<?> clazz = loader.loadClass(className);
+ return clazz.newInstance();
+ }
+ catch (Throwable t)
+ {
+ try
+ {
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader != null)
+ return loader.loadClass(className).newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ }
+
+ throw new IllegalArgumentException("Could not find class " + className);
+ }
+ }
+ });
+ }
+
+ public static URL findResource(final String resourceName)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<URL>()
+ {
+ public URL run()
+ {
+ ClassLoader loader = ClassloadingUtil.class.getClassLoader();
+ try
+ {
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+ }
+ catch (Throwable t)
+ {
+ }
+
+ loader = Thread.currentThread().getContextClassLoader();
+ if (loader == null)
+ return null;
+
+ URL resource = loader.getResource(resourceName);
+ if (resource != null)
+ return resource;
+
+ return null;
+ }
+ });
+ }
+
+}
+
13 years, 2 months
JBoss hornetq SVN: r11480 - branches/Branch_2_2_EAP/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 15:51:38 -0400 (Thu, 06 Oct 2011)
New Revision: 11480
Modified:
branches/Branch_2_2_EAP/docs/user-manual/en/configuring-transports.xml
branches/Branch_2_2_EAP/docs/user-manual/en/interoperability.xml
Log:
little adjustments to docs
Modified: branches/Branch_2_2_EAP/docs/user-manual/en/configuring-transports.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/user-manual/en/configuring-transports.xml 2011-10-06 19:31:54 UTC (rev 11479)
+++ branches/Branch_2_2_EAP/docs/user-manual/en/configuring-transports.xml 2011-10-06 19:51:38 UTC (rev 11480)
@@ -16,7 +16,6 @@
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
-
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "HornetQ_User_Manual.ent">
%BOOK_ENTITIES;
@@ -295,6 +294,22 @@
parameter is <literal>-1</literal> which means use the value from <literal
>Runtime.getRuntime().availableProcessors()</literal> * 3.</para>
</listitem>
+ <listitem>
+ <para><literal>cluster-connection</literal>. If you define more than one cluster
+ connection, you may define what cluster connection will be used to notify
+ topologies. This will be very useful when you are playing with multiple
+ network interface cards (NIC) and need to isolate the cluster
+ definitions.</para>
+ <para>The default value is the first cluster connection defined at the main
+ configuration.</para>
+ </listitem>
+ <listitem>
+ <para><literal>stomp-consumer-credits</literal>. When consuming messages in stomp, the server will flow control the channel
+ as messages are acknowledged. The default value is 10K. The server won't send more messages than 10K bytes until you ack more messages.
+ </para>
+ <para>Notice that if you use auto-ack subscriptions on stomp, you have to consume as fast as you can on your client,
+ or you may flood the channels on Netty what will lead to OutOfMemory errors.</para>
+ </listitem>
</itemizedlist>
</section>
<section>
Modified: branches/Branch_2_2_EAP/docs/user-manual/en/interoperability.xml
===================================================================
--- branches/Branch_2_2_EAP/docs/user-manual/en/interoperability.xml 2011-10-06 19:31:54 UTC (rev 11479)
+++ branches/Branch_2_2_EAP/docs/user-manual/en/interoperability.xml 2011-10-06 19:51:38 UTC (rev 11480)
@@ -16,160 +16,174 @@
<!-- and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent -->
<!-- permitted by applicable law. -->
<!-- ============================================================================= -->
-
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "HornetQ_User_Manual.ent">
%BOOK_ENTITIES;
]>
<chapter id="interoperability">
- <title>Interoperability</title>
- <section id="stomp">
- <title>Stomp</title>
- <para><ulink url="http://stomp.codehaus.org/">Stomp</ulink> is a text-orientated wire protocol that allows
- Stomp clients to communicate with Stomp Brokers.</para>
- <para><ulink url="http://stomp.codehaus.org/Clients">Stomp clients</ulink> are available for
- several languages and platforms making it a good choice for interoperability.</para>
- <section id="stomp.native">
- <title>Native Stomp support</title>
- <para>HornetQ provides native support for Stomp. To be able to send and receive Stomp messages,
- you must configure a <literal>NettyAcceptor</literal> with a <literal>protocol</literal>
- parameter set to <literal>stomp</literal>:</para>
-<programlisting>
+ <title>Interoperability</title>
+ <section id="stomp">
+ <title>Stomp</title>
+ <para><ulink url="http://stomp.codehaus.org/">Stomp</ulink> is a text-orientated wire protocol
+ that allows Stomp clients to communicate with Stomp Brokers.</para>
+ <para><ulink url="http://stomp.codehaus.org/Clients">Stomp clients</ulink> are available for
+ several languages and platforms making it a good choice for interoperability.</para>
+ <section id="stomp.native">
+ <title>Native Stomp support</title>
+ <para>HornetQ provides native support for Stomp. To be able to send and receive Stomp
+ messages, you must configure a <literal>NettyAcceptor</literal> with a <literal
+ >protocol</literal> parameter set to <literal>stomp</literal>:</para>
+ <programlisting>
<acceptor name="stomp-acceptor">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocol" value="stomp"/>
<param key="port" value="61613"/>
</acceptor>
</programlisting>
- <para>With this configuration, HornetQ will accept Stomp connections on
- the port <literal>61613</literal> (which is the default port of the Stomp brokers).</para>
- <para>See the <literal>stomp</literal> example which shows how to configure a HornetQ server with Stomp.</para>
- <section>
- <title>Limitations</title>
- <para>Message acknowledgements are not transactional. The ACK frame can not be part of a transaction
- (it will be ignored if its <literal>transaction</literal> header is set).</para>
- </section>
- </section>
-
- <section>
- <title>Mapping Stomp destinations to HornetQ addresses and queues</title>
- <para>Stomp clients deals with <emphasis>destinations</emphasis> when sending messages and subscribing.
- Destination names are simply strings which are mapped to some form of destination on the
- server - how the server translates these is left to the server implementation.</para>
- <para>In HornetQ, these destinations are mapped to <emphasis>addresses</emphasis> and <emphasis>queues</emphasis>.
- When a Stomp client sends a message (using a <literal>SEND</literal> frame), the specified destination is mapped
- 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>
+ <para>With this configuration, HornetQ will accept Stomp connections on the port <literal
+ >61613</literal> (which is the default port of the Stomp brokers).</para>
+ <para>See the <literal>stomp</literal> example which shows how to configure a HornetQ server
+ with Stomp.</para>
<section>
- <title>STOMP and connection-ttl</title>
- <para>Well behaved STOMP clients will always send a DISCONNECT frame before closing their connections. In this case the server
- will clear up any server side resources such as sessions and consumers synchronously. However if STOMP clients exit without
- sending a DISCONNECT frame or if they crash the server will have no way of knowing immediately whether the client is still alive
- or not. STOMP connections therefore default to a connection-ttl value of 1 minute (see chapter on <link linkend="connection-ttl"
- >connection-ttl</link> for more information. This value can be overridden using connection-ttl-override.
- </para>
- <note><para>Please note that the STOMP protocol does not contain any heartbeat frame. It is therefore the user's responsibility to make sure
- data is sent within connection-ttl or the server will assume the client is dead and clean up server side resources.</para></note>
+ <title>Flow control</title>
+ <para>When consuming messages in stomp, it's preferrable to use Acknowledge consumers,
+ otherwise the server will send messages as fast as it can to the client (i.e. no flow
+ control). Refer to the parameter stomp-consumer-credits for more information.</para>
</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>
- <programlisting>
+ <section>
+ <title>Limitations</title>
+ <para>Message acknowledgements are not transactional. The ACK frame can not be part of a
+ transaction (it will be ignored if its <literal>transaction</literal> header is
+ set).</para>
+ </section>
+ </section>
+ <section>
+ <title>Mapping Stomp destinations to HornetQ addresses and queues</title>
+ <para>Stomp clients deals with <emphasis>destinations</emphasis> when sending messages and
+ subscribing. Destination names are simply strings which are mapped to some form of
+ destination on the server - how the server translates these is left to the server
+ implementation.</para>
+ <para>In HornetQ, these destinations are mapped to <emphasis>addresses</emphasis> and
+ <emphasis>queues</emphasis>. When a Stomp client sends a message (using a <literal
+ >SEND</literal> frame), the specified destination is mapped 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>
+ <section>
+ <title>STOMP and connection-ttl</title>
+ <para>Well behaved STOMP clients will always send a DISCONNECT frame before closing their
+ connections. In this case the server will clear up any server side resources such as
+ sessions and consumers synchronously. However if STOMP clients exit without sending a
+ DISCONNECT frame or if they crash the server will have no way of knowing immediately whether
+ the client is still alive or not. STOMP connections therefore default to a connection-ttl
+ value of 1 minute (see chapter on <link linkend="connection-ttl">connection-ttl</link> for
+ more information. This value can be overridden using connection-ttl-override. </para>
+ <note>
+ <para>Please note that the STOMP protocol does not contain any heartbeat frame. It is
+ therefore the user's responsibility to make sure data is sent within connection-ttl or the
+ server will assume the client is dead and clean up server side resources.</para>
+ </note>
+ </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>
+ <programlisting>
SEND
destination:jms.queue.orders
hello queue orders
^@
</programlisting>
- </listitem>
- <listitem>
- <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>
+ </listitem>
+ <listitem>
+ <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
^@
</programlisting>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Send and consuming Stomp message from JMS or HornetQ Core API</title>
- <para>Stomp is mainly a text-orientated protocol. To make it simpler to interoperate with JMS and HornetQ Core API,
- our Stomp implementation checks for presence of the <literal>content-length</literal> header to decide how to map a Stomp message
- to a JMS Message or a Core message.
- </para>
- <para>If the Stomp message does <emphasis>not</emphasis> have a <literal>content-length</literal> header, it will be mapped to a JMS <emphasis>TextMessage</emphasis>
- or a Core message with a <emphasis>single nullable SimpleString in the body buffer</emphasis>.</para>
- <para>Alternatively, if the Stomp message <emphasis>has</emphasis> a <literal>content-length</literal> header,
- it will be mapped to a JMS <emphasis>BytesMessage</emphasis>
- or a Core message with a <emphasis>byte[] in the body buffer</emphasis>.</para>
- <para>The same logic applies when mapping a JMS message or a Core message to Stomp. A Stomp client can check the presence
- of the <literal>content-length</literal> header to determine the type of the message body (String or bytes).</para>
- </section>
- </section>
-
- <section id="stomp.websockets">
- <title>Stomp Over Web Sockets</title>
- <para>HornetQ also support Stomp over <ulink url="http://dev.w3.org/html5/websockets/">Web Sockets</ulink>. Modern web browser which support Web Sockets can send and receive
- Stomp messages from HornetQ.</para>
- <para>To enable Stomp over Web Sockets, you must configure a <literal>NettyAcceptor</literal> with a <literal>protocol</literal>
- parameter set to <literal>stomp_ws</literal>:</para>
- <programlisting>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Send and consuming Stomp message from JMS or HornetQ Core API</title>
+ <para>Stomp is mainly a text-orientated protocol. To make it simpler to interoperate with
+ JMS and HornetQ Core API, our Stomp implementation checks for presence of the <literal
+ >content-length</literal> header to decide how to map a Stomp message to a JMS Message
+ or a Core message. </para>
+ <para>If the Stomp message does <emphasis>not</emphasis> have a <literal
+ >content-length</literal> header, it will be mapped to a JMS
+ <emphasis>TextMessage</emphasis> or a Core message with a <emphasis>single nullable
+ SimpleString in the body buffer</emphasis>.</para>
+ <para>Alternatively, if the Stomp message <emphasis>has</emphasis> a <literal
+ >content-length</literal> header, it will be mapped to a JMS
+ <emphasis>BytesMessage</emphasis> or a Core message with a <emphasis>byte[] in the body
+ buffer</emphasis>.</para>
+ <para>The same logic applies when mapping a JMS message or a Core message to Stomp. A Stomp
+ client can check the presence of the <literal>content-length</literal> header to determine
+ the type of the message body (String or bytes).</para>
+ </section>
+ </section>
+ <section id="stomp.websockets">
+ <title>Stomp Over Web Sockets</title>
+ <para>HornetQ also support Stomp over <ulink url="http://dev.w3.org/html5/websockets/">Web
+ Sockets</ulink>. Modern web browser which support Web Sockets can send and receive Stomp
+ messages from HornetQ.</para>
+ <para>To enable Stomp over Web Sockets, you must configure a <literal>NettyAcceptor</literal>
+ with a <literal>protocol</literal> parameter set to <literal>stomp_ws</literal>:</para>
+ <programlisting>
<acceptor name="stomp-ws-acceptor">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocol" value="stomp_ws"/>
<param key="port" value="61614"/>
</acceptor>
</programlisting>
- <para>With this configuration, HornetQ will accept Stomp connections over Web Sockets on
- the port <literal>61614</literal> with the URL path <literal>/stomp</literal>.
- Web browser can then connect to <literal>ws://<server>:61614/stomp</literal> using a Web Socket to send and receive Stomp
- messages.</para>
- <para>A companion JavaScript library to ease client-side development is available from
- <ulink url="http://github.com/jmesnil/stomp-websocket">GitHub</ulink> (please see
- its <ulink url="http://jmesnil.net/stomp-websocket/doc/">documentation</ulink> for a complete description).</para>
- <para>The <literal>stomp-websockets</literal> example shows how to configure HornetQ server to have web browsers and Java
- applications exchanges messages on a JMS topic.</para>
- </section>
-
- <section id="stompconnect">
- <title>StompConnect</title>
- <para><ulink url="http://stomp.codehaus.org/StompConnect">StompConnect</ulink> is a server that
- can act as a Stomp broker and proxy the Stomp protocol to the standard JMS API.
- Consequently, using StompConnect it is possible to turn HornetQ into a Stomp Broker and
- use any of the available stomp clients. These include clients written in C, C++, c# and
- .net etc.</para>
- <para>To run StompConnect first start the HornetQ server and make sure that it is using
- JNDI.</para>
- <para>Stomp requires the file <literal>jndi.properties</literal> to be available on the
- classpath. This should look something like:</para>
- <programlisting>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+ <para>With this configuration, HornetQ will accept Stomp connections over Web Sockets on the
+ port <literal>61614</literal> with the URL path <literal>/stomp</literal>. Web browser can
+ then connect to <literal>ws://<server>:61614/stomp</literal> using a Web Socket to
+ send and receive Stomp messages.</para>
+ <para>A companion JavaScript library to ease client-side development is available from <ulink
+ url="http://github.com/jmesnil/stomp-websocket">GitHub</ulink> (please see its <ulink
+ url="http://jmesnil.net/stomp-websocket/doc/">documentation</ulink> for a complete
+ description).</para>
+ <para>The <literal>stomp-websockets</literal> example shows how to configure HornetQ server to
+ have web browsers and Java applications exchanges messages on a JMS topic.</para>
+ </section>
+ <section id="stompconnect">
+ <title>StompConnect</title>
+ <para><ulink url="http://stomp.codehaus.org/StompConnect">StompConnect</ulink> is a server
+ that can act as a Stomp broker and proxy the Stomp protocol to the standard JMS API.
+ Consequently, using StompConnect it is possible to turn HornetQ into a Stomp Broker and use
+ any of the available stomp clients. These include clients written in C, C++, c# and .net
+ etc.</para>
+ <para>To run StompConnect first start the HornetQ server and make sure that it is using
+ JNDI.</para>
+ <para>Stomp requires the file <literal>jndi.properties</literal> to be available on the
+ classpath. This should look something like:</para>
+ <programlisting>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</programlisting>
- <para>Make sure this file is in the classpath along with the StompConnect jar and the
- HornetQ jars and simply run <literal>java org.codehaus.stomp.jms.Main</literal>.</para>
- </section>
-
+ <para>Make sure this file is in the classpath along with the StompConnect jar and the HornetQ
+ jars and simply run <literal>java org.codehaus.stomp.jms.Main</literal>.</para>
</section>
- <section>
- <title>REST</title>
- <para>REST support coming soon!</para>
- </section>
- <section>
- <title>AMQP</title>
- <para>AMQP support coming soon!</para>
- </section>
+ </section>
+ <section>
+ <title>REST</title>
+ <para>Refer to HornetQ Rest Manual for more information.</para>
+ </section>
</chapter>
13 years, 2 months
JBoss hornetq SVN: r11479 - branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 15:31:54 -0400 (Thu, 06 Oct 2011)
New Revision: 11479
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
Log:
Back porting HORNETQ-750 as that's the right way to do it (the binding of JNDI)
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-10-06 19:15:23 UTC (rev 11478)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/jms/server/impl/JMSServerManagerImpl.java 2011-10-06 19:31:54 UTC (rev 11479)
@@ -103,11 +103,6 @@
private BindingRegistry registry;
- /**
- * the context to bind to
- */
- private Context context;
-
private Map<String, HornetQQueue> queues = new HashMap<String, HornetQQueue>();
private Map<String, HornetQTopic> topics = new HashMap<String, HornetQTopic>();
@@ -251,8 +246,9 @@
if (registry == null)
{
if (!contextSet)
- context = new InitialContext();
- registry = new JndiBindingRegistry(context);
+ {
+ registry = new JndiBindingRegistry(new InitialContext());
+ }
}
deploymentManager = new FileDeploymentManager(server.getConfiguration().getFileDeployerScanPeriod());
@@ -313,9 +309,9 @@
topicJNDI.clear();
topics.clear();
- if (context != null)
+ if (registry != null)
{
- context.close();
+ registry.close();
}
// it could be null if a backup
@@ -375,10 +371,9 @@
public synchronized void setContext(final Context context)
{
- this.context = context;
-
- if (registry != null && registry instanceof JndiBindingRegistry)
+ if (registry == null || registry instanceof JndiBindingRegistry)
{
+ registry = new JndiBindingRegistry(context);
registry.setContext(context);
}
@@ -1456,7 +1451,7 @@
*/
private void unbindJNDI(Map<String, List<String>> param)
{
- if (context != null)
+ if (registry != null)
{
for (List<String> elementList : param.values())
{
@@ -1464,7 +1459,7 @@
{
try
{
- context.unbind(key);
+ registry.unbind(key);
}
catch (Exception e)
{
@@ -1595,13 +1590,13 @@
{
keys.remove(name);
}
- if (context != null)
+ if (registry != null)
{
Iterator<String> iter = jndiBindings.iterator();
while (iter.hasNext())
{
String jndiBinding = iter.next();
- context.unbind(jndiBinding);
+ registry.unbind(jndiBinding);
iter.remove();
}
}
@@ -1621,7 +1616,7 @@
if (jndiBindings.remove(jndi))
{
- context.unbind(jndi);
+ registry.unbind(jndi);
return true;
}
else
13 years, 2 months
JBoss hornetq SVN: r11478 - branches/Branch_2_2_EAP/src/main/org/hornetq/utils.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-10-06 15:15:23 -0400 (Thu, 06 Oct 2011)
New Revision: 11478
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ObjectInputStreamWithClassLoader.java
Log:
back port HORNETQ-747 to work around eventual JDK bugs
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ObjectInputStreamWithClassLoader.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ObjectInputStreamWithClassLoader.java 2011-10-06 09:09:31 UTC (rev 11477)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/ObjectInputStreamWithClassLoader.java 2011-10-06 19:15:23 UTC (rev 11478)
@@ -53,7 +53,9 @@
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try
{
- Class clazz = loader.loadClass(name);
+ // HORNETQ-747 https://issues.jboss.org/browse/HORNETQ-747
+ // Use Class.forName instead of ClassLoader.loadClass to avoid issues with loading arrays
+ Class clazz = Class.forName(name, false, loader);
// sanity check only.. if a classLoader can't find a clazz, it will throw an exception
if (clazz == null)
{
13 years, 2 months
JBoss hornetq SVN: r11477 - trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-06 05:09:31 -0400 (Thu, 06 Oct 2011)
New Revision: 11477
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
Log:
String is a 'final' type. Writing '<T extends String>' doesn't make sense.
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-10-05 16:49:18 UTC (rev 11476)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-10-06 09:09:31 UTC (rev 11477)
@@ -60,7 +60,7 @@
/**
* a regex comparator
*/
- private final MatchComparator<String> matchComparator = new MatchComparator<String>();
+ private final MatchComparator matchComparator = new MatchComparator();
/**
* a cache
@@ -263,7 +263,7 @@
/**
* compares to matches to see which one is more specific
*/
- private static class MatchComparator<T extends String> implements Comparator<T>
+ private static class MatchComparator implements Comparator<String>
{
public int compare(final String o1, final String o2)
{
13 years, 2 months
JBoss hornetq SVN: r11476 - in branches/HORNETQ-720_Replication: hornetq-core/src/main/java/org/hornetq/core/replication/impl and 5 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-05 12:49:18 -0400 (Wed, 05 Oct 2011)
New Revision: 11476
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/TestableJournal.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java
branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
branches/HORNETQ-720_Replication/tests/soak-tests/src/test/java/org/hornetq/tests/soak/journal/JournalCleanupCompactSoakTest.java
branches/HORNETQ-720_Replication/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java
Log:
HORNETQ-720 Add a compactLock to JournalImpl
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -365,39 +365,34 @@
final Journal localMessageJournal = messageJournal;
final Journal localBindingsJournal = bindingsJournal;
- final boolean messageJournalAutoReclaim = localMessageJournal.getAutoReclaim();
- final boolean bindingsJournalAutoReclaim = localBindingsJournal.getAutoReclaim();
Map<String, Long> largeMessageFilesToSync;
Map<SimpleString, Collection<Integer>> pageFilesToSync;
+ storageManagerLock.writeLock().lock();
try
{
- storageManagerLock.writeLock().lock();
+ replicator = replicationManager;
+ localMessageJournal.synchronizationLock();
+ localBindingsJournal.synchronizationLock();
try
{
- replicator = replicationManager;
-
- localMessageJournal.writeLock();
- localBindingsJournal.writeLock();
+ pagingManager.lockAll();
try
{
- pagingManager.lockAll();
- try
- {
- messageFiles = prepareJournalForCopy(localMessageJournal, JournalContent.MESSAGES);
- bindingsFiles = prepareJournalForCopy(localBindingsJournal, JournalContent.BINDINGS);
- pageFilesToSync = getPageInformationForSync(pagingManager);
- largeMessageFilesToSync = getLargeMessageInformation();
- }
- finally
- {
- pagingManager.unlockAll();
- }
+ messageFiles = prepareJournalForCopy(localMessageJournal, JournalContent.MESSAGES);
+ bindingsFiles = prepareJournalForCopy(localBindingsJournal, JournalContent.BINDINGS);
+ pageFilesToSync = getPageInformationForSync(pagingManager);
+ largeMessageFilesToSync = getLargeMessageInformation();
}
finally
{
- localMessageJournal.writeUnlock();
- localBindingsJournal.writeUnlock();
+ pagingManager.unlockAll();
}
+ }
+ finally
+ {
+ localMessageJournal.synchronizationUnlock();
+ localBindingsJournal.synchronizationUnlock();
+ }
bindingsJournal = new ReplicatedJournal(((byte)0), localBindingsJournal, replicator);
messageJournal = new ReplicatedJournal((byte)1, localMessageJournal, replicator);
}
@@ -421,14 +416,9 @@
{
storageManagerLock.writeLock().unlock();
}
- }
- finally
- {
- localMessageJournal.setAutoReclaim(messageJournalAutoReclaim);
- localBindingsJournal.setAutoReclaim(bindingsJournalAutoReclaim);
- }
}
+
/**
* @param pageFilesToSync
* @throws Exception
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicatedJournal.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -587,30 +587,18 @@
}
@Override
- public boolean getAutoReclaim()
+ public void synchronizationLock()
{
throw new UnsupportedOperationException();
}
@Override
- public void writeLock()
+ public void synchronizationUnlock()
{
throw new UnsupportedOperationException();
}
@Override
- public void writeUnlock()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setAutoReclaim(boolean autoReclaim)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
public void forceMoveNextFile()
{
throw new UnsupportedOperationException();
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationEndpointImpl.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -386,7 +386,7 @@
for (JournalContent jc : EnumSet.allOf(JournalContent.class))
{
JournalImpl journal = (JournalImpl)journalsHolder.remove(jc);
- journal.writeLock();
+ journal.synchronizationLock();
try
{
if (journal.getDataFiles().length != 0)
@@ -401,7 +401,7 @@
}
finally
{
- journal.writeUnlock();
+ journal.synchronizationUnlock();
}
}
synchronized (largeMessagesOnSync)
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/Journal.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -156,28 +156,18 @@
Map<Long, JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception;
/**
- * @return whether automatic reclaiming of Journal files is enabled
+ * Write lock the Journal and write lock the compacting process. Necessary only during
+ * replication for backup synchronization.
*/
- boolean getAutoReclaim();
+ void synchronizationLock();
/**
- * Write lock the Journal. Necessary only during replication for backup synchronization.
+ * Unlock the Journal and the compacting process.
+ * @see Journal#synchronizationLock()
*/
- void writeLock();
+ void synchronizationUnlock();
/**
- * Write-unlock the Journal.
- * @see Journal#writeLock()
- */
- void writeUnlock();
-
- /**
- * Sets whether the journal should auto-reclaim its internal files.
- * @param autoReclaim
- */
- void setAutoReclaim(boolean autoReclaim);
-
- /**
* Force the usage of a new {@link JournalFile}.
* @throws Exception
*/
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/TestableJournal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/TestableJournal.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/TestableJournal.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -52,4 +52,15 @@
/** This method is called automatically when a new file is opened.
* @return true if it needs to re-check due to cleanup or other factors */
boolean checkReclaimStatus() throws Exception;
+
+ /**
+ * @return whether automatic reclaiming of Journal files is enabled
+ */
+ boolean getAutoReclaim();
+
+ /**
+ * Sets whether the journal should auto-reclaim its internal files.
+ * @param autoReclaim
+ */
+ void setAutoReclaim(boolean autoReclaim);
}
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/FileWrapperJournal.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -277,30 +277,18 @@
}
@Override
- public boolean getAutoReclaim()
+ public void synchronizationLock()
{
throw new UnsupportedOperationException();
}
@Override
- public void writeLock()
+ public void synchronizationUnlock()
{
throw new UnsupportedOperationException();
}
@Override
- public void writeUnlock()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setAutoReclaim(boolean autoReclaim)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
public void forceMoveNextFile()
{
throw new UnsupportedOperationException();
Modified: branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/hornetq-journal/src/main/java/org/hornetq/core/journal/impl/JournalImpl.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -206,6 +206,7 @@
* However we need to lock it while taking and updating snapshots
*/
private final ReadWriteLock journalLock = new ReentrantReadWriteLock();
+ private final ReadWriteLock compactorLock = new ReentrantReadWriteLock();
private volatile JournalState state = JournalState.STOPPED;
@@ -1427,6 +1428,9 @@
throw new IllegalStateException("There is pending compacting operation");
}
+ compactorLock.writeLock().lock();
+ try
+ {
ArrayList<JournalFile> dataFilesToProcess = new ArrayList<JournalFile>(filesRepository.getDataFilesCount());
boolean previousReclaimValue = autoReclaim;
@@ -1455,7 +1459,7 @@
return;
}
- onCompactLock();
+ onCompactLockingTheJournal();
setAutoReclaim(false);
@@ -1534,7 +1538,7 @@
// Need to clear the compactor here, or the replay commands will send commands back (infinite loop)
compactor = null;
- onCompactLock();
+ onCompactLockingTheJournal();
newDatafiles = localCompactor.getNewDataFiles();
@@ -1626,8 +1630,12 @@
compactor = null;
}
setAutoReclaim(previousReclaimValue);
+ }
}
-
+ finally
+ {
+ compactorLock.writeLock().unlock();
+ }
}
/**
@@ -2145,11 +2153,18 @@
// TestableJournal implementation
// --------------------------------------------------------------
+ @Override
public synchronized void setAutoReclaim(final boolean autoReclaim)
{
this.autoReclaim = autoReclaim;
}
+ @Override
+ public boolean getAutoReclaim()
+ {
+ return autoReclaim;
+ }
+
public String debug() throws Exception
{
reclaimer.scan(getDataFiles());
@@ -2493,7 +2508,7 @@
/** This is an interception point for testcases, when the compacted files are written, to be called
* as soon as the compactor gets a writeLock */
- protected void onCompactLock() throws Exception
+ protected void onCompactLockingTheJournal() throws Exception
{
}
@@ -2973,14 +2988,22 @@
}
}
- public void writeLock()
+ public void synchronizationLock()
{
+ compactorLock.writeLock().lock();
journalLock.writeLock().lock();
}
- public void writeUnlock()
+ public void synchronizationUnlock()
{
- journalLock.writeLock().unlock();
+ try
+ {
+ compactorLock.writeLock().unlock();
+ }
+ finally
+ {
+ journalLock.writeLock().unlock();
+ }
}
/**
@@ -2991,7 +3014,7 @@
@Override
public synchronized Map<Long, JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception
{
- writeLock();
+ synchronizationLock();
try
{
Map<Long, JournalFile> map = new HashMap<Long, JournalFile>();
@@ -3007,15 +3030,10 @@
}
finally
{
- writeUnlock();
+ synchronizationUnlock();
}
}
- public boolean getAutoReclaim()
- {
- return autoReclaim;
- }
-
@Override
public SequentialFileFactory getFileFactory()
{
Modified: branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/replication/ReplicationTest.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -861,30 +861,18 @@
}
@Override
- public boolean getAutoReclaim()
+ public void synchronizationLock()
{
- return false;
- }
- @Override
- public void writeLock()
- {
-
}
@Override
- public void writeUnlock()
+ public void synchronizationUnlock()
{
}
@Override
- public void setAutoReclaim(boolean autoReclaim)
- {
-
- }
-
- @Override
public void forceMoveNextFile() throws Exception
{
Modified: branches/HORNETQ-720_Replication/tests/soak-tests/src/test/java/org/hornetq/tests/soak/journal/JournalCleanupCompactSoakTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/soak-tests/src/test/java/org/hornetq/tests/soak/journal/JournalCleanupCompactSoakTest.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/tests/soak-tests/src/test/java/org/hornetq/tests/soak/journal/JournalCleanupCompactSoakTest.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -117,7 +117,7 @@
"hq",
maxAIO)
{
- protected void onCompactLock() throws Exception
+ protected void onCompactLockingTheJournal() throws Exception
{
}
Modified: branches/HORNETQ-720_Replication/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java 2011-10-05 16:46:27 UTC (rev 11475)
+++ branches/HORNETQ-720_Replication/tests/stress-tests/src/test/java/org/hornetq/tests/stress/journal/JournalCleanupCompactStressTest.java 2011-10-05 16:49:18 UTC (rev 11476)
@@ -132,7 +132,7 @@
"hq",
maxAIO)
{
- protected void onCompactLock() throws Exception
+ protected void onCompactLockingTheJournal() throws Exception
{
}
13 years, 2 months
JBoss hornetq SVN: r11475 - in branches/HORNETQ-720_Replication: hornetq-core/src/main/java/org/hornetq/core/client/impl and 11 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-05 12:46:27 -0400 (Wed, 05 Oct 2011)
New Revision: 11475
Modified:
branches/HORNETQ-720_Replication/
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/utils/XMLUtil.java
branches/HORNETQ-720_Replication/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java
Log:
merge from trunk
Property changes on: branches/HORNETQ-720_Replication
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:10878-11463
+ /trunk:10878-11474
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -50,9 +50,9 @@
private static final boolean trace = ClientConsumerImpl.log.isTraceEnabled();
- public static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
+ private static final long CLOSE_TIMEOUT_MILLISECONDS = 10000;
- public static final int NUM_PRIORITIES = 10;
+ private static final int NUM_PRIORITIES = 10;
public static final SimpleString FORCED_DELIVERY_MESSAGE = new SimpleString("_hornetq.forced.delivery.seq");
@@ -405,11 +405,6 @@
return closed;
}
- public void stop() throws HornetQException
- {
- stop(true);
- }
-
public void stop(final boolean waitForOnMessage) throws HornetQException
{
waitForOnMessageToComplete(waitForOnMessage);
@@ -450,12 +445,6 @@
// ClientConsumerInternal implementation
// --------------------------------------------------------------
-
- public ClientSessionInternal getSession()
- {
- return session;
- }
-
public SessionQueueQueryResponseMessage getQueueInfo()
{
return queueInfo;
@@ -642,11 +631,11 @@
}
}
- /**
- *
+ /**
+ *
* LargeMessageBuffer will call flowcontrol here, while other handleMessage will also be calling flowControl.
* So, this operation needs to be atomic.
- *
+ *
* @param discountSlowConsumer When dealing with slowConsumers, we need to discount one credit that was pre-sent when the first receive was called. For largeMessage that is only done at the latest packet
*/
public void flowControl(final int messageBytes, final boolean discountSlowConsumer) throws HornetQException
@@ -707,7 +696,7 @@
// Private
// ---------------------------------------------------------------------------------------
- /**
+ /**
* Sending a initial credit for slow consumers
* */
private void startSlowConsumer()
@@ -741,7 +730,7 @@
{
ClientConsumerImpl.log.trace("Adding Runner on Executor for delivery");
}
-
+
sessionExecutor.execute(runner);
}
@@ -824,7 +813,7 @@
//Ignore, this could be a relic from a previous receiveImmediate();
return;
}
-
+
boolean expired = message.isExpired();
flowControlBeforeConsumption(message);
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -60,13 +60,9 @@
void flushAcks() throws HornetQException;
- void stop() throws HornetQException;
-
void stop(boolean waitForOnMessage) throws HornetQException;
void start();
SessionQueueQueryResponseMessage getQueueInfo();
-
- ClientSessionInternal getSession();
}
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientLargeMessageImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -23,9 +23,10 @@
import org.hornetq.utils.DataConstants;
/**
- * ClientLargeMessageImpl is only created when receiving large messages. At the time of sending a regular Message is sent as we won't know the message is considered large
+ * ClientLargeMessageImpl is only created when receiving large messages.
+ * <p>
+ * At the time of sending a regular Message is sent as we won't know the message is considered large
* until the buffer is filled up or the user set a streaming.
- *
* @author clebertsuconic
*/
public class ClientLargeMessageImpl extends ClientMessageImpl implements ClientLargeMessageInternal
@@ -209,11 +210,11 @@
// Inner classes -------------------------------------------------
- protected class HornetQOutputStream extends OutputStream
+ private class HornetQOutputStream extends OutputStream
{
- HornetQBuffer bufferOut;
+ private final HornetQBuffer bufferOut;
- HornetQOutputStream(HornetQBuffer out)
+ private HornetQOutputStream(HornetQBuffer out)
{
this.bufferOut = out;
}
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerCreditsImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -25,7 +25,7 @@
*
*
*/
-public class ClientProducerCreditsImpl implements ClientProducerCredits
+class ClientProducerCreditsImpl implements ClientProducerCredits
{
private static final Logger log = Logger.getLogger(ClientProducerCreditsImpl.class);
@@ -38,10 +38,10 @@
private final ClientSessionInternal session;
private int arriving;
-
+
private int refCount;
-
- public ClientProducerCreditsImpl(final ClientSessionInternal session,
+
+ ClientProducerCreditsImpl(final ClientSessionInternal session,
final SimpleString address,
final int windowSize)
{
@@ -73,7 +73,7 @@
{
arriving -= credits;
}
-
+
semaphore.release(credits);
}
@@ -84,7 +84,7 @@
semaphore.drainPermits();
int beforeFailure = arriving;
-
+
arriving = 0;
// If we are waiting for more credits than what's configured, then we need to use what we tried before
@@ -98,22 +98,22 @@
semaphore.release(Integer.MAX_VALUE / 2);
}
-
+
public synchronized void incrementRefCount()
{
refCount++;
}
-
+
public synchronized int decrementRefCount()
{
return --refCount;
}
-
+
public synchronized void releaseOutstanding()
{
semaphore.drainPermits();
}
-
+
private void checkCredits(final int credits)
{
int needed = Math.max(credits, windowSize);
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientProducerImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -36,13 +36,13 @@
/**
* The client-side Producer connectionFactory class.
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
* @version <tt>$Revision$</tt> $Id$
*/
-public class ClientProducerImpl implements ClientProducerInternal
+class ClientProducerImpl implements ClientProducerInternal
{
// Constants ------------------------------------------------------------------------------------
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -145,7 +145,7 @@
private volatile boolean closed;
- public final Exception e = new Exception();
+ private final Exception e = new Exception();
private final Object waitLock = new Object();
@@ -155,7 +155,7 @@
// Constructors
// ---------------------------------------------------------------------------------
- public ClientSessionFactoryImpl(final ServerLocatorInternal serverLocator,
+ ClientSessionFactoryImpl(final ServerLocatorInternal serverLocator,
final TransportConfiguration connectorConfig,
final long callTimeout,
final long clientFailureCheckPeriod,
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -95,13 +95,8 @@
* @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
*
* @author <a href="mailto:ataylor@redhat.com">Andy Taylor</a>
- *
- * @version <tt>$Revision: 3603 $</tt> $Id: ClientSessionImpl.java 3603 2008-01-21 18:49:20Z timfox $
- *
- * $Id: ClientSessionImpl.java 3603 2008-01-21 18:49:20Z timfox $
- *
*/
-public class ClientSessionImpl implements ClientSessionInternal, FailureListener, CommandConfirmationHandler
+class ClientSessionImpl implements ClientSessionInternal, FailureListener, CommandConfirmationHandler
{
// Constants ----------------------------------------------------------------------------
@@ -195,7 +190,7 @@
// Constructors ----------------------------------------------------------------------------
- public ClientSessionImpl(final ClientSessionFactoryInternal sessionFactory,
+ ClientSessionImpl(final ClientSessionFactoryInternal sessionFactory,
final String name,
final String username,
final String password,
@@ -665,7 +660,7 @@
stop(true);
}
- public void stop(final boolean waitForOnMessage) throws HornetQException
+ private void stop(final boolean waitForOnMessage) throws HornetQException
{
checkClosed();
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/client/impl/CompressedLargeMessageControllerImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -40,7 +40,7 @@
*
*
*/
-public class CompressedLargeMessageControllerImpl implements LargeMessageController
+class CompressedLargeMessageControllerImpl implements LargeMessageController
{
// Constants -----------------------------------------------------
@@ -51,13 +51,13 @@
// Attributes ----------------------------------------------------
- final LargeMessageController bufferDelegate;
-
+ private final LargeMessageController bufferDelegate;
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public CompressedLargeMessageControllerImpl(final LargeMessageController bufferDelegate)
+ CompressedLargeMessageControllerImpl(final LargeMessageController bufferDelegate)
{
this.bufferDelegate = bufferDelegate;
}
@@ -66,7 +66,7 @@
// Public --------------------------------------------------------
/**
- *
+ *
*/
public void discardUnusedPackets()
{
@@ -104,7 +104,7 @@
}
/**
- *
+ *
* @param timeWait Milliseconds to Wait. 0 means forever
* @throws Exception
*/
@@ -130,9 +130,9 @@
{
return -1;
}
-
+
DataInputStream dataInput = null;
-
+
private DataInputStream getStream()
{
if (dataInput == null)
@@ -140,18 +140,18 @@
try
{
InputStream input = new HornetQBufferInputStream(bufferDelegate);
-
+
dataInput = new DataInputStream(new InflaterReader(input));
}
catch (Exception e)
{
throw new RuntimeException (e.getMessage(), e);
}
-
+
}
return dataInput;
}
-
+
private void positioningNotSupported()
{
throw new IllegalStateException("Position not supported over compressed large messages");
@@ -300,9 +300,9 @@
positioningNotSupported();
return 0;
}
-
-
+
+
public int getUnsignedMedium(final long index)
{
positioningNotSupported();
@@ -579,7 +579,7 @@
{
try
{
- return (short)getStream().readShort();
+ return getStream().readShort();
}
catch (Exception e)
{
@@ -591,7 +591,7 @@
{
try
{
- return (int)getStream().readUnsignedShort();
+ return getStream().readUnsignedShort();
}
catch (Exception e)
{
@@ -609,7 +609,7 @@
return value;
}
-
+
public int readUnsignedMedium()
{
return (readByte() & 0xff) << 16 | (readByte() & 0xff) << 8 | (readByte() & 0xff) << 0;
@@ -708,7 +708,7 @@
public void skipBytes(final int length)
{
-
+
try
{
for (int i = 0 ; i < length; i++)
@@ -827,7 +827,7 @@
{
return (char)readShort();
}
-
+
public char getChar(final int index)
{
return (char)getShort(index);
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/deployers/impl/FileDeploymentManager.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -227,7 +227,7 @@
}
}
}
- List<Pair> toRemove = new ArrayList<Pair>();
+ List<Pair<URL, Deployer>> toRemove = new ArrayList<Pair<URL, Deployer>>();
for (Map.Entry<Pair<URL, Deployer>, DeployInfo> entry : deployed.entrySet())
{
Pair<URL, Deployer> pair = entry.getKey();
@@ -246,7 +246,7 @@
}
}
}
- for (Pair pair : toRemove)
+ for (Pair<URL, Deployer> pair : toRemove)
{
deployed.remove(pair);
}
@@ -271,7 +271,7 @@
/**
* Checks if the URL is among the current thread context class loader's resources.
- *
+ *
* We do not check that the corresponding file exists using File.exists() directly as it would fail
* in the case the resource is loaded from inside an EAR file (see https://jira.jboss.org/jira/browse/HORNETQ-122)
*/
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -19,7 +19,6 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.AcceptorControl;
-import org.hornetq.api.core.management.AddressControl;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.spi.core.remoting.Acceptor;
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -15,7 +15,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -406,14 +405,14 @@
{
while (iterator.hasNext())
{
- MessageReference ref = (MessageReference)iterator.next();
+ MessageReference ref = iterator.next();
if (filter == null || filter.match(ref.getMessage()))
{
Message message = ref.getMessage();
messages.add(message.toMap());
}
}
- return (Map<String, Object>[])messages.toArray(new Map[messages.size()]);
+ return messages.toArray(new Map[messages.size()]);
}
finally
{
@@ -465,7 +464,7 @@
int count = 0;
while (iterator.hasNext())
{
- MessageReference ref = (MessageReference)iterator.next();
+ MessageReference ref = iterator.next();
if (filter.match(ref.getMessage()))
{
count++;
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -13,17 +13,12 @@
package org.hornetq.core.paging.cursor.impl;
-import java.lang.ref.WeakReference;
-
-import org.hornetq.core.paging.cursor.PageCache;
import org.hornetq.core.paging.cursor.PagePosition;
/**
* A PagePosition
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class PagePositionImpl implements PagePosition
{
@@ -171,7 +166,5 @@
{
return "PagePositionImpl [pageNr=" + pageNr + ", messageNr=" + messageNr + ", recordID=" + recordID + "]";
}
-
-
}
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -74,15 +74,6 @@
// nothing to be done here.. we don really have a file on this Storage
}
- /* (non-Javadoc)
- * @see org.hornetq.core.server.LargeServerMessage#complete()
- */
- public void complete() throws Exception
- {
- // nothing to be done here.. we don really have a file on this Storage
-
- }
-
@Override
public boolean isLargeMessage()
{
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -109,11 +109,6 @@
}
};
- public void sync()
- {
- // NO OP
- }
-
public void addQueueBinding(final Binding queueBinding) throws Exception
{
}
@@ -152,10 +147,6 @@
{
}
- public void storeMessageReferenceScheduled(final long queueID, final long messageID, final long scheduledDeliveryTime) throws Exception
- {
- }
-
public void storeAcknowledgeTransactional(final long txID, final long queueID, final long messageiD) throws Exception
{
}
@@ -164,10 +155,6 @@
{
}
- public void deletePageTransactional(final long txID, final long messageID) throws Exception
- {
- }
-
public void storeMessage(final ServerMessage message) throws Exception
{
}
@@ -188,10 +175,6 @@
{
}
- public void updatePageTransaction(final long txID, final PageTransactionInfo pageTransaction) throws Exception
- {
- }
-
public void updateDeliveryCount(final MessageReference ref) throws Exception
{
}
@@ -207,10 +190,6 @@
{
}
- public void updateDuplicateID(final SimpleString address, final byte[] duplID, final long recordID) throws Exception
- {
- }
-
public void updateDuplicateIDTransactional(final long txID,
final SimpleString address,
final byte[] duplID,
@@ -329,13 +308,6 @@
}
/* (non-Javadoc)
- * @see org.hornetq.core.persistence.StorageManager#completeReplication()
- */
- public void completeOperations()
- {
- }
-
- /* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#pageClosed(org.hornetq.utils.SimpleString, int)
*/
public void pageClosed(final SimpleString storeName, final int pageNumber)
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -14,8 +14,6 @@
package org.hornetq.core.postoffice.impl;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -26,7 +24,6 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.DuplicateIDCache;
import org.hornetq.core.server.MessageReference;
-import org.hornetq.core.server.Queue;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.TransactionOperation;
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -16,7 +16,6 @@
import java.util.List;
import java.util.Map;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.transaction.Transaction;
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -15,11 +15,9 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.RouteContextList;
@@ -37,7 +35,7 @@
{
// The pair here is Durable and NonDurable
- private Map<SimpleString, RouteContextList> map = new HashMap<SimpleString, RouteContextList>();
+ private final Map<SimpleString, RouteContextList> map = new HashMap<SimpleString, RouteContextList>();
private Transaction transaction;
@@ -121,9 +119,9 @@
private class ContextListing implements RouteContextList
{
- private List<Queue> durableQueue = new ArrayList<Queue>(1);
+ private final List<Queue> durableQueue = new ArrayList<Queue>(1);
- private List<Queue> nonDurableQueue = new ArrayList<Queue>(1);
+ private final List<Queue> nonDurableQueue = new ArrayList<Queue>(1);
public int getNumberOfQueues()
{
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -17,7 +17,6 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -45,7 +44,7 @@
private final Object lockDelivery = new Object();
- private LinkedList<MessageReference> scheduledReferences = new LinkedList<MessageReference>();
+ private final LinkedList<MessageReference> scheduledReferences = new LinkedList<MessageReference>();
public ScheduledDeliveryHandlerImpl(final ScheduledExecutorService scheduledExecutor)
{
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -47,7 +47,7 @@
* all the matches
*/
private final Map<String, Match<T>> matches = new HashMap<String, Match<T>>();
-
+
/**
* Certain values cannot be removed after installed.
* This is because we read a few records from the main config.
@@ -72,13 +72,13 @@
*/
private final ArrayList<HierarchicalRepositoryChangeListener> listeners = new ArrayList<HierarchicalRepositoryChangeListener>();
-
+
public void addMatch(final String match, final T value)
{
addMatch(match, value, false);
}
-
+
/**
* Add a new match to the repository
*
@@ -98,7 +98,7 @@
matches.put(match, match1);
onChange();
}
-
+
public int getCacheSize()
{
return cache.size();
@@ -149,7 +149,7 @@
}
else
{
- ((Mergeable)actualMatch).merge(match.getValue());
+ ((Mergeable<T>)actualMatch).merge(match.getValue());
}
}
@@ -220,7 +220,7 @@
listeners.clear();
matches.clear();
}
-
+
public void clearCache()
{
cache.clear();
Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/utils/XMLUtil.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/utils/XMLUtil.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/utils/XMLUtil.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -331,8 +331,8 @@
NodeList nl2 = node2.getChildNodes();
short[] toFilter = new short[] { Node.TEXT_NODE, Node.ATTRIBUTE_NODE, Node.COMMENT_NODE };
- List nodes = XMLUtil.filter(nl, toFilter);
- List nodes2 = XMLUtil.filter(nl2, toFilter);
+ List<Node> nodes = XMLUtil.filter(nl, toFilter);
+ List<Node> nodes2 = XMLUtil.filter(nl2, toFilter);
int length = nodes.size();
@@ -343,8 +343,8 @@
for (int i = 0; i < length; i++)
{
- Node n = (Node)nodes.get(i);
- Node n2 = (Node)nodes2.get(i);
+ Node n = nodes.get(i);
+ Node n2 = nodes2.get(i);
XMLUtil.assertEquivalent(n, n2);
}
}
@@ -509,9 +509,9 @@
// Private --------------------------------------------------------------------------------------
- private static List filter(final NodeList nl, final short[] typesToFilter)
+ private static List<Node> filter(final NodeList nl, final short[] typesToFilter)
{
- List nodes = new ArrayList();
+ List<Node> nodes = new ArrayList<Node>();
outer: for (int i = 0; i < nl.getLength(); i++)
{
Modified: branches/HORNETQ-720_Replication/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -20,9 +20,9 @@
import org.hornetq.core.logging.Logger;
/**
- *
+ *
* A RealJournalImplTest
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
@@ -31,7 +31,7 @@
{
private static final Logger log = Logger.getLogger(NIOJournalImplTest.class);
- protected String journalDir = System.getProperty("user.home") + "/journal-test";
+ protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
@Override
protected SequentialFileFactory getFileFactory() throws Exception
Modified: branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java
===================================================================
--- branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java 2011-10-05 16:43:19 UTC (rev 11474)
+++ branches/HORNETQ-720_Replication/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java 2011-10-05 16:46:27 UTC (rev 11475)
@@ -36,7 +36,6 @@
import org.hornetq.api.core.client.MessageHandler;
import org.hornetq.core.client.impl.ClientConsumerInternal;
import org.hornetq.core.client.impl.ClientMessageInternal;
-import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.client.impl.LargeMessageControllerImpl;
import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
@@ -49,8 +48,6 @@
* A LargeMessageBufferUnitTest
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class LargeMessageBufferTest extends UnitTestCase
{
@@ -67,6 +64,7 @@
// Public --------------------------------------------------------
+ @Override
protected void setUp() throws Exception
{
super.setUp();
@@ -77,6 +75,7 @@
tmp.mkdirs();
}
+ @Override
protected void tearDown() throws Exception
{
super.tearDown();
@@ -839,12 +838,6 @@
}
- public void stop() throws HornetQException
- {
- // TODO Auto-generated method stub
-
- }
-
public void stop(boolean waitForOnMessage) throws HornetQException
{
// To change body of implemented methods use File | Settings | File Templates.
@@ -855,16 +848,5 @@
// TODO Auto-generated method stub
return null;
}
-
- /* (non-Javadoc)
- * @see org.hornetq.core.client.impl.ClientConsumerInternal#getSession()
- */
- public ClientSessionInternal getSession()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
}
-
}
13 years, 2 months
JBoss hornetq SVN: r11474 - in trunk: hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm and 1 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-05 12:43:19 -0400 (Wed, 05 Oct 2011)
New Revision: 11474
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java
Log:
Remove unused methods
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-05 16:42:56 UTC (rev 11473)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerImpl.java 2011-10-05 16:43:19 UTC (rev 11474)
@@ -405,11 +405,6 @@
return closed;
}
- public void stop() throws HornetQException
- {
- stop(true);
- }
-
public void stop(final boolean waitForOnMessage) throws HornetQException
{
waitForOnMessageToComplete(waitForOnMessage);
@@ -450,12 +445,6 @@
// ClientConsumerInternal implementation
// --------------------------------------------------------------
-
- public ClientSessionInternal getSession()
- {
- return session;
- }
-
public SessionQueueQueryResponseMessage getQueueInfo()
{
return queueInfo;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java 2011-10-05 16:42:56 UTC (rev 11473)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/client/impl/ClientConsumerInternal.java 2011-10-05 16:43:19 UTC (rev 11474)
@@ -60,13 +60,9 @@
void flushAcks() throws HornetQException;
- void stop() throws HornetQException;
-
void stop(boolean waitForOnMessage) throws HornetQException;
void start();
SessionQueueQueryResponseMessage getQueueInfo();
-
- ClientSessionInternal getSession();
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java 2011-10-05 16:42:56 UTC (rev 11473)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageLargeServerMessage.java 2011-10-05 16:43:19 UTC (rev 11474)
@@ -73,15 +73,6 @@
// nothing to be done here.. we don really have a file on this Storage
}
- /* (non-Javadoc)
- * @see org.hornetq.core.server.LargeServerMessage#complete()
- */
- public void complete() throws Exception
- {
- // nothing to be done here.. we don really have a file on this Storage
-
- }
-
@Override
public boolean isLargeMessage()
{
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-10-05 16:42:56 UTC (rev 11473)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/nullpm/NullStorageManager.java 2011-10-05 16:43:19 UTC (rev 11474)
@@ -106,11 +106,6 @@
}
};
- public void sync()
- {
- // NO OP
- }
-
public void addQueueBinding(final Binding queueBinding) throws Exception
{
}
@@ -149,10 +144,6 @@
{
}
- public void storeMessageReferenceScheduled(final long queueID, final long messageID, final long scheduledDeliveryTime) throws Exception
- {
- }
-
public void storeAcknowledgeTransactional(final long txID, final long queueID, final long messageiD) throws Exception
{
}
@@ -161,10 +152,6 @@
{
}
- public void deletePageTransactional(final long txID, final long messageID) throws Exception
- {
- }
-
public void storeMessage(final ServerMessage message) throws Exception
{
}
@@ -185,10 +172,6 @@
{
}
- public void updatePageTransaction(final long txID, final PageTransactionInfo pageTransaction) throws Exception
- {
- }
-
public void updateDeliveryCount(final MessageReference ref) throws Exception
{
}
@@ -204,10 +187,6 @@
{
}
- public void updateDuplicateID(final SimpleString address, final byte[] duplID, final long recordID) throws Exception
- {
- }
-
public void updateDuplicateIDTransactional(final long txID,
final SimpleString address,
final byte[] duplID,
@@ -326,13 +305,6 @@
}
/* (non-Javadoc)
- * @see org.hornetq.core.persistence.StorageManager#completeReplication()
- */
- public void completeOperations()
- {
- }
-
- /* (non-Javadoc)
* @see org.hornetq.core.persistence.StorageManager#pageClosed(org.hornetq.utils.SimpleString, int)
*/
public void pageClosed(final SimpleString storeName, final int pageNumber)
Modified: trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java
===================================================================
--- trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java 2011-10-05 16:42:56 UTC (rev 11473)
+++ trunk/tests/unit-tests/src/test/java/org/hornetq/tests/unit/core/client/impl/LargeMessageBufferTest.java 2011-10-05 16:43:19 UTC (rev 11474)
@@ -36,7 +36,6 @@
import org.hornetq.api.core.client.MessageHandler;
import org.hornetq.core.client.impl.ClientConsumerInternal;
import org.hornetq.core.client.impl.ClientMessageInternal;
-import org.hornetq.core.client.impl.ClientSessionInternal;
import org.hornetq.core.client.impl.LargeMessageControllerImpl;
import org.hornetq.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionReceiveContinuationMessage;
@@ -49,8 +48,6 @@
* A LargeMessageBufferUnitTest
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class LargeMessageBufferTest extends UnitTestCase
{
@@ -67,6 +64,7 @@
// Public --------------------------------------------------------
+ @Override
protected void setUp() throws Exception
{
super.setUp();
@@ -77,6 +75,7 @@
tmp.mkdirs();
}
+ @Override
protected void tearDown() throws Exception
{
super.tearDown();
@@ -839,12 +838,6 @@
}
- public void stop() throws HornetQException
- {
- // TODO Auto-generated method stub
-
- }
-
public void stop(boolean waitForOnMessage) throws HornetQException
{
// To change body of implemented methods use File | Settings | File Templates.
@@ -855,16 +848,5 @@
// TODO Auto-generated method stub
return null;
}
-
- /* (non-Javadoc)
- * @see org.hornetq.core.client.impl.ClientConsumerInternal#getSession()
- */
- public ClientSessionInternal getSession()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
}
-
}
13 years, 2 months
JBoss hornetq SVN: r11473 - trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-05 12:42:56 -0400 (Wed, 05 Oct 2011)
New Revision: 11473
Modified:
trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
Log:
Do not use user's home folder as scratch area for unit-tests.
Modified: trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java
===================================================================
--- trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-05 16:42:40 UTC (rev 11472)
+++ trunk/tests/timing-tests/src/test/java/org/hornetq/tests/timing/core/journal/impl/NIOJournalImplTest.java 2011-10-05 16:42:56 UTC (rev 11473)
@@ -20,9 +20,9 @@
import org.hornetq.core.logging.Logger;
/**
- *
+ *
* A RealJournalImplTest
- *
+ *
* @author <a href="mailto:tim.fox@jboss.com">Tim Fox</a>
* @author <a href="mailto:clebert.suconic@jboss.com">Clebert Suconic</a>
*
@@ -31,7 +31,7 @@
{
private static final Logger log = Logger.getLogger(NIOJournalImplTest.class);
- protected String journalDir = System.getProperty("user.home") + "/journal-test";
+ protected String journalDir = System.getProperty("java.io.tmpdir", "/tmp") + "/journal-test";
@Override
protected SequentialFileFactory getFileFactory() throws Exception
13 years, 2 months
JBoss hornetq SVN: r11472 - in trunk/hornetq-core/src/main/java/org/hornetq/core: paging/cursor/impl and 3 other directories.
by do-not-reply@jboss.org
Author: borges
Date: 2011-10-05 12:42:40 -0400 (Wed, 05 Oct 2011)
New Revision: 11472
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java
trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java
Log:
Organize imports
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/AcceptorControlImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -19,7 +19,6 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.AcceptorControl;
-import org.hornetq.api.core.management.AddressControl;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.spi.core.remoting.Acceptor;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -15,7 +15,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -406,14 +405,14 @@
{
while (iterator.hasNext())
{
- MessageReference ref = (MessageReference)iterator.next();
+ MessageReference ref = iterator.next();
if (filter == null || filter.match(ref.getMessage()))
{
Message message = ref.getMessage();
messages.add(message.toMap());
}
}
- return (Map<String, Object>[])messages.toArray(new Map[messages.size()]);
+ return messages.toArray(new Map[messages.size()]);
}
finally
{
@@ -465,7 +464,7 @@
int count = 0;
while (iterator.hasNext())
{
- MessageReference ref = (MessageReference)iterator.next();
+ MessageReference ref = iterator.next();
if (filter.match(ref.getMessage()))
{
count++;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PagePositionImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -13,17 +13,12 @@
package org.hornetq.core.paging.cursor.impl;
-import java.lang.ref.WeakReference;
-
-import org.hornetq.core.paging.cursor.PageCache;
import org.hornetq.core.paging.cursor.PagePosition;
/**
* A PagePosition
*
* @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
*/
public class PagePositionImpl implements PagePosition
{
@@ -171,7 +166,5 @@
{
return "PagePositionImpl [pageNr=" + pageNr + ", messageNr=" + messageNr + ", recordID=" + recordID + "]";
}
-
-
}
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/postoffice/impl/DuplicateIDCacheImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -14,8 +14,6 @@
package org.hornetq.core.postoffice.impl;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -26,7 +24,6 @@
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.DuplicateIDCache;
import org.hornetq.core.server.MessageReference;
-import org.hornetq.core.server.Queue;
import org.hornetq.core.transaction.Transaction;
import org.hornetq.core.transaction.TransactionOperation;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/RoutingContext.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -16,7 +16,6 @@
import java.util.List;
import java.util.Map;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.transaction.Transaction;
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/RoutingContextImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -15,11 +15,9 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import org.hornetq.api.core.Pair;
import org.hornetq.api.core.SimpleString;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.RouteContextList;
@@ -37,7 +35,7 @@
{
// The pair here is Durable and NonDurable
- private Map<SimpleString, RouteContextList> map = new HashMap<SimpleString, RouteContextList>();
+ private final Map<SimpleString, RouteContextList> map = new HashMap<SimpleString, RouteContextList>();
private Transaction transaction;
@@ -121,9 +119,9 @@
private class ContextListing implements RouteContextList
{
- private List<Queue> durableQueue = new ArrayList<Queue>(1);
+ private final List<Queue> durableQueue = new ArrayList<Queue>(1);
- private List<Queue> nonDurableQueue = new ArrayList<Queue>(1);
+ private final List<Queue> nonDurableQueue = new ArrayList<Queue>(1);
public int getNumberOfQueues()
{
Modified: trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java
===================================================================
--- trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java 2011-10-05 16:42:19 UTC (rev 11471)
+++ trunk/hornetq-core/src/main/java/org/hornetq/core/server/impl/ScheduledDeliveryHandlerImpl.java 2011-10-05 16:42:40 UTC (rev 11472)
@@ -17,7 +17,6 @@
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -45,7 +44,7 @@
private final Object lockDelivery = new Object();
- private LinkedList<MessageReference> scheduledReferences = new LinkedList<MessageReference>();
+ private final LinkedList<MessageReference> scheduledReferences = new LinkedList<MessageReference>();
public ScheduledDeliveryHandlerImpl(final ScheduledExecutorService scheduledExecutor)
{
13 years, 2 months