You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2015/02/26 10:26:01 UTC

[1/5] activemq-6 git commit: Adding test to the release profileA

Repository: activemq-6
Updated Branches:
  refs/heads/master cec3ddf1e -> 41b223290


Adding test to the release profileA

This is so we would catch compilation failures on the testsuite.
Devs are now using the release profile. Not having the tests on the
release profile would give devs and contributors the impression
that everything compiled ok


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/060a4d17
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/060a4d17
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/060a4d17

Branch: refs/heads/master
Commit: 060a4d17b781c3004582fd6205e0adccf8a7b58b
Parents: 210222e
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Feb 26 00:21:03 2015 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Feb 26 00:26:52 2015 -0500

----------------------------------------------------------------------
 pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/060a4d17/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9611d29..fa955b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -468,6 +468,7 @@
             <module>integration/activemq-aerogear-integration</module>
             <module>integration/activemq-vertx-integration</module>
             <module>distribution</module>
+            <module>tests</module>
          </modules>
       </profile>
       <profile>


[5/5] activemq-6 git commit: merge #115 - doc changes on architecture including picture changes

Posted by an...@apache.org.
merge #115 - doc changes on architecture including picture changes


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/41b22329
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/41b22329
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/41b22329

Branch: refs/heads/master
Commit: 41b22329072768e10a1dd28e45516784d4b78fbb
Parents: cec3ddf 060a4d1
Author: Andy Taylor <an...@gmail.com>
Authored: Thu Feb 26 09:25:00 2015 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Thu Feb 26 09:25:00 2015 +0000

----------------------------------------------------------------------
 .../core/journal/impl/ExportJournal.java        | 210 ----------
 .../core/journal/impl/ImportJournal.java        | 392 ------------------
 .../apache/activemq/tools/ExportJournal.java    | 226 ++++++++++
 .../apache/activemq/tools/ImportJournal.java    | 413 +++++++++++++++++++
 .../java/org/apache/activemq/tools/Main.java    |  16 +-
 activemq_doap.rdf                               |  96 +++++
 docs/user-manual/en/architecture.md             |  15 +-
 .../en/diagrams/architecture-diagrams.odg       | Bin 10587 -> 12181 bytes
 docs/user-manual/en/images/architecture1.jpg    | Bin 19948 -> 38156 bytes
 docs/user-manual/en/images/architecture2.jpg    | Bin 18718 -> 15337 bytes
 docs/user-manual/en/images/architecture3.jpg    | Bin 12274 -> 9614 bytes
 docs/user-manual/en/messaging-concepts.md       |   2 +-
 docs/user-manual/en/persistence.md              |  23 +-
 hornetq_doap.rdf                                |  96 -----
 pom.xml                                         |   1 +
 .../journal/NIOJournalCompactTest.java          |   2 +-
 .../persistence/ExportFormatTest.java           |   6 +-
 tests/unit-tests/pom.xml                        |   5 +
 .../core/journal/impl/JournalImplTestBase.java  |   4 +-
 19 files changed, 782 insertions(+), 725 deletions(-)
----------------------------------------------------------------------



[4/5] activemq-6 git commit: renaming hornetq_doap.rdf

Posted by an...@apache.org.
renaming hornetq_doap.rdf


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/ed7c4296
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/ed7c4296
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/ed7c4296

Branch: refs/heads/master
Commit: ed7c429624930abfa04b1283de5b4ac2e45e6799
Parents: c870878
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Feb 25 22:02:09 2015 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Feb 26 00:26:52 2015 -0500

----------------------------------------------------------------------
 activemq_doap.rdf | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++
 hornetq_doap.rdf  | 96 --------------------------------------------------
 2 files changed, 96 insertions(+), 96 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/ed7c4296/activemq_doap.rdf
----------------------------------------------------------------------
diff --git a/activemq_doap.rdf b/activemq_doap.rdf
new file mode 100644
index 0000000..16d9787
--- /dev/null
+++ b/activemq_doap.rdf
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<rdf:RDF xml:lang="en" xmlns="http://usefulinc.com/ns/doap#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
+  <Project rdf:about="">
+    <name></name>
+    <homepage rdf:resource="" />
+    <shortdesc></shortdesc>
+    <description></description>
+    
+    <maintainer>
+      <foaf:Person>
+        <foaf:name>Clebert Suconic</foaf:name>
+        <foaf:status>Project Lead</foaf:status>
+        <foaf:firstName>Clebert</foaf:firstName>
+        <foaf:lastName>Suconic</foaf:lastName>
+      </foaf:Person>
+    </maintainer>
+    <developer>
+      <foaf:Person>
+        <foaf:name>Andy Taylor</foaf:name>
+        <foaf:firstName>Andy</foaf:firstName>
+        <foaf:lastName>Taylor</foaf:lastName>
+      </foaf:Person>
+    </developer>
+    <developer>
+      <foaf:Person>
+        <foaf:name>Howard Gao</foaf:name>
+        <foaf:firstName>Howard</foaf:firstName>
+        <foaf:lastName>Gao</foaf:lastName>
+      </foaf:Person>
+    </developer>
+    <developer>
+      <foaf:Person>
+        <foaf:name>Justin Bertram</foaf:name>
+        <foaf:firstName>Justin</foaf:firstName>
+        <foaf:lastName>Bertram</foaf:lastName>
+      </foaf:Person>
+    </developer>
+    <developer>
+      <foaf:Person>
+        <foaf:name>Martyn Taylor</foaf:name>
+        <foaf:firstName>Martyn</foaf:firstName>
+        <foaf:lastName>Taylor</foaf:lastName>
+      </foaf:Person>
+    </developer>
+    
+    <release>
+      <Version>
+        <name>6.0.0</name>
+        <revision>6.0.0.final</revision>
+        <created>2013-16-12</created>
+      </Version>
+    </release>
+    <license rdf:resource="" />
+    
+    
+    <programming-language>Java</programming-language>
+    <programming-language>C/C++</programming-language>
+    <vendor>Red Hat</vendor>
+    <implements>
+      <Specification>
+        <name>JMS 2.0</name>
+        <description></description>
+        <rdfs:seeAlso rdf:resource="" />
+      </Specification>
+    </implements>
+    <foaf:logo rdf:resource="" />
+    <foaf:account>
+      <foaf:OnlineAccount>
+        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/OnlineChatAccount" />
+        <foaf:accountServiceHomepage rdf:resource="http://twitter.com/" />
+        <foaf:accountName>activemq</foaf:accountName>
+      </foaf:OnlineAccount>
+    </foaf:account>
+  </Project>
+</rdf:RDF>
+

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/ed7c4296/hornetq_doap.rdf
----------------------------------------------------------------------
diff --git a/hornetq_doap.rdf b/hornetq_doap.rdf
deleted file mode 100644
index a8798a4..0000000
--- a/hornetq_doap.rdf
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<rdf:RDF xml:lang="en" xmlns="http://usefulinc.com/ns/doap#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
-  <Project rdf:about="">
-    <name></name>
-    <homepage rdf:resource="" />
-    <shortdesc></shortdesc>
-    <description></description>
-    
-    <maintainer>
-      <foaf:Person>
-        <foaf:name>Clebert Suconic</foaf:name>
-        <foaf:status>Project Lead</foaf:status>
-        <foaf:firstName>Clebert</foaf:firstName>
-        <foaf:lastName>Suconic</foaf:lastName>
-      </foaf:Person>
-    </maintainer>
-    <developer>
-      <foaf:Person>
-        <foaf:name>Andy Taylor</foaf:name>
-        <foaf:firstName>Andy</foaf:firstName>
-        <foaf:lastName>Taylor</foaf:lastName>
-      </foaf:Person>
-    </developer>
-    <developer>
-      <foaf:Person>
-        <foaf:name>Howard Gao</foaf:name>
-        <foaf:firstName>Howard</foaf:firstName>
-        <foaf:lastName>Gao</foaf:lastName>
-      </foaf:Person>
-    </developer>
-    <developer>
-      <foaf:Person>
-        <foaf:name>Justin Bertram</foaf:name>
-        <foaf:firstName>Justin</foaf:firstName>
-        <foaf:lastName>Bertram</foaf:lastName>
-      </foaf:Person>
-    </developer>
-    <developer>
-      <foaf:Person>
-        <foaf:name>Martyn Taylor</foaf:name>
-        <foaf:firstName>Martyn</foaf:firstName>
-        <foaf:lastName>Taylor</foaf:lastName>
-      </foaf:Person>
-    </developer>
-    
-    <release>
-      <Version>
-        <name>2.4.0</name>
-        <revision>2.4.0.final</revision>
-        <created>2013-16-12</created>
-      </Version>
-    </release>
-    <license rdf:resource="" />
-    
-    
-    <programming-language>Java</programming-language>
-    <programming-language>C/C++</programming-language>
-    <vendor>Red Hat</vendor>
-    <implements>
-      <Specification>
-        <name>JMS 2.0</name>
-        <description></description>
-        <rdfs:seeAlso rdf:resource="" />
-      </Specification>
-    </implements>
-    <foaf:logo rdf:resource="" />
-    <foaf:account>
-      <foaf:OnlineAccount>
-        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/OnlineChatAccount" />
-        <foaf:accountServiceHomepage rdf:resource="http://twitter.com/" />
-        <foaf:accountName>activemq</foaf:accountName>
-      </foaf:OnlineAccount>
-    </foaf:account>
-  </Project>
-</rdf:RDF>
-


