JBoss hornetq SVN: r10407 - tags/HornetQ_2_2_2_EAP_CR3/src/main/org/hornetq/core/settings/impl.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-29 07:52:33 -0400 (Tue, 29 Mar 2011)
New Revision: 10407
Modified:
tags/HornetQ_2_2_2_EAP_CR3/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
Log:
Removing mistakenly added log
Modified: tags/HornetQ_2_2_2_EAP_CR3/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
===================================================================
--- tags/HornetQ_2_2_2_EAP_CR3/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-03-29 04:13:05 UTC (rev 10406)
+++ tags/HornetQ_2_2_2_EAP_CR3/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-03-29 11:52:33 UTC (rev 10407)
@@ -180,7 +180,6 @@
*/
public void removeMatch(final String match)
{
- new Exception("Removing match " + match).printStackTrace();
boolean isImmutable = immutables.contains(match);
if (isImmutable)
{
13 years, 11 months
JBoss hornetq SVN: r10406 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-29 00:13:05 -0400 (Tue, 29 Mar 2011)
New Revision: 10406
Modified:
trunk/docs/user-manual/en/duplicate-detection.xml
Log:
removing wrong note
Modified: trunk/docs/user-manual/en/duplicate-detection.xml
===================================================================
--- trunk/docs/user-manual/en/duplicate-detection.xml 2011-03-29 03:56:28 UTC (rev 10405)
+++ trunk/docs/user-manual/en/duplicate-detection.xml 2011-03-29 04:13:05 UTC (rev 10406)
@@ -148,12 +148,4 @@
<para>For more information on cluster connections and how to configure them, please see <xref
linkend="clusters"/>.</para>
</section>
- <section>
- <title>Duplicate Detection and Paging</title>
- <para>HornetQ also uses duplicate detection when paging messages to storage. This is
- so when a message is depaged from storage and server failure occurs, we do not end up
- depaging the message more than once which could result in duplicate delivery.</para>
- <para>For more information on paging and how to configure it, please see <xref
- linkend="paging" />.</para>
- </section>
</chapter>
13 years, 11 months
JBoss hornetq SVN: r10405 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 23:56:28 -0400 (Mon, 28 Mar 2011)
New Revision: 10405
Modified:
trunk/docs/user-manual/en/Book_Info.xml
Log:
Changing version on Book-info
Modified: trunk/docs/user-manual/en/Book_Info.xml
===================================================================
--- trunk/docs/user-manual/en/Book_Info.xml 2011-03-28 23:03:58 UTC (rev 10404)
+++ trunk/docs/user-manual/en/Book_Info.xml 2011-03-29 03:56:28 UTC (rev 10405)
@@ -20,7 +20,7 @@
<title>HornetQ User Manual</title>
<subtitle>Putting the buzz in messaging</subtitle>
<productname>HornetQ</productname>
- <edition>2.2.2</edition>
+ <edition>2.1.0</edition>
<pubsnumber>1</pubsnumber>
<abstract>
<para>The User manual is an in depth manual on all aspects of HornetQ</para>
13 years, 11 months
JBoss hornetq SVN: r10404 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 19:03:58 -0400 (Mon, 28 Mar 2011)
New Revision: 10404
Modified:
trunk/docs/user-manual/en/large-messages.xml
Log:
doc changes
Modified: trunk/docs/user-manual/en/large-messages.xml
===================================================================
--- trunk/docs/user-manual/en/large-messages.xml 2011-03-28 22:22:28 UTC (rev 10403)
+++ trunk/docs/user-manual/en/large-messages.xml 2011-03-28 23:03:58 UTC (rev 10404)
@@ -60,7 +60,7 @@
different physical volume to the message journal or paging directory.</para>
</section>
<section>
- <title>Setting the limits</title>
+ <title>Configuring Parameters</title>
<para>Any message larger than a certain size is considered a large message. Large messages
will be split up and sent in fragments. This is determined by the parameter <literal
>min-large-message-size</literal></para>
@@ -80,14 +80,6 @@
on how to instantiate the session factory.</para>
</section>
<section>
- <title>Compressed Large Messages</title>
- <para>If you specify the boolean property <literal>compress-large-message</literal> on
- the <literal>server locator</literal> or <literal>ConnectionFactory</literal> The
- system will use the ZIP algorithm to compress the message body as the message is
- transfered to the server's side. Notice that there's no special treatment at the
- server's side, all the compressing and uncompressing is done at the client.</para>
- </section>
- <section>
<title>Using JMS</title>
<para>If JNDI is used to look up the connection factory, the minimum large message size
is specified in <literal>hornetq-jms.xml</literal></para>
@@ -108,6 +100,14 @@
message size is specified by <literal
>HornetQConnectionFactory.setMinLargeMessageSize</literal>.</para>
</section>
+ <section>
+ <title>Compressed Large Messages</title>
+ <para>If you specify the boolean property <literal>compress-large-message</literal> on
+ the <literal>server locator</literal> or <literal>ConnectionFactory</literal> The
+ system will use the ZIP algorithm to compress the message body as the message is
+ transfered to the server's side. Notice that there's no special treatment at the
+ server's side, all the compressing and uncompressing is done at the client.</para>
+ </section>
</section>
<section>
<title>Streaming large messages</title>
13 years, 11 months
JBoss hornetq SVN: r10403 - trunk/docs/user-manual/en.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 18:22:28 -0400 (Mon, 28 Mar 2011)
New Revision: 10403
Modified:
trunk/docs/user-manual/en/Book_Info.xml
trunk/docs/user-manual/en/large-messages.xml
trunk/docs/user-manual/en/paging.xml
Log:
Documentation changes
Modified: trunk/docs/user-manual/en/Book_Info.xml
===================================================================
--- trunk/docs/user-manual/en/Book_Info.xml 2011-03-28 21:14:27 UTC (rev 10402)
+++ trunk/docs/user-manual/en/Book_Info.xml 2011-03-28 22:22:28 UTC (rev 10403)
@@ -20,7 +20,7 @@
<title>HornetQ User Manual</title>
<subtitle>Putting the buzz in messaging</subtitle>
<productname>HornetQ</productname>
- <edition>2.1.0</edition>
+ <edition>2.2.2</edition>
<pubsnumber>1</pubsnumber>
<abstract>
<para>The User manual is an in depth manual on all aspects of HornetQ</para>
Modified: trunk/docs/user-manual/en/large-messages.xml
===================================================================
--- trunk/docs/user-manual/en/large-messages.xml 2011-03-28 21:14:27 UTC (rev 10402)
+++ trunk/docs/user-manual/en/large-messages.xml 2011-03-28 22:22:28 UTC (rev 10403)
@@ -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;
@@ -81,6 +80,14 @@
on how to instantiate the session factory.</para>
</section>
<section>
+ <title>Compressed Large Messages</title>
+ <para>If you specify the boolean property <literal>compress-large-message</literal> on
+ the <literal>server locator</literal> or <literal>ConnectionFactory</literal> The
+ system will use the ZIP algorithm to compress the message body as the message is
+ transfered to the server's side. Notice that there's no special treatment at the
+ server's side, all the compressing and uncompressing is done at the client.</para>
+ </section>
+ <section>
<title>Using JMS</title>
<para>If JNDI is used to look up the connection factory, the minimum large message size
is specified in <literal>hornetq-jms.xml</literal></para>
@@ -184,9 +191,9 @@
msg.setInputStream(dataInputStream);
...
</programlisting>
-
- <para>Notice also that for messages with more than 2GiB the getBodySize() will return invalid values since
- this is an integer (which is also exposed to the JMS API). On those cases you can use the message property _HQ_LARGE_SIZE.</para>
+ <para>Notice also that for messages with more than 2GiB the getBodySize() will return
+ invalid values since this is an integer (which is also exposed to the JMS API). On
+ those cases you can use the message property _HQ_LARGE_SIZE.</para>
</section>
<section id="large-messages.streaming.over.jms">
<title>Streaming over JMS</title>
@@ -258,20 +265,6 @@
// Do whatever you want with the data
} </programlisting>
</section>
- <section id="large-messages.cache.client">
- <title>Cache Large Messages on client</title>
- <para>Large messages are transferred by streaming from server to client. The message is
- broken into smaller packets and as the message is read more packets will be received.
- Because of that the body of the large message can be read only once, and by consequence
- a received message can be sent to another producer only once. The JMS Bridge for
- instance won't be able to resend a large message in case of failure</para>
- <para>To solve this problem, you can enable the property <literal
- >cache-large-message-client</literal> on the connection factory. If you enable this
- property the client consumer will create a temporary file to hold the large message
- content, so it would be possible to resend large messages.</para>
- <note>Use this option on the connection factory used by the JMS Bridge if the JMS Bridge is
- being used for large messages.</note>
- </section>
<section id="large-messages.example">
<title>Large message example</title>
<para>Please see <xref linkend="examples.large-message"/> for an example which shows how
Modified: trunk/docs/user-manual/en/paging.xml
===================================================================
--- trunk/docs/user-manual/en/paging.xml 2011-03-28 21:14:27 UTC (rev 10402)
+++ trunk/docs/user-manual/en/paging.xml 2011-03-28 22:22:28 UTC (rev 10403)
@@ -140,6 +140,13 @@
they try and send further messages.</entry>
<entry>PAGE</entry>
</row>
+ <row>
+ <entry><literal>page-max-cache-size</literal></entry>
+ <entry>The system will keep up to <<literal
+ >page-max-cache-size</literal> page files in memory to
+ optimize IO during paging navigation.</entry>
+ <entry>5</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -190,9 +197,8 @@
<para>The other 9 queues are empty even though messages have been sent.</para>
</listitem>
</itemizedlist>
- <para>In this example we have to wait until the last queue has delivered some of its
- messages before we depage and the other queues finally receive some more
- messages.</para>
+ <para>In this example all the other 9 queues will be consuming messages from the page
+ system. This may cause performance issues if this is an undesirable state.</para>
</section>
<section>
<title>Example</title>
13 years, 11 months
JBoss hornetq SVN: r10402 - in trunk: tests/src/org/hornetq/tests/stress/remote and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 17:14:27 -0400 (Mon, 28 Mar 2011)
New Revision: 10402
Modified:
trunk/docs/user-manual/en/paging.xml
trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
Log:
Fixing PingStressTest
Modified: trunk/docs/user-manual/en/paging.xml
===================================================================
--- trunk/docs/user-manual/en/paging.xml 2011-03-28 21:13:54 UTC (rev 10401)
+++ trunk/docs/user-manual/en/paging.xml 2011-03-28 21:14:27 UTC (rev 10402)
@@ -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;
@@ -36,9 +35,12 @@
<title>Page Files</title>
<para>Messages are stored per address on the file system. Each address has an individual
folder where messages are stored in multiple files (page files). Each file will contain
- messages up to a max configured size (<literal>page-size-bytes</literal>). When reading
- page-files all messages on the page-file are read, routed and the file is deleted as
- soon as the messages are recovered.</para>
+ messages up to a max configured size (<literal>page-size-bytes</literal>). The system
+ will navigate on the files as needed, and it will remove the page file as soon as all
+ the messages are acknowledged up to that point.</para>
+ <para>Browsers will read through the page-cursor system.</para>
+ <para>Consumers with selectors will also navigate through the page-files and it will ignore
+ messages that don't match the criteria.</para>
</section>
<section id="paging.main.config">
<title>Configuration</title>
@@ -160,15 +162,18 @@
able to continue sending.</para>
<para>To do this just set the <literal>address-full-policy</literal> to <literal
>BLOCK</literal> in the address settings</para>
- <para>In the default configuration, all addresses are configured to block producers after 10 MiB of data are in the address.</para>
+ <para>In the default configuration, all addresses are configured to block producers after 10
+ MiB of data are in the address.</para>
</section>
<section>
<title>Caution with Addresses with Multiple Queues</title>
<para>When a message is routed to an address that has multiple queues bound to it, e.g. a
- JMS subscription, there is only 1 copy of the message in memory. Each queue only deals
- with a reference to this. Because of this the memory is only freed up once all queues
- referencing the message have delivered it. This means that if not all queues deliver the
- message we can end up in a state where messages are not delivered. </para>
+ JMS subscription in a Topic, there is only 1 copy of the message in memory. Each queue
+ only deals with a reference to this. Because of this the memory is only freed up once
+ all queues referencing the message have delivered it.</para>
+ <para>If you have a single lazy subscription, the entire address will suffer IO performance
+ hit as all the queues will have messages being sent through an extra storage on the
+ paging system.</para>
<para>For example:</para>
<itemizedlist>
<listitem>
@@ -190,47 +195,6 @@
messages.</para>
</section>
<section>
- <title>Paging and message selectors</title>
- <note>
- <para>Please note that message selectors will only operate on messages in memory. If you
- have a large amount of messages paged to disk and a selector that only matches some
- of the paged messages, then those messages won't be consumed until the messages in
- memory have been consumed. HornetQ does not scan through page files on disk to
- locate matching messages. To do this efficiently would mean implementing and
- managing indexes amongst other things. Effectively we would be writing a relational
- database! This is not the primary role of a messaging system. If you find yourself
- using selectors which only select small subsets of messages in very large queues
- which are too large to fit in memory at any one time, then you probably want a
- relational database not a messaging system - you're effectively executing queries
- over tables.</para>
- </note>
- </section>
- <section>
- <title>Paging and browsers</title>
- <note>
- <para>Please note that message browsers only operate over messages in memory. They do
- not operate over messages paged to disk. Messages are paged to disk
- <emphasis>before</emphasis> they are routed to any queues, so when they are
- paged, they are not in any queues, so will not appear when browsing any queues.
- </para>
- </note>
- </section>
- <section>
- <title>Paging and unacknowledged messages</title>
- <note>
- <para> Please note that until messages are acknowledged they are still in memory on the
- server, so they contribute to the size of messages on a particular address. If
- messages are paged to disk for an address, and are being consumed, they will be
- depaged from disk when enough memory has been freed up in that address after
- messages have been consumed and acknowledged. However if messages are not
- acknowledged then more messages will not be depaged since there is no free space in
- memory. In this case message consumption can appear to hang. If not acknowledging
- explictly messages are acknowledged according to the <literal
- >ack-batch-size</literal> setting. Be careful not to set your paging max size to
- a figure lower than ack-batch-size or your system may appear to hang! </para>
- </note>
- </section>
- <section>
<title>Example</title>
<para>See <xref linkend="examples.paging"/> for an example which shows how to use paging
with HornetQ.</para>
Modified: trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-03-28 21:13:54 UTC (rev 10401)
+++ trunk/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-03-28 21:14:27 UTC (rev 10402)
@@ -14,6 +14,7 @@
package org.hornetq.tests.stress.remote;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
@@ -122,11 +123,11 @@
server.getRemotingService().addInterceptor(noPongInterceptor);
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(transportConfig);
+ locator.setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
+ locator.setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
+ locator.setCallTimeout(PingStressTest.PING_INTERVAL * 10);
final ClientSessionFactory csf1 = locator.createSessionFactory();
- csf1.getServerLocator().setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
- csf1.getServerLocator().setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
- csf1.getServerLocator().setCallTimeout(PingStressTest.PING_INTERVAL * 10);
final int numberOfSessions = 1;
final int numberOfThreads = 30;
@@ -153,12 +154,12 @@
{
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(transportConfig);
+ locator.setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
+ locator.setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
+ locator.setCallTimeout(PingStressTest.PING_INTERVAL * 10);
+
final ClientSessionFactory csf2 = locator.createSessionFactory();
- csf2.getServerLocator().setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
- csf2.getServerLocator().setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
- csf2.getServerLocator().setCallTimeout(PingStressTest.PING_INTERVAL * 10);
-
// Start all at once to make concurrency worst
flagAligned.countDown();
flagStart.await();
@@ -185,10 +186,15 @@
Thread.sleep(PingStressTest.PING_INTERVAL * (threadNumber % 3));
session.close();
+
+ csf2.close();
+
+ locator.close();
}
}
catch (Throwable e)
{
+ e.printStackTrace();
failure = e;
}
}
@@ -202,7 +208,7 @@
threads[i].start();
}
- flagAligned.await();
+ assertTrue(flagAligned.await(10, TimeUnit.SECONDS));
flagStart.countDown();
Throwable e = null;
@@ -219,6 +225,8 @@
{
throw new Exception("Test Failed", e);
}
+
+ csf1.close();
}
13 years, 11 months
JBoss hornetq SVN: r10401 - branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/stress/remote.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 17:13:54 -0400 (Mon, 28 Mar 2011)
New Revision: 10401
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
Log:
Fixing PingStressTest
Modified: branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java
===================================================================
--- branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-03-28 14:53:30 UTC (rev 10400)
+++ branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/stress/remote/PingStressTest.java 2011-03-28 21:13:54 UTC (rev 10401)
@@ -14,6 +14,7 @@
package org.hornetq.tests.stress.remote;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
import org.hornetq.api.core.HornetQException;
import org.hornetq.api.core.Interceptor;
@@ -122,11 +123,11 @@
server.getRemotingService().addInterceptor(noPongInterceptor);
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(transportConfig);
+ locator.setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
+ locator.setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
+ locator.setCallTimeout(PingStressTest.PING_INTERVAL * 10);
final ClientSessionFactory csf1 = locator.createSessionFactory();
- csf1.getServerLocator().setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
- csf1.getServerLocator().setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
- csf1.getServerLocator().setCallTimeout(PingStressTest.PING_INTERVAL * 10);
final int numberOfSessions = 1;
final int numberOfThreads = 30;
@@ -153,12 +154,12 @@
{
ServerLocator locator = HornetQClient.createServerLocatorWithoutHA(transportConfig);
+ locator.setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
+ locator.setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
+ locator.setCallTimeout(PingStressTest.PING_INTERVAL * 10);
+
final ClientSessionFactory csf2 = locator.createSessionFactory();
- csf2.getServerLocator().setClientFailureCheckPeriod(PingStressTest.PING_INTERVAL);
- csf2.getServerLocator().setConnectionTTL((long)(PingStressTest.PING_INTERVAL * 1.5));
- csf2.getServerLocator().setCallTimeout(PingStressTest.PING_INTERVAL * 10);
-
// Start all at once to make concurrency worst
flagAligned.countDown();
flagStart.await();
@@ -185,10 +186,15 @@
Thread.sleep(PingStressTest.PING_INTERVAL * (threadNumber % 3));
session.close();
+
+ csf2.close();
+
+ locator.close();
}
}
catch (Throwable e)
{
+ e.printStackTrace();
failure = e;
}
}
@@ -202,7 +208,7 @@
threads[i].start();
}
- flagAligned.await();
+ assertTrue(flagAligned.await(10, TimeUnit.SECONDS));
flagStart.countDown();
Throwable e = null;
@@ -219,6 +225,8 @@
{
throw new Exception("Test Failed", e);
}
+
+ csf1.close();
}
13 years, 11 months
JBoss hornetq SVN: r10400 - branches/Branch_2_2_EAP.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 10:53:30 -0400 (Mon, 28 Mar 2011)
New Revision: 10400
Modified:
branches/Branch_2_2_EAP/merges.txt
Log:
changing merges.txt
Modified: branches/Branch_2_2_EAP/merges.txt
===================================================================
--- branches/Branch_2_2_EAP/merges.txt 2011-03-28 14:53:07 UTC (rev 10399)
+++ branches/Branch_2_2_EAP/merges.txt 2011-03-28 14:53:30 UTC (rev 10400)
@@ -5,3 +5,4 @@
- branch_2_2 - trunk - 10363:10371 - 25-mar-2011 - Andy
- branch_2_2 - trunk - 10373:10374 - 25-mar-2011 - Clebert
- branch_2_2 - trunk - 10384:10387 - 27-mar-2011 - Clebert
+- branch_2_2 - trunk - 10390:10397 - 28-mar-2011 - Clebert
13 years, 11 months
JBoss hornetq SVN: r10399 - in trunk/src/main/org/hornetq/core: settings and 1 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 10:53:07 -0400 (Mon, 28 Mar 2011)
New Revision: 10399
Modified:
trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/src/main/org/hornetq/core/settings/HierarchicalRepository.java
trunk/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
Log:
merge -r10390:10397 from branch_2_2
Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-03-28 14:08:41 UTC (rev 10398)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-03-28 14:53:07 UTC (rev 10399)
@@ -1532,7 +1532,7 @@
{
for (Map.Entry<String, Set<Role>> entry : configuration.getSecurityRoles().entrySet())
{
- securityRepository.addMatch(entry.getKey(), entry.getValue());
+ securityRepository.addMatch(entry.getKey(), entry.getValue(), true);
}
}
@@ -1552,7 +1552,7 @@
{
for (Map.Entry<String, AddressSettings> entry : configuration.getAddressesSettings().entrySet())
{
- addressSettingsRepository.addMatch(entry.getKey(), entry.getValue());
+ addressSettingsRepository.addMatch(entry.getKey(), entry.getValue(), true);
}
}
Modified: trunk/src/main/org/hornetq/core/settings/HierarchicalRepository.java
===================================================================
--- trunk/src/main/org/hornetq/core/settings/HierarchicalRepository.java 2011-03-28 14:08:41 UTC (rev 10398)
+++ trunk/src/main/org/hornetq/core/settings/HierarchicalRepository.java 2011-03-28 14:53:07 UTC (rev 10399)
@@ -26,6 +26,8 @@
* @param value the value to hold agains the match
*/
void addMatch(String match, T value);
+
+ void addMatch(String match, T value, boolean immutableMatch);
/**
* return the value held against the nearest match
Modified: trunk/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java
===================================================================
--- trunk/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-03-28 14:08:41 UTC (rev 10398)
+++ trunk/src/main/org/hornetq/core/settings/impl/HierarchicalObjectRepository.java 2011-03-28 14:53:07 UTC (rev 10399)
@@ -17,8 +17,10 @@
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.hornetq.core.logging.Logger;
@@ -45,6 +47,15 @@
* 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.
+ * JBoss AS deployer may remove them on undeploy, while we don't want to accept that since
+ * this could cause issues on shutdown.
+ * Notice you can still change these values. You just can't remove them.
+ */
+ private final Set<String> immutables = new HashSet<String>();
/**
* a regex comparator
@@ -61,15 +72,26 @@
*/
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
*
* @param match The regex to use to match against
* @param value the value to hold agains the match
*/
- public void addMatch(final String match, final T value)
+ public void addMatch(final String match, final T value, final boolean immutableMatch)
{
clearCache();
+ if (immutableMatch)
+ {
+ immutables.add(match);
+ }
Match.verify(match);
Match<T> match1 = new Match<T>(match);
match1.setValue(value);
@@ -158,9 +180,18 @@
*/
public void removeMatch(final String match)
{
- matches.remove(match);
- clearCache();
- onChange();
+ new Exception("Removing match " + match).printStackTrace();
+ boolean isImmutable = immutables.contains(match);
+ if (isImmutable)
+ {
+ log.debug("Cannot remove match " + match + " since it came from a main config");
+ }
+ else
+ {
+ matches.remove(match);
+ clearCache();
+ onChange();
+ }
}
public void registerListener(final HierarchicalRepositoryChangeListener listener)
13 years, 11 months
JBoss hornetq SVN: r10398 - tags.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2011-03-28 10:08:41 -0400 (Mon, 28 Mar 2011)
New Revision: 10398
Added:
tags/HornetQ_2_2_2_EAP_CR3/
Log:
2.2.2 EAP CR3 pretag
13 years, 11 months