JBoss hornetq SVN: r9853 - in branches/Branch_New_Paging: src/main/org/hornetq/core/paging and 9 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-08 13:03:29 -0500 (Mon, 08 Nov 2010)
New Revision: 9853
Modified:
branches/Branch_New_Paging/hornetq.ipr
branches/Branch_New_Paging/hornetq.iws
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/PagingStoreFactory.java
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingStoreFactoryNIO.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/AddressManager.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/Bindings.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/BindingsFactory.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/PostOffice.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/BindingsImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/SimpleAddressManager.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/WildcardAddressManager.java
branches/Branch_New_Paging/src/main/org/hornetq/core/server/ServerSession.java
branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
Log:
minor changes
Modified: branches/Branch_New_Paging/hornetq.ipr
===================================================================
--- branches/Branch_New_Paging/hornetq.ipr 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/hornetq.ipr 2010-11-08 18:03:29 UTC (rev 9853)
@@ -631,7 +631,7 @@
<module fileurl="file://$PROJECT_DIR$/tests/hornetq-tests.iml" filepath="$PROJECT_DIR$/tests/hornetq-tests.iml" />
</modules>
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
<component name="ResourceManagerContainer">
Modified: branches/Branch_New_Paging/hornetq.iws
===================================================================
--- branches/Branch_New_Paging/hornetq.iws 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/hornetq.iws 2010-11-08 18:03:29 UTC (rev 9853)
@@ -2,48 +2,14 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" readonly="true" id="a2aae645-dbcd-4d6e-9c99-efa05d93589a" name="Default" comment="">
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server/ra.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/server" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-configuration.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/readme.html" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/server/MDBQueue.java" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-jms.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml" afterPath="$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/config/META-INF/application.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/build.sh" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/MDBRemoteServerClientExample.java" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/build.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/examples/javaee/common/build.xml" afterPath="$PROJECT_DIR$/examples/javaee/common/build.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/config/ant.properties" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/build.bat" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-users.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server/hornetq-configuration.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server/hornetq-jms.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/docs/user-manual/en/examples.xml" afterPath="$PROJECT_DIR$/docs/user-manual/en/examples.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server/jms-ds.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/config/META-INF" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0/client-jndi.properties" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-beans.xml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/config/client.jndi.properties" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/examples/javaee/jca-remote/config" />
- </list>
- <list id="5341122e-b51c-4e90-b798-7086790ef7e8" name="intellij" comment="">
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/hornetq.iml" afterPath="$PROJECT_DIR$/hornetq.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/examples/javaee/hornetq-javaee-examples.iml" afterPath="$PROJECT_DIR$/examples/javaee/hornetq-javaee-examples.iml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/hornetq.iws" afterPath="$PROJECT_DIR$/hornetq.iws" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/examples/jms/hornetq-jms-examples.iml" afterPath="$PROJECT_DIR$/examples/jms/hornetq-jms-examples.iml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/hornetq.ipr" afterPath="$PROJECT_DIR$/hornetq.ipr" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/hornetq.iws" afterPath="$PROJECT_DIR$/hornetq.iws" />
</list>
- <ignored path=".idea/workspace.xml" />
+ <list id="5341122e-b51c-4e90-b798-7086790ef7e8" name="intellij" comment="" />
+ <ignored path="$USER_HOME_GRAILS$/" />
<ignored path="messaging.iws" />
+ <ignored path=".idea/workspace.xml" />
+ <ignored path="$USER_HOME_GRIFFON$/" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -138,7 +104,7 @@
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
- <breakpoint url="file://$PROJECT_DIR$/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java" line="145" class="org.hornetq.integration.jboss.security.JBossASSecurityManager" package="org.hornetq.integration.jboss.security">
+ <breakpoint url="file://$PROJECT_DIR$/src/main/org/hornetq/integration/jboss/security/JBossASSecurityManager.java" line="145" class="org.hornetq.integration.jboss.security.JBossASSecurityManager$1" package="org.hornetq.integration.jboss.security">
<option name="ENABLED" value="true" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
@@ -242,7 +208,7 @@
<option name="CONDITION" value="" />
<option name="LOG_MESSAGE" value="" />
</breakpoint>
- <breakpoint url="file://$PROJECT_DIR$/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java" line="234" class="org.hornetq.tests.integration.ra.HornetQMessageHandlerTest.DummyMessageEndpoint" package="org.hornetq.tests.integration.ra">
+ <breakpoint url="file://$PROJECT_DIR$/tests/src/org/hornetq/tests/integration/ra/HornetQMessageHandlerTest.java" line="234" class="org.hornetq.tests.integration.ra.HornetQMessageHandlerTest" package="org.hornetq.tests.integration.ra">
<option name="ENABLED" value="true" />
<option name="LOG_ENABLED" value="false" />
<option name="LOG_EXPRESSION_ENABLED" value="false" />
@@ -323,100 +289,24 @@
<component name="FileColors" enabled="true" enabledForTabs="true" />
<component name="FileEditorManager">
<leaf>
- <file leaf-file-name="MDBRemoteServerClientExample.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/MDBRemoteServerClientExample.java">
+ <file leaf-file-name="PageCursorTest.java" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="95" column="17" selection-start="3054" selection-end="3226" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="readme.html" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/readme.html">
- <provider selected="true" editor-type-id="text-editor">
- <state line="46" column="44" selection-start="2573" selection-end="3415" vertical-scroll-proportion="-16.304348">
+ <state line="459" column="11" selection-start="14538" selection-end="14538" vertical-scroll-proportion="0.80944353">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="appserver-integration.xml" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml">
+ <file leaf-file-name="SpringBindingRegistry.java" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/src/main/org/hornetq/integration/spring/SpringBindingRegistry.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="836" column="101" selection-start="48141" selection-end="48141" vertical-scroll-proportion="-15.04">
+ <state line="3" column="47" selection-start="140" selection-end="140" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="examples.xml" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/docs/user-manual/en/examples.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="534" column="124" selection-start="33920" selection-end="33920" vertical-scroll-proportion="0.4304762">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="ra.xml" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server/ra.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="61" column="27" selection-start="2184" selection-end="3025" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="hornetq-configuration.xml" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-configuration.xml">
- <provider selected="true" editor-type-id="text-editor">
- <state line="46" column="49" selection-start="1976" selection-end="1976" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="MDBQueue.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/server/MDBQueue.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="46" column="25" selection-start="1849" selection-end="1865" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="StatelessSenderService.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSenderService.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="23" column="17" selection-start="806" selection-end="806" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="StatelessSender.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSender.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="50" column="59" selection-start="1556" selection-end="1609" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
- <file leaf-file-name="MDB_BMTClientExample.java" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/examples/javaee/mdb-bmt/src/org/hornetq/javaee/example/MDB_BMTClientExample.java">
- <provider selected="true" editor-type-id="text-editor">
- <state line="71" column="32" selection-start="2239" selection-end="2468" vertical-scroll-proportion="0.0">
- <folding />
- </state>
- </provider>
- </entry>
- </file>
</leaf>
</component>
<component name="FindManager">
@@ -424,10 +314,13 @@
<setting name="OPEN_NEW_TAB" value="true" />
</FindUsagesManager>
</component>
+ <component name="Git.Settings">
+ <option name="GIT_EXECUTABLE" value="git" />
+ <option name="CHECKOUT_INCLUDE_TAGS" value="false" />
+ </component>
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/examples/javaee/jca-config/build.xml" />
<option value="$PROJECT_DIR$/examples/javaee/jca-remote/config/jndi.properties" />
<option value="$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-beans.xml" />
<option value="$PROJECT_DIR$/examples/javaee/jca-remote/server/hornetq-configuration.xml" />
@@ -443,6 +336,7 @@
<option value="$PROJECT_DIR$/examples/javaee/jca-remote/readme.html" />
<option value="$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml" />
<option value="$PROJECT_DIR$/docs/user-manual/en/examples.xml" />
+ <option value="$PROJECT_DIR$/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java" />
</list>
</option>
</component>
@@ -1355,7 +1249,7 @@
<option name="STATE" value="0" />
</component>
<component name="ProjectView">
- <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+ <navigator currentView="PackagesPane" proportions="" version="1" splitterProportion="0.5">
<flattenPackages />
<showMembers />
<showModules />
@@ -1367,7 +1261,6 @@
<sortByType />
</navigator>
<panes>
- <pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -1382,7 +1275,7 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
+ <option name="myItemId" value="trunk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -1392,35 +1285,13 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
+ <option name="myItemId" value="trunk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="mdb-bmt" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="mdb-bmt" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="example" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -1428,33 +1299,15 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
+ <option name="myItemId" value="trunk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="example" />
+ <option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -1464,43 +1317,21 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
+ <option name="myItemId" value="trunk" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="example" />
+ <option name="myItemId" value="main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="server" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="server0" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -1508,186 +1339,94 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
+ <option name="myItemId" value="core" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="server" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
+ </subPane>
+ </pane>
+ <pane id="Scope" />
+ <pane id="Favorites" />
+ <pane id="PackagesPane">
+ <subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="hornetq-tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jca-remote" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="config" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="hornetq-tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="jca-config" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="org.hornetq.tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="javaee" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="hornetq-tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="common" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="org.hornetq.tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="integration" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jms" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ <option name="myItemId" value="hornetq-tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="jms" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="org.hornetq.tests" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="queue" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ <option name="myItemId" value="integration" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="paging" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageElementNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jms" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="queue" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="example" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="common" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="common" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="src" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="example" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="hornetq-jms-examples" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="common" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="config" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
</subPane>
</pane>
- <pane id="Scope" />
- <pane id="Favorites" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth1" value="287" />
<property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth0" value="225" />
- <property name="project.structure.last.edited" value="Modules" />
+ <property name="project.structure.last.edited" value="Project" />
<property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth3" value="35" />
<property name="FileHistory.org.jetbrains.idea.svn.history.SvnHistoryProvider_flatWidth2" value="246" />
<property name="project.structure.proportion" value="0.15" />
@@ -1741,34 +1480,7 @@
<recent name="org.hornetq.api.core.client.HornetQClient" />
</key>
</component>
- <component name="RunManager" selected="Remote.server">
- <configuration default="false" name="DiscoveryTest.testSimpleBroadcastSpecificNIC" type="JUnit" factoryName="JUnit" temporary="true">
- <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="emma">
- <pattern>
- <option name="PATTERN" value="org.hornetq.tests.integration.discovery.*" />
- <option name="ENABLED" value="true" />
- </pattern>
- </extension>
- <module name="hornetq-tests" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" value="" />
- <option name="PACKAGE_NAME" value="org.hornetq.tests.integration.discovery" />
- <option name="MAIN_CLASS_NAME" value="org.hornetq.tests.integration.discovery.DiscoveryTest" />
- <option name="METHOD_NAME" value="testSimpleBroadcastSpecificNIC" />
- <option name="TEST_OBJECT" value="method" />
- <option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=./src/config/trunk/clustered/logging.properties -Djava.library.path=native/bin" />
- <option name="PARAMETERS" value="" />
- <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
- <option name="ENV_VARIABLES" />
- <option name="PASS_PARENT_ENVS" value="true" />
- <option name="TEST_SEARCH_SCOPE">
- <value defaultName="moduleWithDependencies" />
- </option>
- <envs />
- <RunnerSettings RunnerId="Run" />
- <ConfigurationWrapper RunnerId="Run" />
- <method />
- </configuration>
+ <component name="RunManager" selected="JUnit.PageCursorTest">
<configuration default="false" name="QueueExample" type="Application" factoryName="Application" temporary="true">
<extension name="coverage" enabled="false" merge="false" runner="emma">
<pattern>
@@ -1776,6 +1488,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" value="org.hornetq.jms.example.QueueExample" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
@@ -1798,6 +1511,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -1831,6 +1545,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -1858,6 +1573,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -1878,11 +1594,40 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
+ <configuration default="false" name="PageCursorTest" type="JUnit" factoryName="JUnit" temporary="true">
+ <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="emma">
+ <pattern>
+ <option name="PATTERN" value="org.hornetq.tests.integration.paging.*" />
+ <option name="ENABLED" value="true" />
+ </pattern>
+ </extension>
+ <extension name="snapshooter" />
+ <module name="hornetq-tests" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" value="" />
+ <option name="PACKAGE_NAME" value="org.hornetq.tests.integration.paging" />
+ <option name="MAIN_CLASS_NAME" value="org.hornetq.tests.integration.paging.PageCursorTest" />
+ <option name="METHOD_NAME" value="" />
+ <option name="TEST_OBJECT" value="class" />
+ <option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=./src/config/trunk/clustered/logging.properties -Djava.library.path=native/bin" />
+ <option name="PARAMETERS" value="" />
+ <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
+ <option name="ENV_VARIABLES" />
+ <option name="PASS_PARENT_ENVS" value="true" />
+ <option name="TEST_SEARCH_SCOPE">
+ <value defaultName="moduleWithDependencies" />
+ </option>
+ <envs />
+ <RunnerSettings RunnerId="Run" />
+ <ConfigurationWrapper RunnerId="Run" />
+ <method />
+ </configuration>
<configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
<method>
<option name="AntTarget" enabled="false" />
<option name="BuildArtifacts" enabled="false" />
<option name="Maven.BeforeRunTask" enabled="false" />
+ <option name="ValidateXdebugSetup" enabled="true" />
</method>
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
@@ -1917,6 +1662,7 @@
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" runner="emma" />
+ <extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
@@ -1937,6 +1683,7 @@
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="emma" />
+ <extension name="snapshooter" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -1967,6 +1714,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
@@ -2000,6 +1748,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -2027,6 +1776,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<module name="hornetq-tests" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" value="" />
@@ -2064,13 +1814,7 @@
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="false" />
</RunnerSettings>
- <RunnerSettings RunnerId="Debug">
- <option name="DEBUG_PORT" value="5005" />
- <option name="TRANSPORT" value="0" />
- <option name="LOCAL" value="false" />
- </RunnerSettings>
<ConfigurationWrapper RunnerId="Debug" />
- <ConfigurationWrapper RunnerId="Debug" />
<method />
</configuration>
<configuration default="false" name="EnqueueDurable" type="Application" factoryName="Application">
@@ -2080,6 +1824,7 @@
<option name="ENABLED" value="true" />
</pattern>
</extension>
+ <extension name="snapshooter" />
<option name="MAIN_CLASS_NAME" value="org.hornetq.test.EnqueueDurable" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="127.0.0.1" />
@@ -2096,11 +1841,11 @@
<method />
</configuration>
<list size="10">
- <item index="0" class="java.lang.String" itemvalue="JUnit.DiscoveryTest.testSimpleBroadcastSpecificNIC" />
- <item index="1" class="java.lang.String" itemvalue="Application.QueueExample" />
- <item index="2" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest.testSelectorNotChanged" />
- <item index="3" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest.testSelectorChanged" />
- <item index="4" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest" />
+ <item index="0" class="java.lang.String" itemvalue="Application.QueueExample" />
+ <item index="1" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest.testSelectorNotChanged" />
+ <item index="2" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest.testSelectorChanged" />
+ <item index="3" class="java.lang.String" itemvalue="JUnit.HornetQMessageHandlerTest" />
+ <item index="4" class="java.lang.String" itemvalue="JUnit.PageCursorTest" />
<item index="5" class="java.lang.String" itemvalue="JUnit.LargeMessageTest" />
<item index="6" class="java.lang.String" itemvalue="JUnit.NettyFailoverTest.test" />
<item index="7" class="java.lang.String" itemvalue="JUnit.GroupingFailoverReplicationTest.test" />
@@ -2123,6 +1868,7 @@
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
<option name="DETECT_NESTED_COPIES" value="false" />
+ <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<configuration useDefault="false">$PROJECT_DIR$/../../.subversion</configuration>
@@ -2183,26 +1929,28 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
- <frame x="-3" y="25" width="1926" height="1033" extended-state="6" />
+ <frame x="0" y="22" width="1440" height="742" extended-state="0" />
<editor active="false" />
<layout>
- <window_info id="Changes" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.34723788" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.34615386" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
- <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.48703495" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.17925592" sideWeight="0.0" order="3" side_tool="false" content_ui="tabs" />
+ <window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.17587373" sideWeight="0.0" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.16344294" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
- <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24959914" sideWeight="0.7006937" order="1" side_tool="false" content_ui="tabs" />
+ <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.24946082" sideWeight="0.64456236" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17263496" sideWeight="0.64487034" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.22142343" sideWeight="0.82758623" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.20599613" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.48703495" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Dataflow to this" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16312997" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
</layout>
@@ -2860,118 +2608,84 @@
</buildFile>
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server0/client-jndi.properties">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/MDBQueueB.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="14" column="43" selection-start="722" selection-end="722" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="36" column="13" selection-start="1596" selection-end="1596" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-jms.xml">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server/MDBQueueA.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="17" column="29" selection-start="891" selection-end="908" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="36" column="13" selection-start="1593" selection-end="1593" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/MDBQueueB.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/readme.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="36" column="13" selection-start="1596" selection-end="1596" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="149" column="19" selection-start="9467" selection-end="9815" vertical-scroll-proportion="-16.956522" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server/MDBQueueA.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server/jms-ds.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="36" column="13" selection-start="1593" selection-end="1593" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="34" column="31" selection-start="960" selection-end="1628" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/readme.html">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/MDBRemoteServerClientExample.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="149" column="19" selection-start="9467" selection-end="9815" vertical-scroll-proportion="-16.956522">
- <folding />
- </state>
+ <state line="95" column="17" selection-start="3054" selection-end="3226" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server/jms-ds.xml">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/readme.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="34" column="31" selection-start="960" selection-end="1628" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="46" column="44" selection-start="2573" selection-end="3415" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-configuration.xml">
+ <entry file="file://$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="49" selection-start="1976" selection-end="1976" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="836" column="101" selection-start="47514" selection-end="47514" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSenderService.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server/ra.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="23" column="17" selection-start="806" selection-end="806" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="61" column="27" selection-start="2184" selection-end="3025" vertical-scroll-proportion="0.026258206" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSender.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server0/hornetq-configuration.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="50" column="59" selection-start="1556" selection-end="1609" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="46" column="49" selection-start="1976" selection-end="1976" vertical-scroll-proportion="0.5536105" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/mdb-bmt/src/org/hornetq/javaee/example/MDB_BMTClientExample.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/server/MDBQueue.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="71" column="32" selection-start="2239" selection-end="2468" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="46" column="25" selection-start="1849" selection-end="1865" vertical-scroll-proportion="0.026258206" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/server/ra.xml">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSenderService.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="61" column="27" selection-start="2184" selection-end="3025" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="23" column="17" selection-start="806" selection-end="806" vertical-scroll-proportion="0.60393876" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/MDBRemoteServerClientExample.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/jca-config/src/org/hornetq/javaee/example/server2/StatelessSender.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="95" column="17" selection-start="3054" selection-end="3226" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
+ <state line="50" column="59" selection-start="1556" selection-end="1609" vertical-scroll-proportion="0.026258206" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/src/org/hornetq/javaee/example/server/MDBQueue.java">
+ <entry file="file://$PROJECT_DIR$/examples/javaee/mdb-bmt/src/org/hornetq/javaee/example/MDB_BMTClientExample.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="25" selection-start="1849" selection-end="1865" vertical-scroll-proportion="0.0">
- <folding>
- <element signature="imports" expanded="true" />
- </folding>
- </state>
+ <state line="71" column="32" selection-start="2239" selection-end="2468" vertical-scroll-proportion="0.76367617" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/examples/javaee/jca-remote/readme.html">
+ <entry file="file://$PROJECT_DIR$/docs/user-manual/en/examples.xml">
<provider selected="true" editor-type-id="text-editor">
- <state line="46" column="44" selection-start="2573" selection-end="3415" vertical-scroll-proportion="-16.304348">
- <folding />
- </state>
+ <state line="534" column="124" selection-start="34000" selection-end="34000" vertical-scroll-proportion="0.51487416" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/docs/user-manual/en/appserver-integration.xml">
+ <entry file="file://$PROJECT_DIR$/src/main/org/hornetq/integration/spring/SpringBindingRegistry.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="836" column="101" selection-start="48141" selection-end="48141" vertical-scroll-proportion="-15.04">
- <folding />
- </state>
+ <state line="3" column="47" selection-start="140" selection-end="140" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/docs/user-manual/en/examples.xml">
+ <entry file="file://$PROJECT_DIR$/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java">
<provider selected="true" editor-type-id="text-editor">
- <state line="534" column="124" selection-start="33920" selection-end="33920" vertical-scroll-proportion="0.4304762">
+ <state line="459" column="11" selection-start="14538" selection-end="14538" vertical-scroll-proportion="0.80944353">
<folding />
</state>
</provider>
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/PagingStoreFactory.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/PagingStoreFactory.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/PagingStoreFactory.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -30,7 +30,7 @@
*/
public interface PagingStoreFactory
{
- PagingStore newStore(SimpleString address, AddressSettings addressSettings) throws Exception;
+ PagingStore newStore(SimpleString address, AddressSettings addressSettings);
void stop() throws InterruptedException;
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingManagerImpl.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -244,7 +244,7 @@
// Private -------------------------------------------------------
- protected PagingStore newStore(final SimpleString address) throws Exception
+ protected PagingStore newStore(final SimpleString address)
{
return pagingStoreFactory.newStore(address,
addressSettingsRepository.getMatch(address.toString()));
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingStoreFactoryNIO.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingStoreFactoryNIO.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PagingStoreFactoryNIO.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -87,7 +87,7 @@
{
}
- public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings) throws Exception
+ public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings)
{
return new PagingStoreImpl(address,
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/AddressManager.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/AddressManager.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/AddressManager.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -25,13 +25,13 @@
*/
public interface AddressManager
{
- boolean addBinding(Binding binding);
+ boolean addBinding(Binding binding) throws Exception;
- Binding removeBinding(SimpleString uniqueName);
+ Binding removeBinding(SimpleString uniqueName) throws Exception;
- Bindings getBindingsForRoutingAddress(SimpleString address);
+ Bindings getBindingsForRoutingAddress(SimpleString address) throws Exception;
- Bindings getMatchingBindings(SimpleString address);
+ Bindings getMatchingBindings(SimpleString address) throws Exception;
void clear();
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/Bindings.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/Bindings.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/Bindings.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -15,6 +15,7 @@
import java.util.Collection;
+import org.hornetq.core.paging.PagingStore;
import org.hornetq.core.server.Queue;
import org.hornetq.core.server.RoutingContext;
import org.hornetq.core.server.ServerMessage;
@@ -41,4 +42,6 @@
boolean redistribute(ServerMessage message, Queue originatingQueue, RoutingContext context) throws Exception;
void route(ServerMessage message, RoutingContext context) throws Exception;
+
+ PagingStore getPagingStore();
}
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/BindingsFactory.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/BindingsFactory.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/BindingsFactory.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -12,6 +12,8 @@
*/
package org.hornetq.core.postoffice;
+import org.hornetq.api.core.SimpleString;
+
/**
* A factory for creating bindings
*
@@ -19,5 +21,5 @@
*/
public interface BindingsFactory
{
- Bindings createBindings();
+ Bindings createBindings(SimpleString address) throws Exception;
}
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/PostOffice.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/PostOffice.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/PostOffice.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -47,7 +47,7 @@
Binding getBinding(SimpleString uniqueName);
- Bindings getMatchingBindings(SimpleString address);
+ Bindings getMatchingBindings(SimpleString address) throws Exception;
void route(ServerMessage message, boolean direct) throws Exception;
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/BindingsImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/BindingsImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/BindingsImpl.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -27,6 +27,7 @@
import org.hornetq.core.filter.Filter;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.message.impl.MessageImpl;
+import org.hornetq.core.paging.PagingStore;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.server.Queue;
@@ -60,10 +61,13 @@
private volatile boolean routeWhenNoConsumers;
private final GroupingHandler groupingHandler;
+
+ private final PagingStore pageStore;
- public BindingsImpl(final GroupingHandler groupingHandler)
+ public BindingsImpl(final GroupingHandler groupingHandler, final PagingStore pageStore)
{
this.groupingHandler = groupingHandler;
+ this.pageStore = pageStore;
}
public void setRouteWhenNoConsumers(final boolean routeWhenNoConsumers)
@@ -218,7 +222,22 @@
return false;
}
}
+
+ public PagingStore getPagingStore()
+ {
+ return pageStore;
+ }
+ public void paged(final ServerMessage message)
+ {
+
+ }
+
+ public boolean page(final ServerMessage message) throws Exception
+ {
+ return pageStore.page(message);
+ }
+
public void route(final ServerMessage message, final RoutingContext context) throws Exception
{
boolean routed = false;
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -508,13 +508,13 @@
return binding;
}
- public Bindings getBindingsForAddress(final SimpleString address)
+ public Bindings getBindingsForAddress(final SimpleString address) throws Exception
{
Bindings bindings = addressManager.getBindingsForRoutingAddress(address);
if (bindings == null)
{
- bindings = createBindings();
+ bindings = createBindings(address);
}
return bindings;
@@ -525,7 +525,7 @@
return addressManager.getBinding(name);
}
- public Bindings getMatchingBindings(final SimpleString address)
+ public Bindings getMatchingBindings(final SimpleString address) throws Exception
{
return addressManager.getMatchingBindings(address);
}
@@ -606,47 +606,13 @@
cache.addToCache(duplicateIDBytes, context.getTransaction());
}
- if (context.getTransaction() == null)
- {
- if (message.page())
- {
- return;
- }
- }
- else
- {
- Transaction tx = context.getTransaction();
-
- boolean depage = tx.getProperty(TransactionPropertyIndexes.IS_DEPAGE) != null;
-
- // if the TX paged at least one message on a given address, all the other message on the same address should also go towards
- // paging cache now
- boolean alreadyPaging = false;
-
- if (tx.isPaging())
- {
- alreadyPaging = getPageOperation(tx).isPaging(message.getAddress());
- }
-
- if (!depage && message.storeIsPaging() || alreadyPaging)
- {
- tx.setPaging(true);
- getPageOperation(tx).addMessageToPage(message);
- if (startedTx)
- {
- tx.commit();
- }
-
- return;
- }
- }
-
Bindings bindings = addressManager.getBindingsForRoutingAddress(address);
if (bindings != null)
{
bindings.route(message, context);
}
+
if (context.getQueueCount() == 0)
{
// Send to DLA if appropriate
@@ -1014,27 +980,6 @@
return message;
}
- private final PageMessageOperation getPageOperation(final Transaction tx)
- {
- // you could have races on the case two sessions using the same XID
- // so this whole operation needs to be atomic per TX
- synchronized (tx)
- {
- PageMessageOperation oper = (PageMessageOperation)tx.getProperty(TransactionPropertyIndexes.PAGE_MESSAGES_OPERATION);
-
- if (oper == null)
- {
- oper = new PageMessageOperation();
-
- tx.putProperty(TransactionPropertyIndexes.PAGE_MESSAGES_OPERATION, oper);
-
- tx.addOperation(oper);
- }
-
- return oper;
- }
- }
-
private class Reaper implements Runnable
{
private volatile boolean closed = false;
@@ -1114,184 +1059,6 @@
}
}
- private class PageMessageOperation implements TransactionOperation
- {
- private final HashMap<SimpleString, Pair<PagingStore, List<ServerMessage>>> pagingData = new HashMap<SimpleString, Pair<PagingStore, List<ServerMessage>>>();
-
- private Transaction subTX = null;
-
- void addMessageToPage(final ServerMessage message)
- {
- Pair<PagingStore, List<ServerMessage>> pagePair = pagingData.get(message.getAddress());
- if (pagePair == null)
- {
- pagePair = new Pair<PagingStore, List<ServerMessage>>(message.getPagingStore(),
- new ArrayList<ServerMessage>());
- pagingData.put(message.getAddress(), pagePair);
- }
-
- pagePair.b.add(message);
- }
-
- boolean isPaging(final SimpleString address)
- {
- return pagingData.get(address) != null;
- }
-
- public void afterCommit(final Transaction tx)
- {
- // If part of the transaction goes to the queue, and part goes to paging, we can't let depage start for the
- // transaction until all the messages were added to the queue
- // or else we could deliver the messages out of order
-
- PageTransactionInfo pageTransaction = (PageTransactionInfo)tx.getProperty(TransactionPropertyIndexes.PAGE_TRANSACTION);
-
- if (pageTransaction != null)
- {
- pageTransaction.commit();
- }
-
- if (subTX != null)
- {
- subTX.afterCommit();
- }
- }
-
- public void afterPrepare(final Transaction tx)
- {
- if (subTX != null)
- {
- subTX.afterPrepare();
- }
- }
-
- public void afterRollback(final Transaction tx)
- {
- PageTransactionInfo pageTransaction = (PageTransactionInfo)tx.getProperty(TransactionPropertyIndexes.PAGE_TRANSACTION);
-
- if (tx.getState() == State.PREPARED && pageTransaction != null)
- {
- pageTransaction.rollback();
- }
-
- if (subTX != null)
- {
- subTX.afterRollback();
- }
- }
-
- public void beforeCommit(final Transaction tx) throws Exception
- {
- if (tx.getState() != Transaction.State.PREPARED)
- {
- pageMessages(tx);
- }
-
- if (subTX != null)
- {
- subTX.beforeCommit();
- }
-
- }
-
- public void beforePrepare(final Transaction tx) throws Exception
- {
- pageMessages(tx);
-
- if (subTX != null)
- {
- subTX.beforePrepare();
- }
- }
-
- public void beforeRollback(final Transaction tx) throws Exception
- {
- if (subTX != null)
- {
- subTX.beforeRollback();
- }
- }
-
- private void pageMessages(final Transaction tx) throws Exception
- {
- if (!pagingData.isEmpty())
- {
- PageTransactionInfo pageTransaction = (PageTransactionInfo)tx.getProperty(TransactionPropertyIndexes.PAGE_TRANSACTION);
-
- if (pageTransaction == null)
- {
- pageTransaction = new PageTransactionInfoImpl(tx.getID());
-
- tx.putProperty(TransactionPropertyIndexes.PAGE_TRANSACTION, pageTransaction);
-
- // To avoid a race condition where depage happens before the transaction is completed, we need to inform
- // the pager about this transaction is being processed
- pagingManager.addTransaction(pageTransaction);
- }
-
- boolean pagingPersistent = false;
-
- ArrayList<ServerMessage> nonPagedMessages = null;
-
- for (Pair<PagingStore, List<ServerMessage>> pair : pagingData.values())
- {
-
- if (!pair.a.page(pair.b, tx.getID()))
- {
- if (nonPagedMessages == null)
- {
- nonPagedMessages = new ArrayList<ServerMessage>();
- }
- nonPagedMessages.addAll(pair.b);
- }
-
- for (ServerMessage msg : pair.b)
- {
- if (msg.isDurable())
- {
- pageTransaction.increment();
- pagingPersistent = true;
- }
- }
- }
-
- if (nonPagedMessages != null)
- {
- for (ServerMessage message : nonPagedMessages)
- {
- // This could happen when the PageStore left the pageState
- // we create a copy of the transaction so that messages are routed with the same tx ID.
- // but we can not use directly the tx as it has already its own set of TransactionOperations
- if (subTX == null)
- {
- subTX = tx.copy();
- }
-
- route(message, subTX, false);
-
- if (subTX.isContainsPersistent())
- {
- // The route wouldn't be able to update the persistent flag on the main TX
- // If we don't do this we would eventually miss a commit record
- tx.setContainsPersistent();
- }
- }
- }
-
- if (pagingPersistent)
- {
- tx.setContainsPersistent();
- for (Pair<PagingStore, List<ServerMessage>> pair : pagingData.values())
- {
- pair.a.sync();
- }
-
- pageTransaction.store(storageManager, pagingManager, tx);
- }
- }
- }
- }
-
private class AddOperation implements TransactionOperation
{
private final List<MessageReference> refs;
@@ -1343,8 +1110,8 @@
}
}
- public Bindings createBindings()
+ public Bindings createBindings(final SimpleString address) throws Exception
{
- return new BindingsImpl(server.getGroupingHandler());
+ return new BindingsImpl(server.getGroupingHandler(), pagingManager.getPageStore(address));
}
}
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/SimpleAddressManager.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/SimpleAddressManager.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/SimpleAddressManager.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -46,7 +46,7 @@
this.bindingsFactory = bindingsFactory;
}
- public boolean addBinding(final Binding binding)
+ public boolean addBinding(final Binding binding) throws Exception
{
if (nameMap.putIfAbsent(binding.getUniqueName(), binding) != null)
{
@@ -56,7 +56,7 @@
return addMappingInternal(binding.getAddress(), binding);
}
- public Binding removeBinding(final SimpleString uniqueName)
+ public Binding removeBinding(final SimpleString uniqueName) throws Exception
{
Binding binding = nameMap.remove(uniqueName);
@@ -70,7 +70,7 @@
return binding;
}
- public Bindings getBindingsForRoutingAddress(final SimpleString address)
+ public Bindings getBindingsForRoutingAddress(final SimpleString address) throws Exception
{
return mappings.get(address);
}
@@ -85,11 +85,11 @@
return nameMap;
}
- public Bindings getMatchingBindings(final SimpleString address)
+ public Bindings getMatchingBindings(final SimpleString address) throws Exception
{
Address add = new AddressImpl(address);
- Bindings bindings = bindingsFactory.createBindings();
+ Bindings bindings = bindingsFactory.createBindings(address);
for (Binding binding : nameMap.values())
{
@@ -149,7 +149,7 @@
return theBinding;
}
- protected boolean addMappingInternal(final SimpleString address, final Binding binding)
+ protected boolean addMappingInternal(final SimpleString address, final Binding binding) throws Exception
{
Bindings bindings = mappings.get(address);
@@ -157,7 +157,7 @@
if (bindings == null)
{
- bindings = bindingsFactory.createBindings();
+ bindings = bindingsFactory.createBindings(address);
prevBindings = mappings.putIfAbsent(address, bindings);
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/WildcardAddressManager.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/WildcardAddressManager.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/WildcardAddressManager.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -57,7 +57,7 @@
}
@Override
- public Bindings getBindingsForRoutingAddress(final SimpleString address)
+ public Bindings getBindingsForRoutingAddress(final SimpleString address) throws Exception
{
Bindings bindings = super.getBindingsForRoutingAddress(address);
@@ -93,7 +93,7 @@
* @return true if the address was a new mapping
*/
@Override
- public boolean addBinding(final Binding binding)
+ public boolean addBinding(final Binding binding) throws Exception
{
boolean exists = super.addBinding(binding);
if (!exists)
@@ -129,7 +129,7 @@
* @return true if this was the last mapping for a specific address
*/
@Override
- public Binding removeBinding(final SimpleString uniqueName)
+ public Binding removeBinding(final SimpleString uniqueName) throws Exception
{
Binding binding = super.removeBinding(uniqueName);
if (binding != null)
@@ -239,7 +239,7 @@
}
}
- private synchronized void removeAndUpdateAddressMap(final Address address)
+ private synchronized void removeAndUpdateAddressMap(final Address address) throws Exception
{
// we only remove if there are no bindings left
Bindings bindings = super.getBindingsForRoutingAddress(address.getAddress());
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/server/ServerSession.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/server/ServerSession.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/server/ServerSession.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -91,7 +91,7 @@
QueueQueryResult executeQueueQuery(SimpleString name) throws Exception;
- BindingQueryResult executeBindingQuery(SimpleString address);
+ BindingQueryResult executeBindingQuery(SimpleString address) throws Exception;
void closeConsumer(long consumerID) throws Exception;
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -471,7 +471,7 @@
return response;
}
- public BindingQueryResult executeBindingQuery(final SimpleString address)
+ public BindingQueryResult executeBindingQuery(final SimpleString address) throws Exception
{
if (address == null)
{
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/client/PagingTest.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -1062,7 +1062,7 @@
super(directory, executorFactory, syncNonTransactional);
}
- public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings) throws Exception
+ public synchronized PagingStore newStore(final SimpleString address, final AddressSettings settings)
{
return new HackPagingStore(address,
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCrashTest.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -287,13 +287,21 @@
// Public --------------------------------------------------------
@Override
- public synchronized PagingStore newStore(final SimpleString destinationName, final AddressSettings settings) throws Exception
+ public synchronized PagingStore newStore(final SimpleString destinationName, final AddressSettings settings)
{
- Field factoryField = PagingStoreFactoryNIO.class.getDeclaredField("executorFactory");
- factoryField.setAccessible(true);
-
- OrderedExecutorFactory factory = (org.hornetq.utils.OrderedExecutorFactory)factoryField.get(this);
- return new FailingPagingStore(destinationName, settings, factory, syncNonTransactional);
+ try
+ {
+ Field factoryField = PagingStoreFactoryNIO.class.getDeclaredField("executorFactory");
+ factoryField.setAccessible(true);
+
+ OrderedExecutorFactory factory = (org.hornetq.utils.OrderedExecutorFactory)factoryField.get(this);
+ return new FailingPagingStore(destinationName, settings, factory, syncNonTransactional);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();// >> junit report
+ return null;
+ }
}
// Package protected ---------------------------------------------
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/paging/impl/PagingStoreImplTest.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -1588,7 +1588,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.paging.PagingStoreFactory#newStore(org.hornetq.utils.SimpleString, org.hornetq.core.settings.impl.AddressSettings)
*/
- public PagingStore newStore(final SimpleString destinationName, final AddressSettings addressSettings) throws Exception
+ public PagingStore newStore(final SimpleString destinationName, final AddressSettings addressSettings)
{
return null;
}
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-11-08 14:22:13 UTC (rev 9852)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/unit/core/postoffice/impl/BindingsImplTest.java 2010-11-08 18:03:29 UTC (rev 9853)
@@ -86,7 +86,7 @@
{
final FakeBinding fake = new FakeBinding(new SimpleString("a"));
- final BindingsImpl bind = new BindingsImpl(null);
+ final BindingsImpl bind = new BindingsImpl(null, null);
bind.addBinding(fake);
bind.addBinding(new FakeBinding(new SimpleString("a")));
bind.addBinding(new FakeBinding(new SimpleString("a")));
13 years, 6 months
JBoss hornetq SVN: r9852 - in trunk: src/main/org/hornetq/api/jms/management and 15 other directories.
by do-not-reply@jboss.org
Author: gaohoward
Date: 2010-11-08 09:22:13 -0500 (Mon, 08 Nov 2010)
New Revision: 9852
Added:
trunk/src/main/org/hornetq/api/jms/management/JMSConnectionInfo.java
trunk/src/main/org/hornetq/api/jms/management/JMSConsumerInfo.java
trunk/src/main/org/hornetq/api/jms/management/JMSSessionInfo.java
trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java
Modified:
trunk/src/main/org/hornetq/api/core/client/ClientSession.java
trunk/src/main/org/hornetq/api/jms/management/DestinationControl.java
trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
trunk/src/main/org/hornetq/api/jms/management/SubscriptionInfo.java
trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
trunk/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
trunk/src/main/org/hornetq/core/server/HornetQServer.java
trunk/src/main/org/hornetq/core/server/Queue.java
trunk/src/main/org/hornetq/core/server/ServerConsumer.java
trunk/src/main/org/hornetq/core/server/ServerSession.java
trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/FakeQueue.java
Log:
HORNETQ-416
Modified: trunk/src/main/org/hornetq/api/core/client/ClientSession.java
===================================================================
--- trunk/src/main/org/hornetq/api/core/client/ClientSession.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/api/core/client/ClientSession.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -562,4 +562,9 @@
*/
void setSendAcknowledgementHandler(SendAcknowledgementHandler handler);
+ /**
+ * Attach any metadata to the session.
+ * @throws HornetQException
+ */
+ void addMetaData(String key, String data) throws HornetQException;
}
Modified: trunk/src/main/org/hornetq/api/jms/management/DestinationControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/DestinationControl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/api/jms/management/DestinationControl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -47,6 +47,16 @@
*/
int getMessageCount() throws Exception;
+ /**
+ * Returns the number of messages that this queue is currently delivering to its consumers.
+ */
+ int getDeliveringCount();
+
+ /**
+ * Returns the number of messages added to this queue since it was created.
+ */
+ long getMessagesAdded();
+
// Operations ----------------------------------------------------
/**
Copied: trunk/src/main/org/hornetq/api/jms/management/JMSConnectionInfo.java (from rev 9826, branches/hornetq-416/src/main/org/hornetq/api/jms/management/JMSConnectionInfo.java)
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSConnectionInfo.java (rev 0)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSConnectionInfo.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.api.jms.management;
+
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * A JMSConnectionInfo
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public class JMSConnectionInfo
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final String connectionID;
+
+ private final String clientAddress;
+
+ private final long creationTime;
+
+ private final String clientID;
+
+ private final String username;
+
+
+ // Static --------------------------------------------------------
+
+ public static JMSConnectionInfo[] from(final String jsonString) throws Exception
+ {
+ JSONArray array = new JSONArray(jsonString);
+ JMSConnectionInfo[] infos = new JMSConnectionInfo[array.length()];
+ for (int i = 0; i < array.length(); i++)
+ {
+ JSONObject obj = array.getJSONObject(i);
+ String cid = obj.isNull("clientID") ? null : obj.getString("clientID");
+ String uname = obj.isNull("principal") ? null : obj.getString("principal");
+
+ JMSConnectionInfo info = new JMSConnectionInfo(obj.getString("connectionID"),
+ obj.getString("clientAddress"),
+ obj.getLong("creationTime"),
+ cid,
+ uname);
+ infos[i] = info;
+ }
+ return infos;
+ }
+
+ // Constructors --------------------------------------------------
+
+ private JMSConnectionInfo(final String connectionID,
+ final String clientAddress,
+ final long creationTime,
+ final String clientID,
+ final String username)
+ {
+ this.connectionID = connectionID;
+ this.clientAddress = clientAddress;
+ this.creationTime = creationTime;
+ this.clientID = clientID;
+ this.username = username;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getConnectionID()
+ {
+ return connectionID;
+ }
+
+ public String getClientAddress()
+ {
+ return clientAddress;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+
+ public String getClientID()
+ {
+ return clientID;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Copied: trunk/src/main/org/hornetq/api/jms/management/JMSConsumerInfo.java (from rev 9826, branches/hornetq-416/src/main/org/hornetq/api/jms/management/JMSConsumerInfo.java)
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSConsumerInfo.java (rev 0)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSConsumerInfo.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.api.jms.management;
+
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link JMSServerControl#listConsumersAsJSON(String)} and related methods.
+ *
+ * @author <a href="mailto:jmesnil@redhat.com">Jeff Mesnil</a>
+ */
+public class JMSConsumerInfo
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final String consumerID;
+
+ private final String connectionID;
+
+ private final String destinationName;
+
+ private final String destinationType;
+
+ private final boolean browseOnly;
+
+ private final long creationTime;
+
+ private final boolean durable;
+
+ private final String filter;
+
+ // Static --------------------------------------------------------
+
+ /**
+ * Returns an array of SubscriptionInfo corresponding to the JSON serialization returned
+ * by {@link TopicControl#listAllSubscriptionsAsJSON()} and related methods.
+ */
+ public static JMSConsumerInfo[] from(final String jsonString) throws Exception
+ {
+ JSONArray array = new JSONArray(jsonString);
+ JMSConsumerInfo[] infos = new JMSConsumerInfo[array.length()];
+ for (int i = 0; i < array.length(); i++)
+ {
+ JSONObject sub = array.getJSONObject(i);
+ JMSConsumerInfo info = new JMSConsumerInfo(sub.getString("consumerID"),
+ sub.getString("connectionID"),
+ sub.getString("destinationName"),
+ sub.getString("destinationType"),
+ sub.getBoolean("browseOnly"),
+ sub.getLong("creationTime"),
+ sub.getBoolean("durable"),
+ sub.optString("filter", null));
+ infos[i] = info;
+ }
+
+ return infos;
+ }
+
+ // Constructors --------------------------------------------------
+
+ private JMSConsumerInfo(final String consumerID,
+ final String connectionID,
+ final String destinationName,
+ final String destinationType,
+ final boolean browseOnly,
+ final long creationTime,
+ final boolean durable,
+ final String filter)
+ {
+ this.consumerID = consumerID;
+ this.connectionID = connectionID;
+ this.destinationName = destinationName;
+ this.destinationType = destinationType;
+ this.browseOnly = browseOnly;
+ this.creationTime = creationTime;
+ this.durable = durable;
+ this.filter = filter;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getConsumerID()
+ {
+ return consumerID;
+ }
+
+ public String getConnectionID()
+ {
+ return connectionID;
+ }
+
+ public String getDestinationName()
+ {
+ return destinationName;
+ }
+
+ public String getDestinationType()
+ {
+ return destinationType;
+ }
+
+ public boolean isBrowseOnly()
+ {
+ return browseOnly;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+
+ /**
+ * @return the durable
+ */
+ public boolean isDurable()
+ {
+ return durable;
+ }
+
+ public String getFilter()
+ {
+ return filter;
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSQueueControl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -51,11 +51,6 @@
void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
/**
- * Returns the number of messages added to this queue since it was created.
- */
- long getMessagesAdded();
-
- /**
* Returns the number of scheduled messages in this queue.
*/
long getScheduledCount();
@@ -66,11 +61,6 @@
int getConsumerCount();
/**
- * Returns the number of messages that this queue is currently delivering to its consumers.
- */
- int getDeliveringCount();
-
- /**
* returns the selector for the queue
*/
String getSelector();
Modified: trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSServerControl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -229,12 +229,55 @@
String[] listConnectionIDs() throws Exception;
/**
+ * Lists all the connections connected to this server.
+ * The returned String is a JSON string containing an array of JMSConnectionInfo objects.
+ *
+ * @see JMSConnectionInfo#from(String)
+ */
+ @Operation(desc = "List all JMS connections")
+ String listConnectionsAsJSON() throws Exception;
+
+ /**
* Lists all the sessions IDs for the specified connection ID.
*/
@Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
/**
+ * Lists all the consumers which belongs to the JMS Connection specified by the connectionID.
+ * The returned String is a JSON string containing an array of JMSConsumerInfo objects.
+ *
+ * @see JMSConsumerInfo#from(String)
+ */
+ @Operation(desc = "List all JMS consumers associated to a JMS Connection")
+ String listConsumersAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+
+ /**
+ * Lists all addresses to which the designated server session has sent messages.
+ */
+ @Operation(desc = "Lists all addresses to which the designated session has sent messages", impact = MBeanOperationInfo.INFO)
+ String[] listTargetDestinations(@Parameter(desc = "a session ID", name = "sessionID") String sessionID) throws Exception;
+
+ /**
+ * Returns the last sent message's ID from the given session to an address.
+ */
+ @Operation(desc = "Returns the last sent message's ID from the given session to an address", impact = MBeanOperationInfo.INFO)
+ String getLastSentMessageID(@Parameter(desc = "session name", name = "sessionID") String sessionID,
+ @Parameter(desc = "address", name = "address") String address) throws Exception;
+
+ /**
+ * Gets the session's creation time.
+ */
+ @Operation(desc = "Gets the sessions creation time", impact = MBeanOperationInfo.INFO)
+ String getSessionCreationTime(@Parameter(desc = "session name", name = "sessionID") String sessionID) throws Exception;
+
+ /**
+ * Lists all the sessions IDs for the specified connection ID.
+ */
+ @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
+ String listSessionsAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+
+ /**
* List all the prepared transaction, sorted by date,
* oldest first, with details, in text format
*/
@@ -247,6 +290,5 @@
*/
@Operation(desc = "List all the prepared transaction, sorted by date, oldest first, with details, in HTML format", impact = MBeanOperationInfo.INFO)
String listPreparedTransactionDetailsAsHTML() throws Exception;
-
}
Copied: trunk/src/main/org/hornetq/api/jms/management/JMSSessionInfo.java (from rev 9826, branches/hornetq-416/src/main/org/hornetq/api/jms/management/JMSSessionInfo.java)
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/JMSSessionInfo.java (rev 0)
+++ trunk/src/main/org/hornetq/api/jms/management/JMSSessionInfo.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.api.jms.management;
+
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONException;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * A JMSSessionInfo
+ *
+ * @author howard
+ *
+ *
+ */
+public class JMSSessionInfo
+{
+ private final String sessionID;
+
+ private final long creationTime;
+
+ public JMSSessionInfo(String sessionID, long creationTime)
+ {
+ this.sessionID = sessionID;
+ this.creationTime = creationTime;
+ }
+
+ public static JMSSessionInfo[] from(final String jsonString) throws JSONException
+ {
+ JSONArray array = new JSONArray(jsonString);
+ JMSSessionInfo[] infos = new JMSSessionInfo[array.length()];
+ for (int i = 0; i < array.length(); i++)
+ {
+ JSONObject obj = array.getJSONObject(i);
+
+ JMSSessionInfo info = new JMSSessionInfo(obj.getString("sessionID"),
+ obj.getLong("creationTime"));
+ infos[i] = info;
+ }
+ return infos;
+ }
+
+ public String getSessionID()
+ {
+ return sessionID;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+}
Modified: trunk/src/main/org/hornetq/api/jms/management/SubscriptionInfo.java
===================================================================
--- trunk/src/main/org/hornetq/api/jms/management/SubscriptionInfo.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/api/jms/management/SubscriptionInfo.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -40,6 +40,8 @@
private final int messageCount;
+ private final int deliveringCount;
+
// Static --------------------------------------------------------
/**
@@ -58,7 +60,8 @@
sub.optString("name", null),
sub.getBoolean("durable"),
sub.optString("selector", null),
- sub.getInt("messageCount"));
+ sub.getInt("messageCount"),
+ sub.getInt("deliveringCount"));
infos[i] = info;
}
@@ -72,7 +75,8 @@
final String name,
final boolean durable,
final String selector,
- final int messageCount)
+ final int messageCount,
+ final int deliveringCount)
{
this.queueName = queueName;
this.clientID = clientID;
@@ -80,6 +84,7 @@
this.durable = durable;
this.selector = selector;
this.messageCount = messageCount;
+ this.deliveringCount = deliveringCount;
}
// Public --------------------------------------------------------
@@ -131,6 +136,14 @@
{
return messageCount;
}
+
+ /**
+ * Returns the number of messages currently delivered to this subscription.
+ */
+ public int getDeliveringCount()
+ {
+ return deliveringCount;
+ }
// Package protected ---------------------------------------------
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -45,6 +45,7 @@
import org.hornetq.core.protocol.core.impl.wireformat.ReattachSessionResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionAddMetaDataMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionCloseMessage;
@@ -1810,4 +1811,9 @@
}
}
+
+ public void addMetaData(String key, String data) throws HornetQException
+ {
+ channel.sendBlocking(new SessionAddMetaDataMessage(key, data));
+ }
}
Modified: trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/client/impl/DelegatingSession.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -555,4 +555,9 @@
{
session.setPacketSize(packetSize);
}
+
+ public void addMetaData(String key, String data) throws HornetQException
+ {
+ session.addMetaData(key, data);
+ }
}
Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -1886,4 +1886,13 @@
}
}
+ public String[] listTargetAddresses(String sessionID)
+ {
+ ServerSession session = server.getSessionByID(sessionID);
+ if (session != null) {
+ return session.getTargetAddresses();
+ }
+ return new String[0];
+ }
+
}
Modified: trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -62,6 +62,7 @@
import org.hornetq.core.protocol.core.impl.wireformat.NullResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionAddMetaDataMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionConsumerCloseMessage;
@@ -460,6 +461,13 @@
session.requestProducerCredits(message.getAddress(), message.getCredits());
break;
}
+ case PacketImpl.SESS_ADD_METADATA:
+ {
+ response = new NullResponseMessage();
+ SessionAddMetaDataMessage message = (SessionAddMetaDataMessage)packet;
+ session.addMetaData(message.getKey(), message.getData());
+ break;
+ }
}
}
catch (HornetQXAException e)
Modified: trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/PacketDecoder.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -78,6 +78,7 @@
import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SET_TIMEOUT_RESP;
import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_START;
import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_XA_SUSPEND;
+import static org.hornetq.core.protocol.core.impl.PacketImpl.SESS_ADD_METADATA;
import org.hornetq.api.core.HornetQBuffer;
import org.hornetq.core.logging.Logger;
@@ -107,6 +108,7 @@
import org.hornetq.core.protocol.core.impl.wireformat.ReplicationResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.RollbackMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionAcknowledgeMessage;
+import org.hornetq.core.protocol.core.impl.wireformat.SessionAddMetaDataMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionBindingQueryResponseMessage;
import org.hornetq.core.protocol.core.impl.wireformat.SessionCloseMessage;
@@ -486,6 +488,11 @@
packet = new SessionForceConsumerDelivery();
break;
}
+ case SESS_ADD_METADATA:
+ {
+ packet = new SessionAddMetaDataMessage();
+ break;
+ }
default:
{
throw new IllegalArgumentException("Invalid type: " + packetType);
Modified: trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/PacketImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -182,6 +182,8 @@
public static final byte REPLICATION_SYNC = 103;
+ public static final byte SESS_ADD_METADATA = 104;
+
// Static --------------------------------------------------------
public PacketImpl(final byte type)
Modified: trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/RemotingConnectionImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -89,6 +89,10 @@
private volatile boolean executing;
+ private final long creationTime;
+
+ private String clientID;
+
// Constructors
// ---------------------------------------------------------------------------------
@@ -129,6 +133,8 @@
this.client = client;
this.executor = executor;
+
+ this.creationTime = System.currentTimeMillis();
}
// RemotingConnection implementation
@@ -160,6 +166,11 @@
{
return transportConnection.getRemoteAddress();
}
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
public synchronized Channel getChannel(final long channelID, final int confWindowSize)
{
@@ -547,4 +558,14 @@
channel.close();
}
}
+
+ public void setClientID(String cID)
+ {
+ clientID = cID;
+ }
+
+ public String getClientID()
+ {
+ return clientID;
+ }
}
Copied: trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java (from rev 9826, branches/hornetq-416/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java)
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java (rev 0)
+++ trunk/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessage.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2010 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.core.protocol.core.impl.wireformat;
+
+import org.hornetq.api.core.HornetQBuffer;
+import org.hornetq.core.protocol.core.impl.PacketImpl;
+
+/**
+ * A SessionAddMetaDataMessage
+ *
+ * @author <a href="mailto:hgao@redhat.com>Howard Gao</a>
+ *
+ *
+ */
+public class SessionAddMetaDataMessage extends PacketImpl
+{
+ private String key;
+ private String data;
+
+ public SessionAddMetaDataMessage()
+ {
+ super(PacketImpl.SESS_ADD_METADATA);
+ }
+
+ public SessionAddMetaDataMessage(String k, String d)
+ {
+ this();
+ key = k;
+ data = d;
+ }
+
+ @Override
+ public void encodeRest(final HornetQBuffer buffer)
+ {
+ buffer.writeString(key);
+ buffer.writeString(data);
+ }
+
+ @Override
+ public void decodeRest(final HornetQBuffer buffer)
+ {
+ key = buffer.readString();
+ data = buffer.readString();
+ }
+
+ @Override
+ public final boolean isRequiresConfirmations()
+ {
+ return false;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public String getData()
+ {
+ return data;
+ }
+
+}
Modified: trunk/src/main/org/hornetq/core/protocol/stomp/StompConnection.java
===================================================================
--- trunk/src/main/org/hornetq/core/protocol/stomp/StompConnection.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/protocol/stomp/StompConnection.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -52,6 +52,8 @@
private boolean valid;
private boolean destroyed = false;
+
+ private final long creationTime;
private StompDecoder decoder = new StompDecoder();
@@ -73,6 +75,8 @@
this.transportConnection = transportConnection;
this.manager = manager;
+
+ this.creationTime = System.currentTimeMillis();
}
public void addFailureListener(final FailureListener listener)
@@ -239,6 +243,11 @@
{
return transportConnection.getRemoteAddress();
}
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
public Connection getTransportConnection()
{
Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -570,4 +570,5 @@
}
}
}
+
}
\ No newline at end of file
Modified: trunk/src/main/org/hornetq/core/server/HornetQServer.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/HornetQServer.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/HornetQServer.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -159,4 +159,6 @@
void deployBridge(BridgeConfiguration config) throws Exception;
void destroyBridge(String name) throws Exception;
+
+ ServerSession getSessionByID(String sessionID);
}
Modified: trunk/src/main/org/hornetq/core/server/Queue.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/Queue.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/Queue.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -157,4 +157,6 @@
void close() throws Exception;
boolean isDirectDeliver();
+
+ SimpleString getAddress();
}
Modified: trunk/src/main/org/hornetq/core/server/ServerConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/ServerConsumer.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -47,6 +47,10 @@
void forceDelivery(long sequence);
void setTransferring(boolean transferring);
+
+ boolean isBrowseOnly();
+
+ long getCreationTime();
}
Modified: trunk/src/main/org/hornetq/core/server/ServerSession.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/ServerSession.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/ServerSession.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -14,6 +14,7 @@
package org.hornetq.core.server;
import java.util.List;
+import java.util.Set;
import javax.transaction.xa.Xid;
@@ -110,4 +111,16 @@
void close(boolean failed) throws Exception;
void setTransferring(boolean transferring);
+
+ Set<ServerConsumer> getServerConsumers();
+
+ void addMetaData(String key, String data);
+
+ String getMetaData(String key);
+
+ String[] getTargetAddresses();
+
+ String getLastSentMessageID(String address);
+
+ long getCreationTime();
}
Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -1513,6 +1513,11 @@
});
}
+
+ public ServerSession getSessionByID(String sessionName)
+ {
+ return sessions.get(sessionName);
+ }
// Inner classes
Modified: trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -238,6 +238,11 @@
{
return name;
}
+
+ public SimpleString getAddress()
+ {
+ return address;
+ }
public long getID()
{
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -126,6 +126,8 @@
*/
private AtomicBoolean writeReady = new AtomicBoolean(true);
+ private final long creationTime;
+
// Constructors ---------------------------------------------------------------------------------
public ServerConsumerImpl(final long id,
@@ -170,6 +172,8 @@
this.callback.addReadyListener(this);
+ this.creationTime = System.currentTimeMillis();
+
if (browseOnly)
{
browserDeliverer = new BrowserDeliverer(messageQueue.iterator());
@@ -188,6 +192,16 @@
return id;
}
+ public boolean isBrowseOnly()
+ {
+ return browseOnly;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+
public HandleStatus handle(final MessageReference ref) throws Exception
{
if (availableCredits != null && availableCredits.get() <= 0)
Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -16,8 +16,10 @@
import static org.hornetq.api.core.management.NotificationType.CONSUMER_CREATED;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -64,6 +66,7 @@
import org.hornetq.spi.core.protocol.RemotingConnection;
import org.hornetq.spi.core.protocol.SessionCallback;
import org.hornetq.utils.TypedProperties;
+import org.hornetq.utils.UUID;
/*
* Session implementation
@@ -135,7 +138,13 @@
private volatile SimpleString defaultAddress;
private volatile int timeoutSeconds;
+
+ private Map<String, String> metaData;
+ private Map<SimpleString, UUID> targetAddressInfos = new HashMap<SimpleString, UUID>();
+
+ private long creationTime = System.currentTimeMillis();
+
// Constructors ---------------------------------------------------------------------------------
public ServerSessionImpl(final String name,
@@ -232,6 +241,11 @@
{
return remotingConnection.getID();
}
+
+ public Set<ServerConsumer> getServerConsumers() {
+ Set<ServerConsumer> consumersClone = new HashSet<ServerConsumer>(consumers.values());
+ return Collections.unmodifiableSet(consumersClone);
+ }
public void removeConsumer(final long consumerID) throws Exception
{
@@ -1173,8 +1187,58 @@
}
postOffice.route(msg, routingContext, direct);
+
+ targetAddressInfos.put(msg.getAddress(), msg.getUserID());
routingContext.clear();
}
+ public void addMetaData(String key, String data)
+ {
+ if (metaData == null)
+ {
+ metaData = new HashMap<String, String>();
+ }
+ metaData.put(key, data);
+ }
+
+ public String getMetaData(String key)
+ {
+ String data = null;
+ if (metaData != null)
+ {
+ data = metaData.get(key);
+ }
+ return data;
+ }
+
+ public String[] getTargetAddresses()
+ {
+ Map<SimpleString, UUID> copy = new HashMap<SimpleString, UUID>(targetAddressInfos);
+ Iterator<SimpleString> iter = copy.keySet().iterator();
+ int num = copy.keySet().size();
+ String[] addresses = new String[num];
+ int i = 0;
+ while (iter.hasNext())
+ {
+ addresses[i] = iter.next().toString();
+ i++;
+ }
+ return addresses;
+ }
+
+ public String getLastSentMessageID(String address)
+ {
+ UUID id = targetAddressInfos.get(SimpleString.toSimpleString(address));
+ if (id != null)
+ {
+ return id.toString();
+ }
+ return null;
+ }
+
+ public long getCreationTime()
+ {
+ return this.creationTime;
+ }
}
Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnection.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -181,6 +181,16 @@
}
this.clientID = clientID;
+ try
+ {
+ this.addSessionMetaData(initialSession);
+ }
+ catch (HornetQException e)
+ {
+ JMSException ex = new JMSException("Internal error setting metadata jms-client-id");
+ ex.setLinkedException(e);
+ throw ex;
+ }
justCreated = false;
}
@@ -537,6 +547,8 @@
{
session.start();
}
+
+ this.addSessionMetaData(session);
return jbs;
}
@@ -562,6 +574,8 @@
{
initialSession = sessionFactory.createSession(username, password, false, false, false, false, 0);
+ addSessionMetaData(initialSession);
+
initialSession.addFailureListener(listener);
}
catch (HornetQException me)
@@ -570,6 +584,15 @@
}
}
+ private void addSessionMetaData(ClientSession session) throws HornetQException
+ {
+ session.addMetaData("jms-session", "");
+ if (clientID != null)
+ {
+ session.addMetaData("jms-client-id", clientID);
+ }
+ }
+
// Inner classes --------------------------------------------------------------------------------
private static class JMSFailureListener implements SessionFailureListener
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -14,8 +14,10 @@
package org.hornetq.jms.management.impl;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import javax.management.ListenerNotFoundException;
@@ -32,11 +34,20 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.ManagementHelper;
import org.hornetq.api.jms.management.ConnectionFactoryControl;
+import org.hornetq.api.jms.management.DestinationControl;
import org.hornetq.api.jms.management.JMSQueueControl;
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.api.jms.management.TopicControl;
+import org.hornetq.core.filter.Filter;
import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.server.ServerConsumer;
+import org.hornetq.core.server.ServerSession;
+import org.hornetq.jms.client.HornetQDestination;
+import org.hornetq.jms.client.HornetQQueue;
import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.spi.core.protocol.RemotingConnection;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
import org.hornetq.jms.server.impl.JMSFactoryType;
/**
@@ -86,6 +97,38 @@
}
return trimmed;
}
+
+ private static String[] determineJMSDestination(String coreAddress)
+ {
+ String[] result = new String[2]; // destination name & type
+ if (coreAddress.startsWith(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX))
+ {
+ result[0] = coreAddress.substring(HornetQQueue.JMS_QUEUE_ADDRESS_PREFIX.length());
+ result[1] = "queue";
+ }
+ else if (coreAddress.startsWith(HornetQQueue.JMS_TEMP_QUEUE_ADDRESS_PREFIX))
+ {
+ result[0] = coreAddress.substring(HornetQQueue.JMS_TEMP_QUEUE_ADDRESS_PREFIX.length());
+ result[1] = "tempqueue";
+ }
+ else if (coreAddress.startsWith(HornetQQueue.JMS_TOPIC_ADDRESS_PREFIX))
+ {
+ result[0] = coreAddress.substring(HornetQQueue.JMS_TOPIC_ADDRESS_PREFIX.length());
+ result[1] = "topic";
+ }
+ else if (coreAddress.startsWith(HornetQQueue.JMS_TEMP_TOPIC_ADDRESS_PREFIX))
+ {
+ result[0] = coreAddress.substring(HornetQQueue.JMS_TEMP_TOPIC_ADDRESS_PREFIX.length());
+ result[1] = "temptopic";
+ }
+ else
+ {
+ System.out.println("JMSServerControlImpl.determineJMSDestination()" + coreAddress);
+ // not related to JMS
+ return null;
+ }
+ return result;
+ }
private static List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
final Object[] liveConnectorTransportParams,
@@ -682,7 +725,116 @@
blockOnIO();
}
}
+
+ public String listConnectionsAsJSON() throws Exception
+ {
+ checkStarted();
+ clearIO();
+
+ try
+ {
+ JSONArray array = new JSONArray();
+
+ Set<RemotingConnection> connections = server.getHornetQServer().getRemotingService().getConnections();
+
+ Set<ServerSession> sessions = server.getHornetQServer().getSessions();
+
+ Map<Object, ServerSession> jmsSessions = new HashMap<Object, ServerSession>();
+
+ for (ServerSession session : sessions)
+ {
+ if (session.getMetaData("jms-session") != null)
+ {
+ jmsSessions.put(session.getConnectionID(), session);
+ }
+ }
+
+ for (RemotingConnection connection : connections)
+ {
+ JSONObject obj = new JSONObject();
+ obj.put("connectionID", connection.getID().toString());
+ obj.put("clientAddress", connection.getRemoteAddress());
+ obj.put("creationTime", connection.getCreationTime());
+ obj.put("clientID", jmsSessions.get(connection.getID()).getMetaData("jms-client-id"));
+ obj.put("principal", jmsSessions.get(connection.getID()).getUsername());
+ array.put(obj);
+ }
+ return array.toString();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
+ public String listConsumersAsJSON(String connectionID) throws Exception
+ {
+ checkStarted();
+
+ clearIO();
+
+ try
+ {
+ JSONArray array = new JSONArray();
+
+ Set<RemotingConnection> connections = server.getHornetQServer().getRemotingService().getConnections();
+ for (RemotingConnection connection : connections)
+ {
+ if (connectionID.equals(connection.getID().toString()))
+ {
+ List<ServerSession> sessions = server.getHornetQServer().getSessions(connectionID);
+ for (ServerSession session : sessions)
+ {
+ Set<ServerConsumer> consumers = session.getServerConsumers();
+ for (ServerConsumer consumer : consumers)
+ {
+ JSONObject obj = new JSONObject();
+ obj.put("consumerID", consumer.getID());
+ obj.put("connectionID", connectionID);
+ obj.put("queueName", consumer.getQueue().getName().toString());
+ obj.put("browseOnly", consumer.isBrowseOnly());
+ obj.put("creationTime", consumer.getCreationTime());
+ // JMS consumer with message filter use the queue's filter
+ Filter queueFilter = consumer.getQueue().getFilter();
+ if (queueFilter != null)
+ {
+ obj.put("filter", queueFilter.getFilterString().toString());
+ }
+ String[] destinationInfo = determineJMSDestination(consumer.getQueue().getAddress().toString());
+ if (destinationInfo == null)
+ {
+ continue;
+ }
+ obj.put("destinationName", destinationInfo[0]);
+ obj.put("destinationType", destinationInfo[1]);
+ if (destinationInfo[1].equals("topic")) {
+ try
+ {
+ HornetQDestination.decomposeQueueNameForDurableSubscription(consumer.getQueue().getName().toString());
+ obj.put("durable", true);
+ } catch (IllegalArgumentException e)
+ {
+ obj.put("durable", false);
+ }
+ }
+ else
+ {
+ obj.put("durable", false);
+ }
+ array.put(obj);
+ }
+ }
+ }
+ }
+ return array.toString();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
+
public String[] listSessions(final String connectionID) throws Exception
{
checkStarted();
@@ -816,4 +968,81 @@
}
return list;
}
+
+ public String[] listTargetDestinations(String sessionID) throws Exception
+ {
+ String[] addresses = server.getHornetQServer().getHornetQServerControl().listTargetAddresses(sessionID);
+ Map<String, DestinationControl> allDests = new HashMap<String, DestinationControl>();
+
+ Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
+ for (int i = 0; i < queueControls.length; i++)
+ {
+ JMSQueueControl queueControl = (JMSQueueControl)queueControls[i];
+ allDests.put(queueControl.getAddress(), queueControl);
+ }
+
+ Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
+ for (int i = 0; i < topicControls.length; i++)
+ {
+ TopicControl topicControl = (TopicControl)topicControls[i];
+ allDests.put(topicControl.getAddress(), topicControl);
+ }
+
+ List<String> destinations = new ArrayList<String>();
+ for (int i = 0; i < addresses.length; i++)
+ {
+ DestinationControl control = allDests.get(addresses[i]);
+ if (control != null)
+ {
+ destinations.add(control.getAddress());
+ }
+ }
+ return destinations.toArray(new String[0]);
+ }
+
+ public String getLastSentMessageID(String sessionID, String address) throws Exception
+ {
+ ServerSession session = server.getHornetQServer().getSessionByID(sessionID);
+ if (session != null)
+ {
+ return session.getLastSentMessageID(address);
+ }
+ return null;
+ }
+
+ public String getSessionCreationTime(String sessionID) throws Exception
+ {
+ ServerSession session = server.getHornetQServer().getSessionByID(sessionID);
+ if (session != null)
+ {
+ return String.valueOf(session.getCreationTime());
+ }
+ return null;
+ }
+
+ public String listSessionsAsJSON(final String connectionID) throws Exception
+ {
+ checkStarted();
+
+ clearIO();
+
+ JSONArray array = new JSONArray();
+ try
+ {
+ List<ServerSession> sessions = server.getHornetQServer().getSessions(connectionID);
+ for (ServerSession sess : sessions)
+ {
+ JSONObject obj = new JSONObject();
+ obj.put("sessionID", sess.getName());
+ obj.put("creationTime", sess.getCreationTime());
+ array.put(obj);
+ }
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ return array.toString();
+ }
+
}
Modified: trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -118,6 +118,28 @@
return getMessageCount(DurabilityType.ALL);
}
+ public int getDeliveringCount()
+ {
+ List<QueueControl> queues = getQueues(DurabilityType.ALL);
+ int count = 0;
+ for (QueueControl queue : queues)
+ {
+ count += queue.getDeliveringCount();
+ }
+ return count;
+ }
+
+ public long getMessagesAdded()
+ {
+ List<QueueControl> queues = getQueues(DurabilityType.ALL);
+ int count = 0;
+ for (QueueControl queue : queues)
+ {
+ count += queue.getMessagesAdded();
+ }
+ return count;
+ }
+
public int getDurableMessageCount()
{
return getMessageCount(DurabilityType.DURABLE);
@@ -315,6 +337,7 @@
info.put("name", subName);
info.put("durable", queue.isDurable());
info.put("messageCount", queue.getMessageCount());
+ info.put("deliveringCount", queue.getDeliveringCount());
array.put(info);
}
Modified: trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java
===================================================================
--- trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/src/main/org/hornetq/spi/core/protocol/RemotingConnection.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -13,6 +13,7 @@
package org.hornetq.spi.core.protocol;
+import java.util.Collection;
import java.util.List;
import org.hornetq.api.core.HornetQBuffer;
@@ -38,6 +39,11 @@
Object getID();
/**
+ * Returns the creation time of the Remoting connection
+ */
+ long getCreationTime();
+
+ /**
* returns a string representation of the remote address of this connection
*
* @return the remote address
Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -1390,6 +1390,24 @@
// TODO Auto-generated method stub
}
+
+ /* (non-Javadoc)
+ * @see org.hornetq.api.core.client.ClientSession#setClientID(java.lang.String)
+ */
+ public void setClientID(String clientID)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.hornetq.api.core.client.ClientSession#addMetaData(java.lang.String, java.lang.String)
+ */
+ public void addMetaData(String key, String data) throws HornetQException
+ {
+ // TODO Auto-generated method stub
+
+ }
}
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -21,11 +21,23 @@
import javax.jms.ConnectionFactory;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.Session;
+import javax.jms.TemporaryTopic;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
import junit.framework.Assert;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.jms.HornetQJMSClient;
+import org.hornetq.api.jms.management.JMSConnectionInfo;
+import org.hornetq.api.jms.management.JMSConsumerInfo;
import org.hornetq.api.jms.management.JMSServerControl;
+import org.hornetq.api.jms.management.JMSSessionInfo;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.logging.Logger;
@@ -35,6 +47,7 @@
import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.core.server.HornetQServer;
import org.hornetq.core.server.HornetQServers;
+import org.hornetq.jms.client.HornetQQueue;
import org.hornetq.jms.server.impl.JMSServerManagerImpl;
import org.hornetq.tests.integration.management.ManagementControlHelper;
import org.hornetq.tests.integration.management.ManagementTestBase;
@@ -139,7 +152,300 @@
{
doListConnectionIDs(NettyAcceptorFactory.class.getName(), NettyConnectorFactory.class.getName());
}
+
+ public void testListConnectionsAsJSONForNetty() throws Exception
+ {
+ doListConnectionsAsJSON(NettyAcceptorFactory.class.getName(), NettyConnectorFactory.class.getName());
+ }
+ public void testListConnectionsAsJSONForInVM() throws Exception
+ {
+ doListConnectionsAsJSON(InVMAcceptorFactory.class.getName(), InVMConnectorFactory.class.getName());
+ }
+
+ public void testListConsumersAsJSON() throws Exception
+ {
+ String queueName = RandomUtil.randomString();
+
+ try
+ {
+ startHornetQServer(NettyAcceptorFactory.class.getName());
+ serverManager.createQueue(false, queueName, null, true, queueName);
+ Queue queue = HornetQJMSClient.createQueue(queueName);
+
+ JMSServerControl control = createManagementControl();
+
+ long startTime = System.currentTimeMillis();
+
+ String jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(0, infos.length);
+
+ ConnectionFactory cf1 = JMSUtil.createFactory(NettyConnectorFactory.class.getName(),
+ JMSServerControl2Test.CONNECTION_TTL,
+ JMSServerControl2Test.PING_PERIOD);
+ Connection connection = cf1.createConnection();
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ TemporaryTopic temporaryTopic = session.createTemporaryTopic();
+
+ // create a regular message consumer
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(1, infos.length);
+ String connectionID = infos[0].getConnectionID();
+
+ String consJsonStr = control.listConsumersAsJSON(connectionID);
+ assertNotNull(consJsonStr);
+ JMSConsumerInfo[] consumerInfos = JMSConsumerInfo.from(consJsonStr);
+ assertEquals(1, consumerInfos.length);
+ JMSConsumerInfo consumerInfo = consumerInfos[0];
+ assertNotNull(consumerInfo.getConsumerID());
+ assertEquals(connectionID, consumerInfo.getConnectionID());
+ assertEquals(queue.getQueueName(), consumerInfo.getDestinationName());
+ assertEquals("queue", consumerInfo.getDestinationType());
+ assertNull(consumerInfo.getFilter());
+ assertEquals(false, consumerInfo.isBrowseOnly());
+ assertEquals(false, consumerInfo.isDurable());
+ assertTrue(startTime <= consumerInfo.getCreationTime() && consumerInfo.getCreationTime() <= System.currentTimeMillis());
+
+ consumer.close();
+
+ consJsonStr = control.listConsumersAsJSON(connectionID);
+ assertNotNull(consJsonStr);
+ consumerInfos = JMSConsumerInfo.from(consJsonStr);
+ assertEquals(0, consumerInfos.length);
+
+ // create a queue browser
+ QueueBrowser browser = session.createBrowser(queue);
+ // the server resources are created when the browser starts enumerating
+ browser.getEnumeration();
+
+ consJsonStr = control.listConsumersAsJSON(connectionID);
+ assertNotNull(consJsonStr);
+ System.out.println(consJsonStr);
+ consumerInfos = JMSConsumerInfo.from(consJsonStr);
+ assertEquals(1, consumerInfos.length);
+ consumerInfo = consumerInfos[0];
+ assertNotNull(consumerInfo.getConsumerID());
+ assertEquals(connectionID, consumerInfo.getConnectionID());
+ assertEquals(queue.getQueueName(), consumerInfo.getDestinationName());
+ assertEquals("queue", consumerInfo.getDestinationType());
+ assertNull(consumerInfo.getFilter());
+ assertEquals(true, consumerInfo.isBrowseOnly());
+ assertEquals(false, consumerInfo.isDurable());
+ assertTrue(startTime <= consumerInfo.getCreationTime() && consumerInfo.getCreationTime() <= System.currentTimeMillis());
+
+ browser.close();
+
+ // create a regular consumer w/ filter on a temp topic
+ String filter = "color = 'red'";
+ consumer = session.createConsumer(temporaryTopic, filter);
+
+ consJsonStr = control.listConsumersAsJSON(connectionID);
+ assertNotNull(consJsonStr);
+ System.out.println(consJsonStr);
+ consumerInfos = JMSConsumerInfo.from(consJsonStr);
+ assertEquals(1, consumerInfos.length);
+ consumerInfo = consumerInfos[0];
+ assertNotNull(consumerInfo.getConsumerID());
+ assertEquals(connectionID, consumerInfo.getConnectionID());
+ assertEquals(temporaryTopic.getTopicName(), consumerInfo.getDestinationName());
+ assertEquals("temptopic", consumerInfo.getDestinationType());
+ assertEquals(filter, consumerInfo.getFilter());
+ assertEquals(false, consumerInfo.isBrowseOnly());
+ assertEquals(false, consumerInfo.isDurable());
+ assertTrue(startTime <= consumerInfo.getCreationTime() && consumerInfo.getCreationTime() <= System.currentTimeMillis());
+
+ consumer.close();
+
+ connection.close();
+ }
+ finally
+ {
+ if (serverManager != null)
+ {
+ serverManager.destroyQueue(queueName);
+ serverManager.stop();
+ }
+
+ if (server != null)
+ {
+ server.stop();
+ }
+ }
+ }
+
+ /**
+ * test for durable subscriber
+ */
+ public void testListConsumersAsJSON2() throws Exception
+ {
+ String topicName = RandomUtil.randomString();
+ String clientID = RandomUtil.randomString();
+ String subName = RandomUtil.randomString();
+
+ try
+ {
+ startHornetQServer(NettyAcceptorFactory.class.getName());
+ serverManager.createTopic(false, topicName, topicName);
+ Topic topic = HornetQJMSClient.createTopic(topicName);
+
+ JMSServerControl control = createManagementControl();
+
+ long startTime = System.currentTimeMillis();
+
+ String jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(0, infos.length);
+
+ ConnectionFactory cf1 = JMSUtil.createFactory(NettyConnectorFactory.class.getName(),
+ JMSServerControl2Test.CONNECTION_TTL,
+ JMSServerControl2Test.PING_PERIOD);
+ Connection connection = cf1.createConnection();
+ connection.setClientID(clientID);
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ // create a durable subscriber
+ MessageConsumer consumer = session.createDurableSubscriber(topic, subName);
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(1, infos.length);
+ String connectionID = infos[0].getConnectionID();
+
+ String consJsonStr = control.listConsumersAsJSON(connectionID);
+ assertNotNull(consJsonStr);
+ JMSConsumerInfo[] consumerInfos = JMSConsumerInfo.from(consJsonStr);
+ assertEquals(1, consumerInfos.length);
+ JMSConsumerInfo consumerInfo = consumerInfos[0];
+ assertNotNull(consumerInfo.getConsumerID());
+ assertEquals(connectionID, consumerInfo.getConnectionID());
+ assertEquals(topic.getTopicName(), consumerInfo.getDestinationName());
+ assertEquals("topic", consumerInfo.getDestinationType());
+ assertNull(consumerInfo.getFilter());
+ assertEquals(false, consumerInfo.isBrowseOnly());
+ assertEquals(true, consumerInfo.isDurable());
+ assertTrue(startTime <= consumerInfo.getCreationTime() && consumerInfo.getCreationTime() <= System.currentTimeMillis());
+
+ consumer.close();
+
+ connection.close();
+ }
+ finally
+ {
+ if (serverManager != null)
+ {
+ serverManager.destroyTopic(topicName);
+ serverManager.stop();
+ }
+
+ if (server != null)
+ {
+ server.stop();
+ }
+ }
+ }
+
+ //https://jira.jboss.org/browse/HORNETQ-416
+ public void testProducerInfo() throws Exception
+ {
+ String queueName = RandomUtil.randomString();
+
+ System.out.println("queueName is: " + queueName);
+
+ try
+ {
+ startHornetQServer(NettyAcceptorFactory.class.getName());
+ serverManager.createQueue(false, queueName, null, true, queueName);
+ Queue queue = HornetQJMSClient.createQueue(queueName);
+
+ JMSServerControl control = createManagementControl();
+
+ long startTime = System.currentTimeMillis();
+
+ ConnectionFactory cf1 = JMSUtil.createFactory(NettyConnectorFactory.class.getName(),
+ JMSServerControl2Test.CONNECTION_TTL,
+ JMSServerControl2Test.PING_PERIOD);
+ Connection connection = cf1.createConnection();
+ Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ MessageProducer producer = session.createProducer(queue);
+
+ for (int i = 0; i < 10; i++)
+ {
+ TextMessage msg = session.createTextMessage("mymessage-" + i);
+ producer.send(msg);
+ }
+
+ connection.start();
+
+ // create a regular message consumer
+ MessageConsumer consumer = session.createConsumer(queue);
+
+ TextMessage receivedMsg = null;
+ for (int i = 0; i < 10; i++)
+ {
+ receivedMsg = (TextMessage)consumer.receive(3000);
+ System.out.println("receiveMsg: " + receivedMsg);
+ }
+
+ String lastMsgID = receivedMsg.getJMSMessageID();
+ System.out.println("Last mid: " + lastMsgID);
+
+ String jsonStr = control.listConnectionsAsJSON();
+ JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonStr);
+
+ JMSConnectionInfo connInfo = infos[0];
+
+ String sessionsStr = control.listSessionsAsJSON(connInfo.getConnectionID());
+ JMSSessionInfo[] sessInfos = JMSSessionInfo.from(sessionsStr);
+
+ assertTrue(sessInfos.length > 0);
+ boolean lastMsgFound = false;
+ for (JMSSessionInfo sInfo : sessInfos)
+ {
+ System.out.println("Session name: " + sInfo.getSessionID());
+ assertNotNull(sInfo.getSessionID());
+ long createTime = sInfo.getCreationTime();
+ assertTrue(startTime <= createTime && createTime <= System.currentTimeMillis());
+ String lastID = control.getLastSentMessageID(sInfo.getSessionID(), "jms.queue." + queueName);
+ if (lastID != null)
+ {
+ assertEquals(lastMsgID, lastID);
+ lastMsgFound = true;
+ }
+ }
+ assertTrue(lastMsgFound);
+
+ consumer.close();
+
+ connection.close();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ throw e;
+ }
+ finally
+ {
+ if (serverManager != null)
+ {
+ serverManager.destroyQueue(queueName);
+ serverManager.stop();
+ }
+
+ if (server != null)
+ {
+ server.stop();
+ }
+ }
+ }
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
@@ -207,6 +513,95 @@
}
}
+ private void doListConnectionsAsJSON(final String acceptorFactory, final String connectorFactory) throws Exception
+ {
+ try
+ {
+ startHornetQServer(acceptorFactory);
+
+ JMSServerControl control = createManagementControl();
+
+ long startTime = System.currentTimeMillis();
+
+ String jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ JMSConnectionInfo[] infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(0, infos.length);
+
+ ConnectionFactory cf1 = JMSUtil.createFactory(connectorFactory,
+ JMSServerControl2Test.CONNECTION_TTL,
+ JMSServerControl2Test.PING_PERIOD);
+ Connection connection = cf1.createConnection();
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(1, infos.length);
+ for (JMSConnectionInfo info : infos)
+ {
+ assertNotNull(info.getConnectionID());
+ assertNotNull(info.getClientAddress());
+ assertTrue(startTime <= info.getCreationTime() && info.getCreationTime() <= System.currentTimeMillis());
+ }
+
+ ConnectionFactory cf2 = JMSUtil.createFactory(connectorFactory,
+ JMSServerControl2Test.CONNECTION_TTL,
+ JMSServerControl2Test.PING_PERIOD);
+ Connection connection2 = cf2.createConnection();
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(2, infos.length);
+ for (JMSConnectionInfo info : infos)
+ {
+ assertNotNull(info.getConnectionID());
+ assertNotNull(info.getClientAddress());
+ assertTrue(startTime <= info.getCreationTime() && info.getCreationTime() <= System.currentTimeMillis());
+ assertNull(info.getClientID());
+ assertNull(info.getUsername());
+ }
+
+ connection.close();
+
+ waitForConnectionIDs(1, control);
+
+ connection2.close();
+
+ waitForConnectionIDs(0, control);
+
+ Connection connection3 = cf2.createConnection("guest", "guest");
+ connection3.setClientID("MyClient");
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+
+ infos = JMSConnectionInfo.from(jsonStr);
+ JMSConnectionInfo info = infos[0];
+ assertEquals("MyClient", info.getClientID());
+ assertEquals("guest", info.getUsername());
+
+ connection3.close();
+
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
+ assertEquals(0, infos.length);
+ }
+ finally
+ {
+ if (serverManager != null)
+ {
+ serverManager.stop();
+ }
+
+ if (server != null)
+ {
+ server.stop();
+ }
+ }
+ }
+
private void waitForConnectionIDs(final int num, final JMSServerControl control) throws Exception
{
final long timeout = 10000;
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -21,14 +21,12 @@
import javax.jms.Session;
import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.management.Parameter;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.JMSServerControl;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
import org.hornetq.core.security.Role;
import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.client.HornetQDestination;
import org.hornetq.jms.client.HornetQQueue;
/**
@@ -233,6 +231,16 @@
{
return (String[])proxy.invokeOperation("listConnectionIDs");
}
+
+ public String listConnectionsAsJSON() throws Exception
+ {
+ return (String)proxy.invokeOperation("listConnectionsAsJSON");
+ }
+
+ public String listConsumersAsJSON(String connectionID) throws Exception
+ {
+ return (String)proxy.invokeOperation("listConsumersAsJSON", connectionID);
+ }
public String[] listRemoteAddresses() throws Exception
{
@@ -275,6 +283,27 @@
return (Boolean)proxy.invokeOperation("createTopic", name, jndiBinding);
}
+ public String[] listTargetDestinations(String sessionID) throws Exception
+ {
+ return null;
+ }
+
+ public String getLastSentMessageID(String sessionID, String address) throws Exception
+ {
+ return null;
+ }
+
+ public String getSessionCreationTime(String sessionID) throws Exception
+ {
+ return null;
+ }
+
+ public String listSessionsAsJSON(String connectionID) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
public String listPreparedTransactionDetailsAsJSON() throws Exception
{
return (String)proxy.invokeOperation("listPreparedTransactionDetailsAsJSON");
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSUtil.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -78,26 +78,36 @@
}
static MessageConsumer createConsumer(final Connection connection,
+ final Destination destination) throws JMSException
+ {
+ return createConsumer(connection, destination, Session.AUTO_ACKNOWLEDGE);
+ }
+
+ static MessageConsumer createConsumer(final Connection connection,
final Destination destination,
- final String connectorFactory) throws JMSException
+ int ackMode) throws JMSException
{
- Session s = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session s = connection.createSession(false, ackMode);
return s.createConsumer(destination);
}
- public static MessageConsumer createConsumer(final Connection connection, final Destination destination) throws JMSException
+ static TopicSubscriber createDurableSubscriber(final Connection connection,
+ final Topic topic,
+ final String clientID,
+ final String subscriptionName) throws JMSException
{
- return JMSUtil.createConsumer(connection, destination, InVMConnectorFactory.class.getName());
+ return createDurableSubscriber(connection, topic, clientID, subscriptionName, Session.AUTO_ACKNOWLEDGE);
}
-
+
static TopicSubscriber createDurableSubscriber(final Connection connection,
final Topic topic,
final String clientID,
- final String subscriptionName) throws JMSException
+ final String subscriptionName,
+ final int ackMode) throws JMSException
{
connection.setClientID(clientID);
- Session s = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Session s = connection.createSession(false, ackMode);
return s.createDurableSubscriber(topic, subscriptionName);
}
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -13,15 +13,22 @@
package org.hornetq.tests.integration.jms.server.management;
+import static junit.framework.Assert.assertEquals;
+
import java.util.Map;
import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.TopicSubscriber;
import junit.framework.Assert;
+import org.hornetq.api.core.SimpleString;
import org.hornetq.api.core.TransportConfiguration;
+import org.hornetq.api.core.client.ClientProducer;
+import org.hornetq.api.core.management.QueueControl;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.management.SubscriptionInfo;
import org.hornetq.api.jms.management.TopicControl;
@@ -406,7 +413,77 @@
{
}
}
+
+ public void testGetMessagesAdded() throws Exception
+ {
+ Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createConsumer(connection_1, topic);
+ Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
+ Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
+ TopicControl topicControl = createManagementControl();
+
+ Assert.assertEquals(0, topicControl.getMessagesAdded());
+
+ JMSUtil.sendMessages(topic, 2);
+
+ Assert.assertEquals(3 * 2, topicControl.getMessagesAdded());
+
+ connection_1.close();
+ connection_2.close();
+ connection_3.close();
+ }
+
+ public void testGetMessagesDelivering() throws Exception
+ {
+ Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_1 = JMSUtil.createConsumer(connection_1, topic, Session.CLIENT_ACKNOWLEDGE);
+ Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName, Session.CLIENT_ACKNOWLEDGE);
+ Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_3 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2", Session.CLIENT_ACKNOWLEDGE);
+
+ TopicControl topicControl = createManagementControl();
+
+ assertEquals(0, topicControl.getDeliveringCount());
+
+ JMSUtil.sendMessages(topic, 2);
+
+ assertEquals(0, topicControl.getDeliveringCount());
+
+ connection_1.start();
+ connection_2.start();
+ connection_3.start();
+
+ Message msg_1 = null;
+ Message msg_2 = null;
+ Message msg_3 = null;
+ for (int i = 0; i < 2; i++)
+ {
+ msg_1 = cons_1.receive(5000);
+ assertNotNull(msg_1);
+ msg_2 = cons_2.receive(5000);
+ assertNotNull(msg_2);
+ msg_3 = cons_3.receive(5000);
+ assertNotNull(msg_3);
+ }
+
+ assertEquals(3 * 2, topicControl.getDeliveringCount());
+
+ msg_1.acknowledge();
+ assertEquals(2 * 2, topicControl.getDeliveringCount());
+ msg_2.acknowledge();
+ assertEquals(1 * 2, topicControl.getDeliveringCount());
+ msg_3.acknowledge();
+ assertEquals(0, topicControl.getDeliveringCount());
+
+ connection_1.close();
+ connection_2.close();
+ connection_3.close();
+ }
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlUsingJMSTest.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -13,9 +13,12 @@
package org.hornetq.tests.integration.jms.server.management;
+import static junit.framework.Assert.assertEquals;
import static org.hornetq.tests.util.RandomUtil.randomString;
import javax.jms.Connection;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
import javax.jms.QueueConnection;
import javax.jms.QueueSession;
import javax.jms.Session;
@@ -26,6 +29,7 @@
import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.core.management.ResourceNames;
import org.hornetq.api.jms.HornetQJMSClient;
+import org.hornetq.api.jms.management.TopicControl;
import org.hornetq.core.config.Configuration;
import org.hornetq.core.config.impl.ConfigurationImpl;
import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
@@ -333,6 +337,71 @@
}
}
+ public void testGetMessagesAdded() throws Exception
+ {
+ Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createConsumer(connection_1, topic);
+ Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName);
+ Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
+
+ assertEquals(0, proxy.retrieveAttributeValue("messagesAdded"));
+
+ JMSUtil.sendMessages(topic, 2);
+
+ assertEquals(3 * 2, proxy.retrieveAttributeValue("messagesAdded"));
+
+ connection_1.close();
+ connection_2.close();
+ connection_3.close();
+ }
+
+ public void testGetMessagesDelivering() throws Exception
+ {
+ Connection connection_1 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_1 = JMSUtil.createConsumer(connection_1, topic, Session.CLIENT_ACKNOWLEDGE);
+ Connection connection_2 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_2 = JMSUtil.createDurableSubscriber(connection_2, topic, clientID, subscriptionName, Session.CLIENT_ACKNOWLEDGE);
+ Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
+ MessageConsumer cons_3 = JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2", Session.CLIENT_ACKNOWLEDGE);
+
+ assertEquals(0, proxy.retrieveAttributeValue("deliveringCount"));
+
+ JMSUtil.sendMessages(topic, 2);
+
+ assertEquals(0, proxy.retrieveAttributeValue("deliveringCount"));
+
+ connection_1.start();
+ connection_2.start();
+ connection_3.start();
+
+ Message msg_1 = null;
+ Message msg_2 = null;
+ Message msg_3 = null;
+ for (int i = 0; i < 2; i++)
+ {
+ msg_1 = cons_1.receive(5000);
+ assertNotNull(msg_1);
+ msg_2 = cons_2.receive(5000);
+ assertNotNull(msg_2);
+ msg_3 = cons_3.receive(5000);
+ assertNotNull(msg_3);
+ }
+
+ assertEquals(3 * 2, proxy.retrieveAttributeValue("deliveringCount"));
+
+ msg_1.acknowledge();
+ assertEquals(2 * 2, proxy.retrieveAttributeValue("deliveringCount"));
+ msg_2.acknowledge();
+ assertEquals(1 * 2, proxy.retrieveAttributeValue("deliveringCount"));
+ msg_3.acknowledge();
+ assertEquals(0, proxy.retrieveAttributeValue("deliveringCount"));
+
+ connection_1.close();
+ connection_2.close();
+ connection_3.close();
+ }
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/FakeQueue.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/FakeQueue.java 2010-11-06 00:03:12 UTC (rev 9851)
+++ trunk/tests/src/org/hornetq/tests/unit/core/postoffice/impl/FakeQueue.java 2010-11-08 14:22:13 UTC (rev 9852)
@@ -348,6 +348,12 @@
return name;
}
+ public SimpleString getAddress()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.hornetq.core.server.Queue#getID()
*/
13 years, 6 months
JBoss hornetq SVN: r9851 - in branches/Branch_New_Paging: src/main/org/hornetq/core/paging/impl and 2 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-05 20:03:12 -0400 (Fri, 05 Nov 2010)
New Revision: 9851
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
a few fixes
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java 2010-11-05 16:00:14 UTC (rev 9850)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/LivePageCacheImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
@@ -19,7 +19,6 @@
import org.hornetq.core.paging.Page;
import org.hornetq.core.paging.PagedMessage;
import org.hornetq.core.paging.cursor.LivePageCache;
-import org.hornetq.core.server.ServerMessage;
/**
* This is the same as PageCache, however this is for the page that's being currently written.
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2010-11-05 16:00:14 UTC (rev 9850)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
@@ -322,6 +322,11 @@
{
return;
}
+
+ if (pagingStore.getNumberOfPages() == 0)
+ {
+ return;
+ }
ArrayList<PageSubscription> cursorList = new ArrayList<PageSubscription>();
cursorList.addAll(activeCursors.values());
@@ -498,7 +503,6 @@
List<PagedMessage> pgdMessages = page.read();
- int i = 0;
for (PagedMessage pdgMessage : pgdMessages)
{
pdgMessage.initMessage(storageManager);
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2010-11-05 16:00:14 UTC (rev 9850)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/impl/PageTransactionInfoImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
@@ -145,8 +145,8 @@
{
pos.a.redeliver(pos.b);
}
+ lateDeliveries.clear();
}
- lateDeliveries.clear();
lateDeliveries = null;
}
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-11-05 16:00:14 UTC (rev 9850)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java 2010-11-06 00:03:12 UTC (rev 9851)
@@ -619,7 +619,7 @@
boolean depage = tx.getProperty(TransactionPropertyIndexes.IS_DEPAGE) != null;
- // if the TX paged at least one message on a give address, all the other message on the same address should also go towards
+ // if the TX paged at least one message on a given address, all the other message on the same address should also go towards
// paging cache now
boolean alreadyPaging = false;
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 16:00:14 UTC (rev 9850)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-06 00:03:12 UTC (rev 9851)
@@ -712,6 +712,72 @@
}
+
+ public void testLazyCommit() throws Exception
+ {
+ PagingStoreImpl pageStore = lookupPageStore(ADDRESS);
+
+ pageStore.startPaging();
+
+ final int NUM_MESSAGES = 100;
+
+ final int messageSize = 100 * 1024;
+
+ PageCursorProvider cursorProvider = this.server.getPagingManager().getPageStore(ADDRESS).getCursorProvier();
+ System.out.println("cursorProvider = " + cursorProvider);
+
+ PageSubscription cursor = this.server.getPagingManager()
+ .getPageStore(ADDRESS)
+ .getCursorProvier()
+ .getSubscription(queue.getID());
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
+
+ System.out.println("Cursor: " + cursor);
+
+ StorageManager storage = this.server.getStorageManager();
+
+ PageTransactionInfoImpl txLazy = new PageTransactionInfoImpl(storage.generateUniqueID());
+
+ server.getPagingManager().addTransaction(txLazy);
+
+ pgMessages(storage, pageStore, txLazy, 0, NUM_MESSAGES, messageSize);
+
+ addMessages(100, NUM_MESSAGES, messageSize);
+
+ System.out.println("Number of pages - " + pageStore.getNumberOfPages());
+
+ // First consume what's already there without any tx as nothing was committed
+ for (int i = 100; i < 200; i++)
+ {
+ PagedReference pos = iterator.next();
+ assertNotNull("Null at position " + i, pos);
+ assertEquals(i, pos.getMessage().getIntProperty("key").intValue());
+ cursor.ack(pos);
+ }
+
+ assertNull(iterator.next());
+
+ txLazy.commit();
+
+ for (int i = 0; i < 100; i++)
+ {
+ PagedReference pos = iterator.next();
+ assertNotNull("Null at position " + i, pos);
+ assertEquals(i, pos.getMessage().getIntProperty("key").intValue());
+ cursor.ack(pos);
+ }
+
+ assertNull(iterator.next());
+
+ waitCleanup();
+
+ server.stop();
+ createServer();
+ waitCleanup();
+ assertEquals(1, lookupPageStore(ADDRESS).getNumberOfPages());
+
+ }
+
public void testCloseNonPersistentConsumer() throws Exception
{
13 years, 6 months
JBoss hornetq SVN: r9850 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-05 12:00:14 -0400 (Fri, 05 Nov 2010)
New Revision: 9850
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
fixing PagecursorTest
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05 03:46:12 UTC (rev 9849)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05 16:00:14 UTC (rev 9850)
@@ -360,12 +360,15 @@
for (PagePosition pos : entry.getValue().acks)
{
- if (retValue == null || retValue.getMessageNr() < pos.getMessageNr())
+ System.out.println("Analizing " + pos);
+ if (retValue == null || retValue.getMessageNr() > pos.getMessageNr())
{
retValue = pos;
}
}
+ System.out.println("Returning initial position " + retValue);
+
return retValue;
}
}
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 03:46:12 UTC (rev 9849)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 16:00:14 UTC (rev 9850)
@@ -730,11 +730,14 @@
PagedReference msg;
LinkedListIterator<PagedReference> iterator = cursor.iterator();
- LinkedListIterator<PagedReference> iterator2 = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator2 = cursor2.iterator();
+
+ cursor2.bookmark(new PagePositionImpl(1, -1));
int key = 0;
while ((msg = iterator.next()) != null)
{
+ System.out.println("key = " + key);
assertEquals(key++, msg.getMessage().getIntProperty("key").intValue());
cursor.ack(msg);
}
@@ -744,6 +747,7 @@
for (int i = 0; i < 10; i++)
{
+ assertTrue(iterator2.hasNext());
msg = iterator2.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
}
13 years, 6 months
JBoss hornetq SVN: r9849 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-04 23:46:12 -0400 (Thu, 04 Nov 2010)
New Revision: 9849
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
backup
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05 02:18:58 UTC (rev 9848)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05 03:46:12 UTC (rev 9849)
@@ -19,6 +19,7 @@
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedMap;
@@ -90,8 +91,6 @@
private final Executor executor;
- private volatile PagePosition lastPosition;
-
private volatile PagePosition lastAckedPosition;
private List<PagePosition> recoveredACK;
@@ -156,13 +155,6 @@
public void bookmark(PagePosition position) throws Exception
{
- if (lastPosition != null)
- {
- throw new RuntimeException("Bookmark can only be done at the time of the cursor's creation");
- }
-
- lastPosition = position;
-
PageCursorInfo cursorInfo = getPageInfo(position);
if (position.getMessageNr() > 0)
@@ -175,7 +167,7 @@
class CursorIterator implements LinkedListIterator<PagedReference>
{
- PagePosition position = getLastPosition();
+ PagePosition position = null;
PagePosition lastOperation = null;
@@ -197,7 +189,7 @@
{
if (lastOperation == null)
{
- position = getLastPosition();
+ position = null;
}
else
{
@@ -218,6 +210,7 @@
cachedNext = null;
return retPos;
}
+
try
{
if (redeliveryIterator.hasNext())
@@ -229,6 +222,11 @@
{
isredelivery = false;
}
+
+ if (position == null)
+ {
+ position = getStartPosition();
+ }
PagedReferenceImpl nextPos = moveNext(position);
if (nextPos != null)
@@ -342,16 +340,38 @@
/**
*
*/
- private PagePosition getLastPosition()
+ private synchronized PagePosition getStartPosition()
{
- if (lastPosition == null)
+ // Get the first page not marked for deletion
+ // It's important to verify if it's not marked for deletion as you may have a pending request on the queue
+ for (Map.Entry<Long, PageCursorInfo> entry : consumedPages.entrySet())
{
- return new PagePositionImpl(pageStore.getFirstPage(), -1);
+ if (!entry.getValue().isPendingDelete())
+ {
+ if (entry.getValue().acks.isEmpty())
+ {
+ return new PagePositionImpl(entry.getKey(), -1);
+ }
+ else
+ {
+ // The list is not ordered...
+ // This is only done at creation of the queue, so we just scan instead of keeping the list ordened
+ PagePosition retValue = null;
+
+ for (PagePosition pos : entry.getValue().acks)
+ {
+ if (retValue == null || retValue.getMessageNr() < pos.getMessageNr())
+ {
+ retValue = pos;
+ }
+ }
+
+ return retValue;
+ }
+ }
}
- else
- {
- return lastPosition;
- }
+
+ return new PagePositionImpl(pageStore.getFirstPage(), -1);
}
/* (non-Javadoc)
@@ -561,10 +581,10 @@
Collections.sort(recoveredACK);
boolean first = true;
-
- PagePosition previousPos = null;
+
for (PagePosition pos : recoveredACK)
{
+ lastAckedPosition = pos;
PageCursorInfo positions = getPageInfo(pos);
if (first)
{
@@ -576,50 +596,8 @@
}
positions.addACK(pos);
-
- lastPosition = pos;
- if (previousPos != null)
- {
- if (!previousPos.isRightAfter(previousPos))
- {
- PagePosition tmpPos = previousPos;
- // looking for holes on the ack list for redelivery
- while (true)
- {
- PagedReferenceImpl msgCheck = cursorProvider.getNext(this, tmpPos);
-
- positions = getPageInfo(tmpPos);
-
- // end of the hole, we can finish processing here
- // It may be also that the next was just a next page, so we just ignore it
- if (msgCheck == null || msgCheck.getPosition().equals(pos))
- {
- break;
- }
- else
- {
- if (match(msgCheck.getMessage()))
- {
- redeliver(msgCheck.getPosition());
- }
- else
- {
- // The reference was ignored. But we must take a count from the reference count
- // otherwise the page will never be deleted hence we would never leave paging even if
- // everything was consumed
- positions.confirmed.incrementAndGet();
- }
- }
- tmpPos = msgCheck.getPosition();
- }
- }
- }
-
- previousPos = pos;
}
- lastAckedPosition = lastPosition;
-
recoveredACK.clear();
recoveredACK = null;
}
@@ -948,11 +926,8 @@
public void addACK(final PagePosition posACK)
{
- if (posACK.getRecordID() > 0)
- {
- // We store these elements for later cleanup
- acks.add(posACK);
- }
+ removedReferences.add(posACK);
+ acks.add(posACK);
if (isTrace)
{
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 02:18:58 UTC (rev 9848)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 03:46:12 UTC (rev 9849)
@@ -373,6 +373,8 @@
cursor.ack(msg);
}
}
+
+ server.getStorageManager().waitOnOperations();
server.stop();
@@ -841,6 +843,10 @@
PageSubscription cursor = cursorProvider.getSubscription(queue.getID());
PagePosition startingPos = new PagePositionImpl(5, cache.getNumberOfMessages() / 2);
cursor.bookmark(startingPos);
+
+ // We can't proceed until the operation has finished
+ server.getStorageManager().waitOnOperations();
+
PagedMessage msg = cache.getMessage(startingPos.getMessageNr() + 1);
msg.initMessage(server.getStorageManager());
int initialKey = msg.getMessage().getIntProperty("key").intValue();
13 years, 6 months
JBoss hornetq SVN: r9848 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-04 22:18:58 -0400 (Thu, 04 Nov 2010)
New Revision: 9848
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
fixing tests
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-04 22:51:35 UTC (rev 9847)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-05 02:18:58 UTC (rev 9848)
@@ -346,12 +346,12 @@
{
if (lastPosition == null)
{
- // it will start at the first available page
- long firstPage = pageStore.getFirstPage();
- lastPosition = new PagePositionImpl(firstPage, -1);
+ return new PagePositionImpl(pageStore.getFirstPage(), -1);
}
-
- return lastPosition;
+ else
+ {
+ return lastPosition;
+ }
}
/* (non-Javadoc)
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-04 22:51:35 UTC (rev 9847)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-05 02:18:58 UTC (rev 9848)
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import junit.framework.Assert;
@@ -113,12 +114,14 @@
final int NUM_MESSAGES = 100;
+ PageSubscription cursor = lookupPageStore(ADDRESS).getCursorProvier().getSubscription(queue.getID());
+
+ Iterator<PagedReference> iterEmpty = cursor.iterator();
+
int numberOfPages = addMessages(NUM_MESSAGES, 1024 * 1024);
System.out.println("NumberOfPages = " + numberOfPages);
- PageSubscription cursor = lookupPageStore(ADDRESS).getCursorProvier().getSubscription(queue.getID());
-
PagedReference msg;
LinkedListIterator<PagedReference> iterator = cursor.iterator();
13 years, 6 months
JBoss hornetq SVN: r9847 - in branches/Branch_New_Paging: tests/src/org/hornetq/tests/integration/paging and 1 other directory.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-04 18:51:35 -0400 (Thu, 04 Nov 2010)
New Revision: 9847
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
just a backup
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-04 22:47:33 UTC (rev 9846)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-04 22:51:35 UTC (rev 9847)
@@ -1249,6 +1249,11 @@
private void depage()
{
+ if (paused || consumerList.isEmpty())
+ {
+ return;
+ }
+
int nmessages = 0;
while (nmessages < MAX_DELIVERIES_IN_LOOP && pageIterator.hasNext())
{
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-04 22:47:33 UTC (rev 9846)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-04 22:51:35 UTC (rev 9847)
@@ -1025,6 +1025,7 @@
try
{
queue = server.createQueue(ADDRESS, ADDRESS, null, true, false);
+ queue.pause();
}
catch (Exception ignored)
{
13 years, 6 months
JBoss hornetq SVN: r9846 - in branches/Branch_New_Paging: src/main/org/hornetq/core/paging/cursor/impl and 2 other directories.
by do-not-reply@jboss.org
Author: clebert.suconic(a)jboss.com
Date: 2010-11-04 18:47:33 -0400 (Thu, 04 Nov 2010)
New Revision: 9846
Modified:
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageSubscription.java
branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java
branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
Log:
just a backup
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageSubscription.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageSubscription.java 2010-11-04 15:05:08 UTC (rev 9845)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageSubscription.java 2010-11-04 22:47:33 UTC (rev 9846)
@@ -37,8 +37,11 @@
long getId();
boolean isPersistent();
+
+ /** Used as a delegate method to pageStore.isPaging() */
+ boolean isPaging();
- public LinkedListIterator<PagedReferenceImpl> iterator();
+ public LinkedListIterator<PagedReference> iterator();
// To be called when the cursor is closed for good. Most likely when the queue is deleted
void close() throws Exception;
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-04 15:05:08 UTC (rev 9845)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java 2010-11-04 22:47:33 UTC (rev 9846)
@@ -129,6 +129,11 @@
return queue;
}
+ public boolean isPaging()
+ {
+ return pageStore.isPaging();
+ }
+
public void setQueue(Queue queue)
{
this.queue = queue;
@@ -168,7 +173,7 @@
ack(position);
}
- class CursorIterator implements LinkedListIterator<PagedReferenceImpl>
+ class CursorIterator implements LinkedListIterator<PagedReference>
{
PagePosition position = getLastPosition();
@@ -204,7 +209,7 @@
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
- public PagedReferenceImpl next()
+ public synchronized PagedReferenceImpl next()
{
if (cachedNext != null)
@@ -239,7 +244,9 @@
}
}
- public boolean hasNext()
+ /** QueueImpl::deliver could be calling hasNext while QueueImpl.depage could be using next and hasNext as well.
+ * It would be a rare race condition but I would prefer avoiding that scenario */
+ public synchronized boolean hasNext()
{
// if an unbehaved program called hasNext twice before next, we only cache it once.
if (cachedNext != null)
@@ -247,6 +254,11 @@
return true;
}
+ if (!pageStore.isPaging())
+ {
+ return false;
+ }
+
cachedNext = next();
return cachedNext != null;
@@ -276,7 +288,7 @@
/* (non-Javadoc)
* @see org.hornetq.core.paging.cursor.PageCursor#iterator()
*/
- public LinkedListIterator<PagedReferenceImpl> iterator()
+ public LinkedListIterator<PagedReference> iterator()
{
return new CursorIterator();
}
Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-04 15:05:08 UTC (rev 9845)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/server/impl/QueueImpl.java 2010-11-04 22:47:33 UTC (rev 9846)
@@ -33,6 +33,7 @@
import org.hornetq.core.filter.Filter;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.paging.cursor.PageSubscription;
+import org.hornetq.core.paging.cursor.PagedReference;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Bindings;
import org.hornetq.core.postoffice.PostOffice;
@@ -92,6 +93,8 @@
private final PostOffice postOffice;
private final PageSubscription pageSubscription;
+
+ private final LinkedListIterator<PagedReference> pageIterator;
private final ConcurrentLinkedQueue<MessageReference> concurrentQueue = new ConcurrentLinkedQueue<MessageReference>();
@@ -109,6 +112,8 @@
private final Runnable deliverRunner = new DeliverRunner();
+ private final Runnable depageRunner = new DepageRunner();
+
private final StorageManager storageManager;
private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
@@ -221,7 +226,12 @@
if (pageSubscription != null)
{
pageSubscription.setQueue(this);
+ this.pageIterator = pageSubscription.iterator();
}
+ else
+ {
+ this.pageIterator = null;
+ }
this.executor = executor;
@@ -339,7 +349,7 @@
// We don't recompute it on every delivery since executing isEmpty is expensive for a ConcurrentQueue
if (checkDirect)
{
- if (direct && !directDeliver && concurrentQueue.isEmpty() && messageReferences.isEmpty())
+ if (direct && !directDeliver && concurrentQueue.isEmpty() && messageReferences.isEmpty() && !pageIterator.hasNext() && !pageSubscription.isPaging())
{
// We must block on the executor to ensure any async deliveries have completed or we might get out of order
// deliveries
@@ -1225,7 +1235,30 @@
pos = 0;
}
}
+
+ if (messageReferences.size() == 0 && pageIterator.hasNext())
+ {
+ scheduleDepage();
+ }
}
+
+ private void scheduleDepage()
+ {
+ executor.execute(depageRunner);
+ }
+
+ private void depage()
+ {
+ int nmessages = 0;
+ while (nmessages < MAX_DELIVERIES_IN_LOOP && pageIterator.hasNext())
+ {
+ nmessages ++;
+ addTail(pageIterator.next(), false);
+ pageIterator.remove();
+ }
+
+ deliverAsync();
+ }
private void internalAddRedistributor(final Executor executor)
{
@@ -1716,6 +1749,21 @@
}
}
+ private class DepageRunner implements Runnable
+ {
+ public void run()
+ {
+ try
+ {
+ depage();
+ }
+ catch (Exception e)
+ {
+ log.error("Failed to deliver", e);
+ }
+ }
+ }
+
private class ConcurrentPoller implements Runnable
{
public void run()
Modified: branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java
===================================================================
--- branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-04 15:05:08 UTC (rev 9845)
+++ branches/Branch_New_Paging/tests/src/org/hornetq/tests/integration/paging/PageCursorTest.java 2010-11-04 22:47:33 UTC (rev 9846)
@@ -15,7 +15,6 @@
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import junit.framework.Assert;
@@ -32,7 +31,7 @@
import org.hornetq.core.paging.cursor.PageCursorProvider;
import org.hornetq.core.paging.cursor.PagePosition;
import org.hornetq.core.paging.cursor.PageSubscription;
-import org.hornetq.core.paging.cursor.PagedReferenceImpl;
+import org.hornetq.core.paging.cursor.PagedReference;
import org.hornetq.core.paging.cursor.impl.PageCursorProviderImpl;
import org.hornetq.core.paging.cursor.impl.PagePositionImpl;
import org.hornetq.core.paging.cursor.impl.PageSubscriptionImpl;
@@ -120,9 +119,9 @@
PageSubscription cursor = lookupPageStore(ADDRESS).getCursorProvier().getSubscription(queue.getID());
- PagedReferenceImpl msg;
+ PagedReference msg;
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
int key = 0;
while ((msg = iterator.next()) != null)
{
@@ -205,11 +204,11 @@
queue.getPageSubscription().close();
- PagedReferenceImpl msg;
+ PagedReference msg;
- LinkedListIterator<PagedReferenceImpl> iteratorEven = cursorEven.iterator();
+ LinkedListIterator<PagedReference> iteratorEven = cursorEven.iterator();
- LinkedListIterator<PagedReferenceImpl> iteratorOdd = cursorOdd.iterator();
+ LinkedListIterator<PagedReference> iteratorOdd = cursorOdd.iterator();
int key = 0;
while ((msg = iteratorEven.next()) != null)
@@ -285,12 +284,12 @@
System.out.println("Cursor: " + cursor);
cursorProvider.printDebug();
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
for (int i = 0; i < 1000; i++)
{
System.out.println("Reading Msg : " + i);
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertNotNull(msg);
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
@@ -319,7 +318,7 @@
for (int i = firstPageSize; i < NUM_MESSAGES; i++)
{
System.out.println("Received " + i);
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertNotNull(msg);
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
@@ -361,10 +360,10 @@
.getSubscription(queue.getID());
System.out.println("Cursor: " + cursor);
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
for (int i = 0; i < 100; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
if (i < 10 || i > 20)
{
@@ -383,14 +382,14 @@
for (int i = 10; i <= 20; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
cursor.ack(msg);
}
for (int i = 100; i < NUM_MESSAGES; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
cursor.ack(msg);
}
@@ -422,11 +421,11 @@
Transaction tx = new TransactionImpl(server.getStorageManager(), 60 * 1000);
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
for (int i = 0; i < 100; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
if (i < 10 || i > 20)
{
@@ -449,14 +448,14 @@
for (int i = 10; i <= 20; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
cursor.ackTx(tx, msg);
}
for (int i = 100; i < NUM_MESSAGES; i++)
{
- PagedReferenceImpl msg = iterator.next();
+ PagedReference msg = iterator.next();
assertEquals(i, msg.getMessage().getIntProperty("key").intValue());
cursor.ackTx(tx, msg);
}
@@ -490,7 +489,7 @@
System.out.println("Cursor: " + cursor);
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
for (int i = 0; i < NUM_MESSAGES; i++)
{
@@ -506,7 +505,7 @@
Assert.assertTrue(pageStore.page(msg));
- PagedReferenceImpl readMessage = iterator.next();
+ PagedReference readMessage = iterator.next();
assertNotNull(readMessage);
@@ -544,7 +543,7 @@
Assert.assertTrue(pageStore.page(msg));
}
- PagedReferenceImpl readMessage = iterator.next();
+ PagedReference readMessage = iterator.next();
assertNotNull(readMessage);
@@ -580,7 +579,7 @@
Assert.assertTrue(pageStore.page(msg));
}
- PagedReferenceImpl readMessage = iterator.next();
+ PagedReference readMessage = iterator.next();
assertNotNull(readMessage);
@@ -589,7 +588,7 @@
assertEquals(i, readMessage.getMessage().getIntProperty("key").intValue());
}
- PagedReferenceImpl readMessage = iterator.next();
+ PagedReference readMessage = iterator.next();
assertEquals(NUM_MESSAGES * 3, readMessage.getMessage().getIntProperty("key").intValue());
@@ -647,7 +646,7 @@
.getPageStore(ADDRESS)
.getCursorProvier()
.getSubscription(queue.getID());
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
System.out.println("Cursor: " + cursor);
@@ -676,7 +675,7 @@
// First consume what's already there without any tx as nothing was committed
for (int i = 300; i < 400; i++)
{
- PagedReferenceImpl pos = iterator.next();
+ PagedReference pos = iterator.next();
assertNotNull("Null at position " + i, pos);
assertEquals(i, pos.getMessage().getIntProperty("key").intValue());
cursor.ack(pos);
@@ -693,7 +692,7 @@
// Second:after pgtxCommit was done
for (int i = 200; i < 300; i++)
{
- PagedReferenceImpl pos = iterator.next();
+ PagedReference pos = iterator.next();
assertNotNull(pos);
assertEquals(i, pos.getMessage().getIntProperty("key").intValue());
cursor.ack(pos);
@@ -724,9 +723,9 @@
queue.getPageSubscription().close();
- PagedReferenceImpl msg;
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
- LinkedListIterator<PagedReferenceImpl> iterator2 = cursor.iterator();
+ PagedReference msg;
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator2 = cursor.iterator();
int key = 0;
while ((msg = iterator.next()) != null)
@@ -803,9 +802,9 @@
msg = null;
cache = null;
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
- PagedReferenceImpl msgCursor = null;
+ PagedReference msgCursor = null;
while ((msgCursor = iterator.next()) != null)
{
assertEquals(key++, msgCursor.getMessage().getIntProperty("key").intValue());
@@ -848,9 +847,9 @@
cache = null;
- LinkedListIterator<PagedReferenceImpl> iterator = cursor.iterator();
+ LinkedListIterator<PagedReference> iterator = cursor.iterator();
- PagedReferenceImpl msgCursor = null;
+ PagedReference msgCursor = null;
while ((msgCursor = iterator.next()) != null)
{
assertEquals(key++, msgCursor.getMessage().getIntProperty("key").intValue());
@@ -902,15 +901,15 @@
PageSubscription cursor = cursorProvider.getSubscription(queue.getID());
- LinkedListIterator<PagedReferenceImpl> iter = cursor.iterator();
+ LinkedListIterator<PagedReference> iter = cursor.iterator();
- LinkedListIterator<PagedReferenceImpl> iter2 = cursor.iterator();
+ LinkedListIterator<PagedReference> iter2 = cursor.iterator();
assertTrue(iter.hasNext());
- PagedReferenceImpl msg1 = iter.next();
+ PagedReference msg1 = iter.next();
- PagedReferenceImpl msg2 = iter2.next();
+ PagedReference msg2 = iter2.next();
assertEquals(tstProperty(msg1.getMessage()), tstProperty(msg2.getMessage()));
13 years, 6 months
JBoss hornetq SVN: r9845 - in branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster: failover and 1 other directory.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-11-04 11:05:08 -0400 (Thu, 04 Nov 2010)
New Revision: 9845
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java
Log:
test fix
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-04 08:13:02 UTC (rev 9844)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusterTestBase.java 2010-11-04 15:05:08 UTC (rev 9845)
@@ -1429,8 +1429,6 @@
configuration.getConnectorConfigurations().put(liveConfig.getName(), liveConfig);
TransportConfiguration backupConfig = createTransportConfiguration(netty, false, generateParams(node, netty));
configuration.getConnectorConfigurations().put(backupConfig.getName(), backupConfig);
- ArrayList<String> staticConnectors = new ArrayList<String>();
- staticConnectors.add(liveConfig.getName());
HornetQServer server;
@@ -1651,8 +1649,7 @@
final int maxHops,
final boolean netty,
final int nodeFrom,
- final int[] nodesTo,
- final int[] backupsTo)
+ final int[] nodesTo)
{
HornetQServer serverFrom = servers[nodeFrom];
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java 2010-11-04 08:13:02 UTC (rev 9844)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/distribution/SymmetricClusterWithBackupTest.java 2010-11-04 15:05:08 UTC (rev 9845)
@@ -479,8 +479,7 @@
1,
isNetty(),
0,
- new int[] { 1, 2, 3, 4 },
- new int[] { 6, 7, 8, 9 });
+ new int[] { 1, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster1",
"queues",
@@ -488,8 +487,7 @@
1,
isNetty(),
1,
- new int[] { 0, 2, 3, 4 },
- new int[] { 5, 7, 8, 9 });
+ new int[] { 0, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster2",
"queues",
@@ -497,8 +495,7 @@
1,
isNetty(),
2,
- new int[] { 0, 1, 3, 4 },
- new int[] { 5, 6, 8, 9 });
+ new int[] { 0, 1, 3, 4 });
setupClusterConnectionWithBackups("cluster3",
"queues",
@@ -506,8 +503,7 @@
1,
isNetty(),
3,
- new int[] { 0, 1, 2, 4 },
- new int[] { 5, 6, 7, 9 });
+ new int[] { 0, 1, 2, 4 });
setupClusterConnectionWithBackups("cluster4",
"queues",
@@ -515,8 +511,7 @@
1,
isNetty(),
4,
- new int[] { 0, 1, 2, 3 },
- new int[] { 5, 6, 7, 8 });
+ new int[] { 0, 1, 2, 3 });
// The backups
@@ -526,8 +521,7 @@
1,
isNetty(),
5,
- new int[] { 1, 2, 3, 4 },
- new int[] { 6, 7, 8, 9 });
+ new int[] {0, 1, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster1",
"queues",
@@ -535,8 +529,7 @@
1,
isNetty(),
6,
- new int[] { 0, 2, 3, 4 },
- new int[] { 5, 7, 8, 9 });
+ new int[] {0, 1, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster2",
"queues",
@@ -544,8 +537,7 @@
1,
isNetty(),
7,
- new int[] { 0, 1, 3, 4 },
- new int[] { 5, 6, 8, 9 });
+ new int[] { 0, 1, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster3",
"queues",
@@ -553,8 +545,7 @@
1,
isNetty(),
8,
- new int[] { 0, 1, 2, 4 },
- new int[] { 5, 6, 7, 9 });
+ new int[] { 0, 1, 2, 3, 4 });
setupClusterConnectionWithBackups("cluster4",
"queues",
@@ -562,8 +553,7 @@
1,
isNetty(),
9,
- new int[] { 0, 1, 2, 3 },
- new int[] { 5, 6, 7, 8 });
+ new int[] { 0, 1, 2, 3, 4 });
}
@Override
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2010-11-04 08:13:02 UTC (rev 9844)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/GroupingFailoverTestBase.java 2010-11-04 15:05:08 UTC (rev 9845)
@@ -45,7 +45,7 @@
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
- setupClusterConnectionWithBackups("cluster1", "queues", false, 1, isNetty(), 1, new int[] { 0 }, new int[] { 2 });
+ setupClusterConnectionWithBackups("cluster1", "queues", false, 1, isNetty(), 1, new int[] { 0 });
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 1);
@@ -138,7 +138,7 @@
setupClusterConnection("cluster0", "queues", false, 1, isNetty(), 0, 1);
- setupClusterConnectionWithBackups("cluster1", "queues", false, 1, isNetty(), 1, new int[] { 0 }, new int[] { 2 });
+ setupClusterConnectionWithBackups("cluster1", "queues", false, 1, isNetty(), 1, new int[] { 0 });
setupClusterConnection("cluster2", "queues", false, 1, isNetty(), 2, 1);
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2010-11-04 08:13:02 UTC (rev 9844)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/ReplicatedDistributionTest.java 2010-11-04 15:05:08 UTC (rev 9845)
@@ -271,7 +271,7 @@
setupBackupServer(2, 1, true, isShared(), true);
setupBackupServer(3, 1, true, isShared(), true);
- setupClusterConnectionWithBackups("test", "test", false, 1, true, 1, new int[] { 3 }, new int[] { 2 });
+ setupClusterConnectionWithBackups("test", "test", false, 1, true, 1, new int[] { 3 });
AddressSettings as = new AddressSettings();
as.setRedistributionDelay(0);
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java 2010-11-04 08:13:02 UTC (rev 9844)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/StaticClusterWithBackupFailoverTest.java 2010-11-04 15:05:08 UTC (rev 9845)
@@ -41,8 +41,7 @@
1,
isNetty(),
0,
- new int[] { 1, 2 },
- new int[] { 4, 5 });
+ new int[] { 1, 2 });
setupClusterConnectionWithBackups("cluster1",
"queues",
@@ -50,8 +49,7 @@
1,
isNetty(),
1,
- new int[] { 0, 2 },
- new int[] { 3, 5 });
+ new int[] { 0, 2 });
setupClusterConnectionWithBackups("cluster2",
"queues",
@@ -59,8 +57,7 @@
1,
isNetty(),
2,
- new int[] { 0, 1 },
- new int[] { 3, 4 });
+ new int[] { 0, 1 });
setupClusterConnectionWithBackups("cluster0",
"queues",
@@ -68,8 +65,7 @@
1,
isNetty(),
3,
- new int[] { 1, 2 },
- new int[] { 4, 5 });
+ new int[] { 1, 2 });
setupClusterConnectionWithBackups("cluster1",
"queues",
@@ -77,8 +73,7 @@
1,
isNetty(),
4,
- new int[] { 0, 2 },
- new int[] { 3, 5 });
+ new int[] { 0, 2 });
setupClusterConnectionWithBackups("cluster2",
"queues",
@@ -86,8 +81,7 @@
1,
isNetty(),
5,
- new int[] { 0, 1 },
- new int[] { 3, 4 });
+ new int[] { 0, 1 });
}
@Override
13 years, 6 months
JBoss hornetq SVN: r9844 - branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/client.
by do-not-reply@jboss.org
Author: ataylor
Date: 2010-11-04 04:13:02 -0400 (Thu, 04 Nov 2010)
New Revision: 9844
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java
Log:
test fix
Modified: branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java
===================================================================
--- branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java 2010-11-04 08:04:34 UTC (rev 9843)
+++ branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/client/ServerLocatorConnectTest.java 2010-11-04 08:13:02 UTC (rev 9844)
@@ -140,11 +140,10 @@
Thread t = new Thread(target);
t.start();
//let them get started
- Thread.sleep(1500);
+ Thread.sleep(500);
locator.close();
assertTrue(countDownLatch.await(5, TimeUnit.SECONDS));
- assertTrue(target.e instanceof HornetQException);
- assertEquals(((HornetQException)target.e).getCode(), HornetQException.NOT_CONNECTED);
+ assertNull(target.csf);
}
public boolean isNetty()
@@ -155,6 +154,7 @@
static class Connector implements Runnable
{
private ServerLocatorInternal locator;
+ ClientSessionFactory csf = null;
CountDownLatch latch;
Exception e;
public Connector(ServerLocatorInternal locator, CountDownLatch latch)
@@ -167,7 +167,7 @@
{
try
{
- locator.connect();
+ csf = locator.connect();
}
catch (Exception e)
{
13 years, 6 months