[3/5] activemq-6 git commit: doc changes on architecture including picture changes

Posted by an...@apache.org.
doc changes on architecture including picture changes

I have changed the OpenOffice files. Exported the pictures
As I exported the pictures I selected the group on the slide,
File->Export, JPG file, and selected selection only.

The size was the default size and that worked alright.


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/c8708784
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/c8708784
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/c8708784

Branch: refs/heads/master
Commit: c870878402b9aa999dde7c580e445845db1ffde6
Parents: cec3ddf
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Feb 25 15:29:36 2015 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Feb 26 00:26:52 2015 -0500

----------------------------------------------------------------------
 docs/user-manual/en/architecture.md             |  15 ++++++++----
 .../en/diagrams/architecture-diagrams.odg       | Bin 10587 -> 12181 bytes
 docs/user-manual/en/images/architecture1.jpg    | Bin 19948 -> 38156 bytes
 docs/user-manual/en/images/architecture2.jpg    | Bin 18718 -> 15337 bytes
 docs/user-manual/en/images/architecture3.jpg    | Bin 12274 -> 9614 bytes
 docs/user-manual/en/messaging-concepts.md       |   2 +-
 docs/user-manual/en/persistence.md              |  23 +++++++------------
 7 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/architecture.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/architecture.md b/docs/user-manual/en/architecture.md
index 91a1a9c..8390490 100644
--- a/docs/user-manual/en/architecture.md
+++ b/docs/user-manual/en/architecture.md
@@ -28,14 +28,21 @@ ActiveMQ clients, potentially on different physical machines interact
 with the ActiveMQ server. ActiveMQ currently provides two APIs for
 messaging at the client side:
 
-1.  Core client API. This is a simple intuitive Java API that allows the
+1. Core client API. This is a simple intuitive Java API that allows the
     full set of messaging functionality without some of the complexities
     of JMS.
 
-2.  JMS client API. The standard JMS API is available at the client
+2. JMS client API. The standard JMS API is available at the client
     side.
 
-JMS semantics are implemented by a thin JMS facade layer on the client
+ActiveMQ also provides different protocol implementations on the server so you can use respective clients for these protocols:
+
+1. Stomp
+2. OpenWire
+3. AMQP
+
+
+JMS semantics are implemented by a JMS facade layer on the client
 side.
 
 The ActiveMQ server does not speak JMS and in fact does not know
@@ -66,7 +73,7 @@ application that requires messaging functionality internally but you
 don't want to expose that as a ActiveMQ server you can directly
 instantiate and embed ActiveMQ servers in your own application.
 
-For more information on embedding ActiveMQ, see [Embedding HornetQ](embedding-hornetq.md).
+For more information on embedding ActiveMQ, see [Embedding ActiveMQ](embedding-activemq.md).
 
 ## ActiveMQ integrated with a JEE application server
 

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/diagrams/architecture-diagrams.odg
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/diagrams/architecture-diagrams.odg b/docs/user-manual/en/diagrams/architecture-diagrams.odg
index 33d99cf..e73560b 100644
Binary files a/docs/user-manual/en/diagrams/architecture-diagrams.odg and b/docs/user-manual/en/diagrams/architecture-diagrams.odg differ

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/images/architecture1.jpg
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/images/architecture1.jpg b/docs/user-manual/en/images/architecture1.jpg
index cb1161f..3320b03 100644
Binary files a/docs/user-manual/en/images/architecture1.jpg and b/docs/user-manual/en/images/architecture1.jpg differ

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/images/architecture2.jpg
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/images/architecture2.jpg b/docs/user-manual/en/images/architecture2.jpg
index 274f578..9645f34 100644
Binary files a/docs/user-manual/en/images/architecture2.jpg and b/docs/user-manual/en/images/architecture2.jpg differ

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/images/architecture3.jpg
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/images/architecture3.jpg b/docs/user-manual/en/images/architecture3.jpg
index 3c1dfd5..f8c250a 100644
Binary files a/docs/user-manual/en/images/architecture3.jpg and b/docs/user-manual/en/images/architecture3.jpg differ

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/messaging-concepts.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/messaging-concepts.md b/docs/user-manual/en/messaging-concepts.md
index 5f2ea31..e963d2a 100644
--- a/docs/user-manual/en/messaging-concepts.md
+++ b/docs/user-manual/en/messaging-concepts.md
@@ -170,7 +170,7 @@ Let's take a brief look at these:
 ### Java Message Service (JMS)
 
 [JMS](http://en.wikipedia.org/wiki/Java_Message_Service) is part of
-Sun's JEE specification. It's a Java API that encapsulates both message
+Oracle's JEE specification. It's a Java API that encapsulates both message
 queue and publish-subscribe messaging patterns. JMS is a lowest common
 denominator specification - i.e. it was created to encapsulate common
 functionality of the already existing messaging systems that were

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/c8708784/docs/user-manual/en/persistence.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/persistence.md b/docs/user-manual/en/persistence.md
index 9497ac0..44e0375 100644
--- a/docs/user-manual/en/persistence.md
+++ b/docs/user-manual/en/persistence.md
@@ -354,31 +354,24 @@ message data, duplicate id caches or paging data will be persisted.
 
 You may want to inspect the existent records on each one of the journals
 used by ActiveMQ, and you can use the export/import tool for that
-purpose. The export/import are classes located at the activemq-core.jar,
+purpose.
 you can export the journal as a text file by using this command:
 
-`java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal
-                <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize>
-                <FileOutput>`
+`java -cp activemq-tools-jar-with-dependencies.jar export-journal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>`
 
 To import the file as binary data on the journal (Notice you also
 require netty.jar):
 
-`java -cp activemq-core.jar:netty.jar org.apache.activemq.core.journal.impl.ImportJournal
-                <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize>
-                <FileInput>`
+`java -cp activemq-tools-jar-with-dependencies.jar import-journal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileInput>`
 
--   JournalDirectory: Use the configured folder for your selected
-    folder. Example: ./activemq/data/journal
+-   JournalDirectory: Use the configured folder for your selected folder. Example: ./activemq/data/journal
 
--   JournalPrefix: Use the prefix for your selected journal, as
-    discussed above
+-   JournalPrefix: Use the prefix for your selected journal, as discussed above
 
--   FileExtension: Use the extension for your selected journal, as
-    discussed above
+-   FileExtension: Use the extension for your selected journal, as discussed above
 
 -   FileSize: Use the size for your selected journal, as discussed above
 
--   FileOutput: text file that will contain the exported data
-
+-   FileOutput or FileInput: text file that will contain the exported data
 
+See [Tools](tools.md) for more information.


[2/5] activemq-6 git commit: moving export-journal / import-journal to the proper tools place

Posted by an...@apache.org.
moving export-journal / import-journal to the proper tools place

This is simply moving the export/import journal to its proper place.
The previous commit should have added docs about this


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/210222e2
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/210222e2
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/210222e2

Branch: refs/heads/master
Commit: 210222e24fa4cc7e8b184ca1c3d4a9bc52d560bc
Parents: ed7c429
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed Feb 25 22:45:21 2015 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Feb 26 00:26:52 2015 -0500

----------------------------------------------------------------------
 .../core/journal/impl/ExportJournal.java        | 210 ----------
 .../core/journal/impl/ImportJournal.java        | 392 ------------------
 .../apache/activemq/tools/ExportJournal.java    | 226 ++++++++++
 .../apache/activemq/tools/ImportJournal.java    | 413 +++++++++++++++++++
 .../java/org/apache/activemq/tools/Main.java    |  16 +-
 .../journal/NIOJournalCompactTest.java          |   2 +-
 .../persistence/ExportFormatTest.java           |   6 +-
 tests/unit-tests/pom.xml                        |   5 +
 .../core/journal/impl/JournalImplTestBase.java  |   4 +-
 9 files changed, 665 insertions(+), 609 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
deleted file mode 100644
index e00204a..0000000
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ExportJournal.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.core.journal.impl;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintStream;
-import java.util.List;
-
-import org.apache.activemq.core.journal.RecordInfo;
-import org.apache.activemq.core.journal.SequentialFileFactory;
-import org.apache.activemq.utils.Base64;
-
-/**
- * Use this class to export the journal data. You can use it as a main class or through its native method {@link ExportJournal#exportJournal(String, String, String, int, int, String)}
- *
- * If you use the main method, use it as  <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
- *
- * Example: java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
- *
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- *
- *
- */
-public class ExportJournal
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public static void main(final String[] arg)
-   {
-      if (arg.length != 5)
-      {
-         System.err.println("Use: java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
-         return;
-      }
-
-      try
-      {
-         ExportJournal.exportJournal(arg[0], arg[1], arg[2], 2, Integer.parseInt(arg[3]), arg[4]);
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-
-   }
-
-   public static void exportJournal(final String directory,
-                                    final String journalPrefix,
-                                    final String journalSuffix,
-                                    final int minFiles,
-                                    final int fileSize,
-                                    final String fileOutput) throws Exception
-   {
-
-      FileOutputStream fileOut = new FileOutputStream(new File(fileOutput));
-
-      BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);
-
-      PrintStream out = new PrintStream(buffOut);
-
-      ExportJournal.exportJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, out);
-
-      out.close();
-   }
-
-   public static void exportJournal(final String directory,
-                                    final String journalPrefix,
-                                    final String journalSuffix,
-                                    final int minFiles,
-                                    final int fileSize,
-                                    final PrintStream out) throws Exception
-   {
-      NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
-
-      JournalImpl journal = new JournalImpl(fileSize, minFiles, 0, 0, nio, journalPrefix, journalSuffix, 1);
-
-      List<JournalFile> files = journal.orderFiles();
-
-      for (JournalFile file : files)
-      {
-         out.println("#File," + file);
-
-         ExportJournal.exportJournalFile(out, nio, file);
-      }
-   }
-
-   /**
-    * @param out
-    * @param fileFactory
-    * @param file
-    * @throws Exception
-    */
-   public static void exportJournalFile(final PrintStream out,
-                                        final SequentialFileFactory fileFactory,
-                                        final JournalFile file) throws Exception
-   {
-      JournalImpl.readJournalFile(fileFactory, file, new JournalReaderCallback()
-      {
-
-         public void onReadUpdateRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
-         {
-            out.println("operation@UpdateTX,txID@" + transactionID + "," + ExportJournal.describeRecord(recordInfo));
-         }
-
-         public void onReadUpdateRecord(final RecordInfo recordInfo) throws Exception
-         {
-            out.println("operation@Update," + ExportJournal.describeRecord(recordInfo));
-         }
-
-         public void onReadRollbackRecord(final long transactionID) throws Exception
-         {
-            out.println("operation@Rollback,txID@" + transactionID);
-         }
-
-         public void onReadPrepareRecord(final long transactionID, final byte[] extraData, final int numberOfRecords) throws Exception
-         {
-            out.println("operation@Prepare,txID@" + transactionID +
-                        ",numberOfRecords@" +
-                        numberOfRecords +
-                        ",extraData@" +
-                        ExportJournal.encode(extraData));
-         }
-
-         public void onReadDeleteRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
-         {
-            out.println("operation@DeleteRecordTX,txID@" + transactionID +
-                        "," +
-                        ExportJournal.describeRecord(recordInfo));
-         }
-
-         public void onReadDeleteRecord(final long recordID) throws Exception
-         {
-            out.println("operation@DeleteRecord,id@" + recordID);
-         }
-
-         public void onReadCommitRecord(final long transactionID, final int numberOfRecords) throws Exception
-         {
-            out.println("operation@Commit,txID@" + transactionID + ",numberOfRecords@" + numberOfRecords);
-         }
-
-         public void onReadAddRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
-         {
-            out.println("operation@AddRecordTX,txID@" + transactionID + "," + ExportJournal.describeRecord(recordInfo));
-         }
-
-         public void onReadAddRecord(final RecordInfo recordInfo) throws Exception
-         {
-            out.println("operation@AddRecord," + ExportJournal.describeRecord(recordInfo));
-         }
-
-         public void markAsDataFile(final JournalFile file)
-         {
-         }
-      });
-   }
-
-   private static String describeRecord(final RecordInfo recordInfo)
-   {
-      return "id@" + recordInfo.id +
-             ",userRecordType@" +
-             recordInfo.userRecordType +
-             ",length@" +
-             recordInfo.data.length +
-             ",isUpdate@" +
-             recordInfo.isUpdate +
-             ",compactCount@" +
-             recordInfo.compactCount +
-             ",data@" +
-             ExportJournal.encode(recordInfo.data);
-   }
-
-   private static String encode(final byte[] data)
-   {
-      return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java b/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
deleted file mode 100644
index 155aeae..0000000
--- a/activemq-journal/src/main/java/org/apache/activemq/core/journal/impl/ImportJournal.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.core.journal.impl;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.activemq.core.journal.RecordInfo;
-import org.apache.activemq.utils.Base64;
-
-/**
- * Use this class to import the journal data from a listed file. You can use it as a main class or
- * through its native method
- * {@link ImportJournal#importJournal(String, String, String, int, int, String)}
- * <p>
- * If you use the main method, use its arguments as:
- *
- * <pre>
- * JournalDirectory JournalPrefix FileExtension MinFiles FileSize FileOutput
- * </pre>
- * <p>
- * Example:
- *
- * <pre>
- * java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
- * </pre>
- * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
- */
-public class ImportJournal
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public static void main(final String[] arg)
-   {
-      if (arg.length != 5)
-      {
-         System.err.println("Use: java -cp activemq-core.jar:netty.jar org.apache.activemq.core.journal.impl.ImportJournal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
-         return;
-      }
-
-      try
-      {
-         ImportJournal.importJournal(arg[0], arg[1], arg[2], 2, Integer.parseInt(arg[3]), arg[4]);
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-      }
-
-   }
-
-   public static void importJournal(final String directory,
-                                    final String journalPrefix,
-                                    final String journalSuffix,
-                                    final int minFiles,
-                                    final int fileSize,
-                                    final String fileInput) throws Exception
-   {
-      FileInputStream fileInputStream = new FileInputStream(new File(fileInput));
-      ImportJournal.importJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, fileInputStream);
-
-   }
-
-   public static void importJournal(final String directory,
-                                    final String journalPrefix,
-                                    final String journalSuffix,
-                                    final int minFiles,
-                                    final int fileSize,
-                                    final InputStream stream) throws Exception
-   {
-      Reader reader = new InputStreamReader(stream);
-      ImportJournal.importJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, reader);
-   }
-
-   public static void importJournal(final String directory,
-                                    final String journalPrefix,
-                                    final String journalSuffix,
-                                    final int minFiles,
-                                    final int fileSize,
-                                    final Reader reader) throws Exception
-   {
-
-      File journalDir = new File(directory);
-
-      if (!journalDir.exists())
-      {
-         if (!journalDir.mkdirs())
-            System.err.println("Could not create directory " + directory);
-      }
-
-      NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
-
-      JournalImpl journal = new JournalImpl(fileSize, minFiles, 0, 0, nio, journalPrefix, journalSuffix, 1);
-
-      if (journal.orderFiles().size() != 0)
-      {
-         throw new IllegalStateException("Import needs to create a brand new journal");
-      }
-
-      journal.start();
-
-      // The journal is empty, as we checked already. Calling load just to initialize the internal data
-      journal.loadInternalOnly();
-
-      BufferedReader buffReader = new BufferedReader(reader);
-
-      String line;
-
-      HashMap<Long, AtomicInteger> txCounters = new HashMap<Long, AtomicInteger>();
-
-      long lineNumber = 0;
-
-      Map<Long, JournalRecord> journalRecords = journal.getRecords();
-
-      while ((line = buffReader.readLine()) != null)
-      {
-         lineNumber++;
-         String[] splitLine = line.split(",");
-         if (splitLine[0].equals("#File"))
-         {
-            txCounters.clear();
-            continue;
-         }
-
-         Properties lineProperties = ImportJournal.parseLine(splitLine);
-
-         String operation = null;
-         try
-         {
-            operation = lineProperties.getProperty("operation");
-
-            if (operation.equals("AddRecord"))
-            {
-               RecordInfo info = ImportJournal.parseRecord(lineProperties);
-               journal.appendAddRecord(info.id, info.userRecordType, info.data, false);
-            }
-            else if (operation.equals("AddRecordTX"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               counter.incrementAndGet();
-               RecordInfo info = ImportJournal.parseRecord(lineProperties);
-               journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("AddRecordTX"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               counter.incrementAndGet();
-               RecordInfo info = ImportJournal.parseRecord(lineProperties);
-               journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("UpdateTX"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               counter.incrementAndGet();
-               RecordInfo info = ImportJournal.parseRecord(lineProperties);
-               journal.appendUpdateRecordTransactional(txID, info.id, info.userRecordType, info.data);
-            }
-            else if (operation.equals("Update"))
-            {
-               RecordInfo info = ImportJournal.parseRecord(lineProperties);
-               journal.appendUpdateRecord(info.id, info.userRecordType, info.data, false);
-            }
-            else if (operation.equals("DeleteRecord"))
-            {
-               long id = ImportJournal.parseLong("id", lineProperties);
-
-               // If not found it means the append/update records were reclaimed already
-               if (journalRecords.get(id) != null)
-               {
-                  journal.appendDeleteRecord(id, false);
-               }
-            }
-            else if (operation.equals("DeleteRecordTX"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               long id = ImportJournal.parseLong("id", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               counter.incrementAndGet();
-
-               // If not found it means the append/update records were reclaimed already
-               if (journalRecords.get(id) != null)
-               {
-                  journal.appendDeleteRecordTransactional(txID, id);
-               }
-            }
-            else if (operation.equals("Prepare"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               int numberOfRecords = ImportJournal.parseInt("numberOfRecords", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               byte[] data = ImportJournal.parseEncoding("extraData", lineProperties);
-
-               if (counter.get() == numberOfRecords)
-               {
-                  journal.appendPrepareRecord(txID, data, false);
-               }
-               else
-               {
-                  System.err.println("Transaction " + txID +
-                                     " at line " +
-                                     lineNumber +
-                                     " is incomplete. The prepare record expected " +
-                                     numberOfRecords +
-                                     " while the import only had " +
-                                     counter);
-               }
-            }
-            else if (operation.equals("Commit"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               int numberOfRecords = ImportJournal.parseInt("numberOfRecords", lineProperties);
-               AtomicInteger counter = ImportJournal.getCounter(txID, txCounters);
-               if (counter.get() == numberOfRecords)
-               {
-                  journal.appendCommitRecord(txID, false);
-               }
-               else
-               {
-                  System.err.println("Transaction " + txID +
-                                     " at line " +
-                                     lineNumber +
-                                     " is incomplete. The commit record expected " +
-                                     numberOfRecords +
-                                     " while the import only had " +
-                                     counter);
-               }
-            }
-            else if (operation.equals("Rollback"))
-            {
-               long txID = ImportJournal.parseLong("txID", lineProperties);
-               journal.appendRollbackRecord(txID, false);
-            }
-            else
-            {
-               System.err.println("Invalid opeartion " + operation + " at line " + lineNumber);
-            }
-         }
-         catch (Exception ex)
-         {
-            System.err.println("Error at line " + lineNumber + ", operation=" + operation + " msg = " + ex.getMessage());
-         }
-      }
-
-      journal.stop();
-   }
-
-   protected static AtomicInteger getCounter(final Long txID, final Map<Long, AtomicInteger> txCounters)
-   {
-
-      AtomicInteger counter = txCounters.get(txID);
-      if (counter == null)
-      {
-         counter = new AtomicInteger(0);
-         txCounters.put(txID, counter);
-      }
-
-      return counter;
-   }
-
-   protected static RecordInfo parseRecord(final Properties properties) throws Exception
-   {
-      long id = ImportJournal.parseLong("id", properties);
-      byte userRecordType = ImportJournal.parseByte("userRecordType", properties);
-      boolean isUpdate = ImportJournal.parseBoolean("isUpdate", properties);
-      byte[] data = ImportJournal.parseEncoding("data", properties);
-      return new RecordInfo(id, userRecordType, data, isUpdate, (short)0);
-   }
-
-   private static byte[] parseEncoding(final String name, final Properties properties) throws Exception
-   {
-      String value = ImportJournal.parseString(name, properties);
-
-      return ImportJournal.decode(value);
-   }
-
-   /**
-    * @param properties
-    * @return
-    */
-   private static int parseInt(final String name, final Properties properties) throws Exception
-   {
-      String value = ImportJournal.parseString(name, properties);
-
-      return Integer.parseInt(value);
-   }
-
-   private static long parseLong(final String name, final Properties properties) throws Exception
-   {
-      String value = ImportJournal.parseString(name, properties);
-
-      return Long.parseLong(value);
-   }
-
-   private static boolean parseBoolean(final String name, final Properties properties) throws Exception
-   {
-      String value = ImportJournal.parseString(name, properties);
-
-      return Boolean.parseBoolean(value);
-   }
-
-   private static byte parseByte(final String name, final Properties properties) throws Exception
-   {
-      String value = ImportJournal.parseString(name, properties);
-
-      return Byte.parseByte(value);
-   }
-
-   /**
-    * @param name
-    * @param properties
-    * @return
-    * @throws Exception
-    */
-   private static String parseString(final String name, final Properties properties) throws Exception
-   {
-      String value = properties.getProperty(name);
-
-      if (value == null)
-      {
-         throw new Exception("property " + name + " not found");
-      }
-      return value;
-   }
-
-   protected static Properties parseLine(final String[] splitLine)
-   {
-      Properties properties = new Properties();
-
-      for (String el : splitLine)
-      {
-         String[] tuple = el.split("@");
-         if (tuple.length == 2)
-         {
-            properties.put(tuple[0], tuple[1]);
-         }
-         else
-         {
-            properties.put(tuple[0], tuple[0]);
-         }
-      }
-
-      return properties;
-   }
-
-   private static byte[] decode(final String data)
-   {
-      return Base64.decode(data, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/activemq-tools/src/main/java/org/apache/activemq/tools/ExportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-tools/src/main/java/org/apache/activemq/tools/ExportJournal.java b/activemq-tools/src/main/java/org/apache/activemq/tools/ExportJournal.java
new file mode 100644
index 0000000..9e175b7
--- /dev/null
+++ b/activemq-tools/src/main/java/org/apache/activemq/tools/ExportJournal.java
@@ -0,0 +1,226 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.tools;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+import java.util.List;
+
+import org.apache.activemq.core.journal.RecordInfo;
+import org.apache.activemq.core.journal.SequentialFileFactory;
+import org.apache.activemq.core.journal.impl.JournalFile;
+import org.apache.activemq.core.journal.impl.JournalImpl;
+import org.apache.activemq.core.journal.impl.JournalReaderCallback;
+import org.apache.activemq.core.journal.impl.NIOSequentialFileFactory;
+import org.apache.activemq.utils.Base64;
+
+/**
+ * Use this class to export the journal data. You can use it as a main class or through its static method {@link #exportJournal(String, String, String, int, int, String)}
+ * <p/>
+ * If you use the main method, use it as  <JournalDirectory> <JournalPrefix> <FileExtension> <MinFiles> <FileSize> <FileOutput>
+ * <p/>
+ * Example: java -cp activemq-tools*-jar-with-dependencies.jar export-journal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
+ *
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ */
+public class ExportJournal
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public void process(final String[] arg)
+   {
+      if (arg.length != 6)
+      {
+         for (int i = 0; i < arg.length; i++)
+         {
+            System.out.println("arg[" + i + "] = " + arg[i]);
+         }
+         printUsage();
+         System.exit(-1);
+      }
+
+      try
+      {
+         exportJournal(arg[1], arg[2], arg[3], 2, Integer.parseInt(arg[4]), arg[5]);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public static void exportJournal(final String directory,
+                                    final String journalPrefix,
+                                    final String journalSuffix,
+                                    final int minFiles,
+                                    final int fileSize,
+                                    final String fileOutput) throws Exception
+   {
+
+      FileOutputStream fileOut = new FileOutputStream(new File(fileOutput));
+
+      BufferedOutputStream buffOut = new BufferedOutputStream(fileOut);
+
+      PrintStream out = new PrintStream(buffOut);
+
+      exportJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, out);
+
+      out.close();
+   }
+
+   public static void exportJournal(final String directory,
+                                    final String journalPrefix,
+                                    final String journalSuffix,
+                                    final int minFiles,
+                                    final int fileSize,
+                                    final PrintStream out) throws Exception
+   {
+      NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
+
+      JournalImpl journal = new JournalImpl(fileSize, minFiles, 0, 0, nio, journalPrefix, journalSuffix, 1);
+
+      List<JournalFile> files = journal.orderFiles();
+
+      for (JournalFile file : files)
+      {
+         out.println("#File," + file);
+
+         exportJournalFile(out, nio, file);
+      }
+   }
+
+   /**
+    * @param out
+    * @param fileFactory
+    * @param file
+    * @throws Exception
+    */
+   public static void exportJournalFile(final PrintStream out,
+                                        final SequentialFileFactory fileFactory,
+                                        final JournalFile file) throws Exception
+   {
+      JournalImpl.readJournalFile(fileFactory, file, new JournalReaderCallback()
+      {
+
+         public void onReadUpdateRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
+         {
+            out.println("operation@UpdateTX,txID@" + transactionID + "," + describeRecord(recordInfo));
+         }
+
+         public void onReadUpdateRecord(final RecordInfo recordInfo) throws Exception
+         {
+            out.println("operation@Update," + describeRecord(recordInfo));
+         }
+
+         public void onReadRollbackRecord(final long transactionID) throws Exception
+         {
+            out.println("operation@Rollback,txID@" + transactionID);
+         }
+
+         public void onReadPrepareRecord(final long transactionID, final byte[] extraData, final int numberOfRecords) throws Exception
+         {
+            out.println("operation@Prepare,txID@" + transactionID +
+                           ",numberOfRecords@" +
+                           numberOfRecords +
+                           ",extraData@" +
+                           encode(extraData));
+         }
+
+         public void onReadDeleteRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
+         {
+            out.println("operation@DeleteRecordTX,txID@" + transactionID +
+                           "," +
+                           describeRecord(recordInfo));
+         }
+
+         public void onReadDeleteRecord(final long recordID) throws Exception
+         {
+            out.println("operation@DeleteRecord,id@" + recordID);
+         }
+
+         public void onReadCommitRecord(final long transactionID, final int numberOfRecords) throws Exception
+         {
+            out.println("operation@Commit,txID@" + transactionID + ",numberOfRecords@" + numberOfRecords);
+         }
+
+         public void onReadAddRecordTX(final long transactionID, final RecordInfo recordInfo) throws Exception
+         {
+            out.println("operation@AddRecordTX,txID@" + transactionID + "," + describeRecord(recordInfo));
+         }
+
+         public void onReadAddRecord(final RecordInfo recordInfo) throws Exception
+         {
+            out.println("operation@AddRecord," + describeRecord(recordInfo));
+         }
+
+         public void markAsDataFile(final JournalFile file)
+         {
+         }
+      });
+   }
+
+   private static String describeRecord(final RecordInfo recordInfo)
+   {
+      return "id@" + recordInfo.id +
+         ",userRecordType@" +
+         recordInfo.userRecordType +
+         ",length@" +
+         recordInfo.data.length +
+         ",isUpdate@" +
+         recordInfo.isUpdate +
+         ",compactCount@" +
+         recordInfo.compactCount +
+         ",data@" +
+         encode(recordInfo.data);
+   }
+
+   private static String encode(final byte[] data)
+   {
+      return Base64.encodeBytes(data, 0, data.length, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
+   }
+
+
+   public void printUsage()
+   {
+      for (int i = 0; i < 10; i++)
+      {
+         System.err.println();
+      }
+      System.err.println("This method will export the journal at low level record.");
+      System.err.println();
+      System.err.println(Main.USAGE + " export-journal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileOutput>");
+      System.err.println();
+      for (int i = 0; i < 10; i++)
+      {
+         System.err.println();
+      }
+   }
+
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/activemq-tools/src/main/java/org/apache/activemq/tools/ImportJournal.java
----------------------------------------------------------------------
diff --git a/activemq-tools/src/main/java/org/apache/activemq/tools/ImportJournal.java b/activemq-tools/src/main/java/org/apache/activemq/tools/ImportJournal.java
new file mode 100644
index 0000000..77a04fd
--- /dev/null
+++ b/activemq-tools/src/main/java/org/apache/activemq/tools/ImportJournal.java
@@ -0,0 +1,413 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.tools;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.activemq.core.journal.RecordInfo;
+import org.apache.activemq.core.journal.impl.JournalImpl;
+import org.apache.activemq.core.journal.impl.JournalRecord;
+import org.apache.activemq.core.journal.impl.NIOSequentialFileFactory;
+import org.apache.activemq.utils.Base64;
+
+/**
+ * Use this class to import the journal data from a listed file. You can use it as a main class or
+ * through its native method
+ * {@link #importJournal(String, String, String, int, int, String)}
+ * <p>
+ * If you use the main method, use its arguments as:
+ *
+ * <pre>
+ * JournalDirectory JournalPrefix FileExtension MinFiles FileSize FileOutput
+ * </pre>
+ * <p>
+ * Example:
+ *
+ * <pre>
+ * java -cp activemq-core.jar org.apache.activemq.core.journal.impl.ExportJournal /journalDir activemq-data amq 2 10485760 /tmp/export.dat
+ * </pre>
+ * @author <a href="mailto:clebert.suconic@jboss.org">Clebert Suconic</a>
+ */
+public class ImportJournal
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+
+   public void process(final String[] arg)
+   {
+      for (int i = 0; i < arg.length; i++)
+      {
+         System.out.println("arg[" + i + "] = " + arg[i]);
+      }
+      if (arg.length != 6)
+      {
+         for (int i = 0; i < arg.length; i++)
+         {
+            System.out.println("arg[" + i + "] = " + arg[i]);
+         }
+         printUsage();
+         System.exit(-1);
+      }
+
+      try
+      {
+         importJournal(arg[1], arg[2], arg[3], 2, Integer.parseInt(arg[4]), arg[5]);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+      }
+
+   }
+
+   public static void importJournal(final String directory,
+                                    final String journalPrefix,
+                                    final String journalSuffix,
+                                    final int minFiles,
+                                    final int fileSize,
+                                    final String fileInput) throws Exception
+   {
+      FileInputStream fileInputStream = new FileInputStream(new File(fileInput));
+      importJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, fileInputStream);
+
+   }
+
+   public static void importJournal(final String directory,
+                                    final String journalPrefix,
+                                    final String journalSuffix,
+                                    final int minFiles,
+                                    final int fileSize,
+                                    final InputStream stream) throws Exception
+   {
+      Reader reader = new InputStreamReader(stream);
+      importJournal(directory, journalPrefix, journalSuffix, minFiles, fileSize, reader);
+   }
+
+   public static void importJournal(final String directory,
+                                    final String journalPrefix,
+                                    final String journalSuffix,
+                                    final int minFiles,
+                                    final int fileSize,
+                                    final Reader reader) throws Exception
+   {
+
+      File journalDir = new File(directory);
+
+      if (!journalDir.exists())
+      {
+         if (!journalDir.mkdirs())
+            System.err.println("Could not create directory " + directory);
+      }
+
+      NIOSequentialFileFactory nio = new NIOSequentialFileFactory(directory, null);
+
+      JournalImpl journal = new JournalImpl(fileSize, minFiles, 0, 0, nio, journalPrefix, journalSuffix, 1);
+
+      if (journal.orderFiles().size() != 0)
+      {
+         throw new IllegalStateException("Import needs to create a brand new journal");
+      }
+
+      journal.start();
+
+      // The journal is empty, as we checked already. Calling load just to initialize the internal data
+      journal.loadInternalOnly();
+
+      BufferedReader buffReader = new BufferedReader(reader);
+
+      String line;
+
+      HashMap<Long, AtomicInteger> txCounters = new HashMap<Long, AtomicInteger>();
+
+      long lineNumber = 0;
+
+      Map<Long, JournalRecord> journalRecords = journal.getRecords();
+
+      while ((line = buffReader.readLine()) != null)
+      {
+         lineNumber++;
+         String[] splitLine = line.split(",");
+         if (splitLine[0].equals("#File"))
+         {
+            txCounters.clear();
+            continue;
+         }
+
+         Properties lineProperties = parseLine(splitLine);
+
+         String operation = null;
+         try
+         {
+            operation = lineProperties.getProperty("operation");
+
+            if (operation.equals("AddRecord"))
+            {
+               RecordInfo info = parseRecord(lineProperties);
+               journal.appendAddRecord(info.id, info.userRecordType, info.data, false);
+            }
+            else if (operation.equals("AddRecordTX"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               counter.incrementAndGet();
+               RecordInfo info = parseRecord(lineProperties);
+               journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
+            }
+            else if (operation.equals("AddRecordTX"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               counter.incrementAndGet();
+               RecordInfo info = parseRecord(lineProperties);
+               journal.appendAddRecordTransactional(txID, info.id, info.userRecordType, info.data);
+            }
+            else if (operation.equals("UpdateTX"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               counter.incrementAndGet();
+               RecordInfo info = parseRecord(lineProperties);
+               journal.appendUpdateRecordTransactional(txID, info.id, info.userRecordType, info.data);
+            }
+            else if (operation.equals("Update"))
+            {
+               RecordInfo info = parseRecord(lineProperties);
+               journal.appendUpdateRecord(info.id, info.userRecordType, info.data, false);
+            }
+            else if (operation.equals("DeleteRecord"))
+            {
+               long id = parseLong("id", lineProperties);
+
+               // If not found it means the append/update records were reclaimed already
+               if (journalRecords.get(id) != null)
+               {
+                  journal.appendDeleteRecord(id, false);
+               }
+            }
+            else if (operation.equals("DeleteRecordTX"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               long id = parseLong("id", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               counter.incrementAndGet();
+
+               // If not found it means the append/update records were reclaimed already
+               if (journalRecords.get(id) != null)
+               {
+                  journal.appendDeleteRecordTransactional(txID, id);
+               }
+            }
+            else if (operation.equals("Prepare"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               int numberOfRecords = parseInt("numberOfRecords", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               byte[] data = parseEncoding("extraData", lineProperties);
+
+               if (counter.get() == numberOfRecords)
+               {
+                  journal.appendPrepareRecord(txID, data, false);
+               }
+               else
+               {
+                  System.err.println("Transaction " + txID +
+                                     " at line " +
+                                     lineNumber +
+                                     " is incomplete. The prepare record expected " +
+                                     numberOfRecords +
+                                     " while the import only had " +
+                                     counter);
+               }
+            }
+            else if (operation.equals("Commit"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               int numberOfRecords = parseInt("numberOfRecords", lineProperties);
+               AtomicInteger counter = getCounter(txID, txCounters);
+               if (counter.get() == numberOfRecords)
+               {
+                  journal.appendCommitRecord(txID, false);
+               }
+               else
+               {
+                  System.err.println("Transaction " + txID +
+                                     " at line " +
+                                     lineNumber +
+                                     " is incomplete. The commit record expected " +
+                                     numberOfRecords +
+                                     " while the import only had " +
+                                     counter);
+               }
+            }
+            else if (operation.equals("Rollback"))
+            {
+               long txID = parseLong("txID", lineProperties);
+               journal.appendRollbackRecord(txID, false);
+            }
+            else
+            {
+               System.err.println("Invalid operation " + operation + " at line " + lineNumber);
+            }
+         }
+         catch (Exception ex)
+         {
+            System.err.println("Error at line " + lineNumber + ", operation=" + operation + " msg = " + ex.getMessage());
+         }
+      }
+
+      journal.stop();
+   }
+
+   protected static AtomicInteger getCounter(final Long txID, final Map<Long, AtomicInteger> txCounters)
+   {
+
+      AtomicInteger counter = txCounters.get(txID);
+      if (counter == null)
+      {
+         counter = new AtomicInteger(0);
+         txCounters.put(txID, counter);
+      }
+
+      return counter;
+   }
+
+   protected static RecordInfo parseRecord(final Properties properties) throws Exception
+   {
+      long id = parseLong("id", properties);
+      byte userRecordType = parseByte("userRecordType", properties);
+      boolean isUpdate = parseBoolean("isUpdate", properties);
+      byte[] data = parseEncoding("data", properties);
+      return new RecordInfo(id, userRecordType, data, isUpdate, (short)0);
+   }
+
+   private static byte[] parseEncoding(final String name, final Properties properties) throws Exception
+   {
+      String value = parseString(name, properties);
+
+      return decode(value);
+   }
+
+   /**
+    * @param properties
+    * @return
+    */
+   private static int parseInt(final String name, final Properties properties) throws Exception
+   {
+      String value = parseString(name, properties);
+
+      return Integer.parseInt(value);
+   }
+
+   private static long parseLong(final String name, final Properties properties) throws Exception
+   {
+      String value = parseString(name, properties);
+
+      return Long.parseLong(value);
+   }
+
+   private static boolean parseBoolean(final String name, final Properties properties) throws Exception
+   {
+      String value = parseString(name, properties);
+
+      return Boolean.parseBoolean(value);
+   }
+
+   private static byte parseByte(final String name, final Properties properties) throws Exception
+   {
+      String value = parseString(name, properties);
+
+      return Byte.parseByte(value);
+   }
+
+   /**
+    * @param name
+    * @param properties
+    * @return
+    * @throws Exception
+    */
+   private static String parseString(final String name, final Properties properties) throws Exception
+   {
+      String value = properties.getProperty(name);
+
+      if (value == null)
+      {
+         throw new Exception("property " + name + " not found");
+      }
+      return value;
+   }
+
+   protected static Properties parseLine(final String[] splitLine)
+   {
+      Properties properties = new Properties();
+
+      for (String el : splitLine)
+      {
+         String[] tuple = el.split("@");
+         if (tuple.length == 2)
+         {
+            properties.put(tuple[0], tuple[1]);
+         }
+         else
+         {
+            properties.put(tuple[0], tuple[0]);
+         }
+      }
+
+      return properties;
+   }
+
+   private static byte[] decode(final String data)
+   {
+      return Base64.decode(data, Base64.DONT_BREAK_LINES | Base64.URL_SAFE);
+   }
+
+
+   public void printUsage()
+   {
+      for (int i = 0; i < 10; i++)
+      {
+         System.err.println();
+      }
+      System.err.println("This method will export the journal at low level record.");
+      System.err.println();
+      System.err.println(Main.USAGE + " import-journal <JournalDirectory> <JournalPrefix> <FileExtension> <FileSize> <FileInput>");
+      System.err.println();
+      for (int i = 0; i < 10; i++)
+      {
+         System.err.println();
+      }
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/activemq-tools/src/main/java/org/apache/activemq/tools/Main.java
----------------------------------------------------------------------
diff --git a/activemq-tools/src/main/java/org/apache/activemq/tools/Main.java b/activemq-tools/src/main/java/org/apache/activemq/tools/Main.java
index afbf4f4..9eee57f 100644
--- a/activemq-tools/src/main/java/org/apache/activemq/tools/Main.java
+++ b/activemq-tools/src/main/java/org/apache/activemq/tools/Main.java
@@ -25,7 +25,9 @@ public class Main
    private static final String PRINT_PAGES = "print-pages";
    private static final String DATA_TOOL = "data-tool";
    private static final String TRANSFER = "transfer-queue";
-   private static final String OPTIONS = " [" + IMPORT + "|" + EXPORT + "|" + PRINT_DATA + "|" + PRINT_PAGES + "|" + DATA_TOOL + "|" + TRANSFER + "]";
+   private static final String EXPORT_JOURNAL = "export-journal";
+   private static final String IMPORT_JOURNAL = "import-journal";
+   private static final String OPTIONS = " [" + IMPORT + "|" + EXPORT + "|" + PRINT_DATA + "|" + PRINT_PAGES + "|" + DATA_TOOL + "|" + TRANSFER + "|" + EXPORT_JOURNAL + "|" + IMPORT_JOURNAL + "]";
 
    public static void main(String[] arg) throws Exception
    {
@@ -36,7 +38,17 @@ public class Main
       }
 
 
-      if (TRANSFER.equals(arg[0]))
+      if (IMPORT_JOURNAL.equals(arg[0]))
+      {
+         ImportJournal tool = new ImportJournal();
+         tool.process(arg);
+      }
+      else if (EXPORT_JOURNAL.equals(arg[0]))
+      {
+         ExportJournal tool = new ExportJournal();
+         tool.process(arg);
+      }
+      else if (TRANSFER.equals(arg[0]))
       {
          TransferQueue tool = new TransferQueue();
          tool.process(arg);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/journal/NIOJournalCompactTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/journal/NIOJournalCompactTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/journal/NIOJournalCompactTest.java
index 992437c..e24905f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/journal/NIOJournalCompactTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/journal/NIOJournalCompactTest.java
@@ -38,7 +38,6 @@ import org.apache.activemq.core.journal.RecordInfo;
 import org.apache.activemq.core.journal.SequentialFile;
 import org.apache.activemq.core.journal.SequentialFileFactory;
 import org.apache.activemq.core.journal.impl.AbstractJournalUpdateTask;
-import org.apache.activemq.core.journal.impl.ExportJournal;
 import org.apache.activemq.core.journal.impl.JournalCompactor;
 import org.apache.activemq.core.journal.impl.JournalFile;
 import org.apache.activemq.core.journal.impl.JournalFileImpl;
@@ -50,6 +49,7 @@ import org.apache.activemq.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.tests.unit.core.journal.impl.JournalImplTestBase;
 import org.apache.activemq.tests.unit.core.journal.impl.fakes.SimpleEncoding;
 import org.apache.activemq.tests.util.UnitTestCase;
+import org.apache.activemq.tools.ExportJournal;
 import org.apache.activemq.utils.IDGenerator;
 import org.apache.activemq.utils.OrderedExecutorFactory;
 import org.apache.activemq.utils.SimpleIDGenerator;

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/ExportFormatTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/ExportFormatTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/ExportFormatTest.java
index fbd9e74..f61b900 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/ExportFormatTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/tests/integration/persistence/ExportFormatTest.java
@@ -16,6 +16,8 @@
  */
 package org.apache.activemq.tests.integration.persistence;
 
+import org.apache.activemq.tools.ExportJournal;
+import org.apache.activemq.tools.ImportJournal;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -27,8 +29,6 @@ import org.apache.activemq.api.core.client.ClientProducer;
 import org.apache.activemq.api.core.client.ClientSession;
 import org.apache.activemq.api.core.client.ClientSessionFactory;
 import org.apache.activemq.api.core.client.ServerLocator;
-import org.apache.activemq.core.journal.impl.ExportJournal;
-import org.apache.activemq.core.journal.impl.ImportJournal;
 import org.apache.activemq.core.server.ActiveMQServer;
 import org.apache.activemq.tests.util.ServiceTestBase;
 
@@ -117,10 +117,12 @@ public class ExportFormatTest extends ServiceTestBase
       locator.close();
       server.stop();
 
+      System.out.println();
       System.out.println("copy & paste the following as bindingsFile:");
 
       ExportJournal.exportJournal(getBindingsDir(), "activemq-bindings", "bindings", 2, 1048576, System.out);
 
+      System.out.println();
       System.out.println("copy & paste the following as dataFile:");
 
       ExportJournal.exportJournal(getJournalDir(), "activemq-data", "amq", 2, 102400, System.out);

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/tests/unit-tests/pom.xml
----------------------------------------------------------------------
diff --git a/tests/unit-tests/pom.xml b/tests/unit-tests/pom.xml
index cc08555..5c22bb0 100644
--- a/tests/unit-tests/pom.xml
+++ b/tests/unit-tests/pom.xml
@@ -67,6 +67,11 @@
          <version>${project.version}</version>
       </dependency>
       <dependency>
+         <groupId>org.apache.activemq</groupId>
+         <artifactId>activemq-tools</artifactId>
+         <version>${project.version}</version>
+      </dependency>
+      <dependency>
          <groupId>org.apache.geronimo.specs</groupId>
          <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
       </dependency>

http://git-wip-us.apache.org/repos/asf/activemq-6/blob/210222e2/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/journal/impl/JournalImplTestBase.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/journal/impl/JournalImplTestBase.java b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/journal/impl/JournalImplTestBase.java
index 5ed11a1..01a42e2 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/journal/impl/JournalImplTestBase.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/journal/impl/JournalImplTestBase.java
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 package org.apache.activemq.tests.unit.core.journal.impl;
+import org.apache.activemq.tools.ExportJournal;
+import org.apache.activemq.tools.ImportJournal;
 import org.junit.Before;
 import org.junit.After;
 
@@ -35,8 +37,6 @@ import org.apache.activemq.core.journal.PreparedTransactionInfo;
 import org.apache.activemq.core.journal.RecordInfo;
 import org.apache.activemq.core.journal.SequentialFileFactory;
 import org.apache.activemq.core.journal.TestableJournal;
-import org.apache.activemq.core.journal.impl.ExportJournal;
-import org.apache.activemq.core.journal.impl.ImportJournal;
 import org.apache.activemq.core.journal.impl.JournalImpl;
 import org.apache.activemq.tests.util.UnitTestCase;
 import org.apache.activemq.utils.ReusableLatch;