activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-904 Fixing server running
Date Fri, 05 May 2017 02:06:26 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 800976ec7 -> 955bba7ed


ARTEMIS-904 Fixing server running


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

Branch: refs/heads/master
Commit: 92c84a1699b4961b75b55aba36fd1552f1bd211c
Parents: 800976e
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu May 4 21:42:11 2017 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu May 4 21:42:40 2017 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/artemis/cli/Artemis.java | 16 ++++++++++++++++
 .../activemq/artemis/cli/commands/Run.java       |  4 ++--
 .../artemis/cli/commands/tools/PrintData.java    | 19 ++-----------------
 3 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/92c84a16/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index 45e1dfd..dfa6c91 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -17,6 +17,8 @@
 package org.apache.activemq.artemis.cli;
 
 import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.List;
 
 import io.airlift.airline.Cli;
@@ -172,4 +174,18 @@ public class Artemis {
       return builder;
    }
 
+   public static void printBanner() throws Exception {
+      copy(Artemis.class.getResourceAsStream("banner.txt"), System.out);
+   }
+
+   private static long copy(InputStream in, OutputStream out) throws Exception {
+      byte[] buffer = new byte[1024];
+      int len = in.read(buffer);
+      while (len != -1) {
+         out.write(buffer, 0, len);
+         len = in.read(buffer);
+      }
+      return len;
+   }
+
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/92c84a16/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
index a299b18..e48a1f4 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Run.java
@@ -22,8 +22,8 @@ import java.util.TimerTask;
 
 import io.airlift.airline.Command;
 import io.airlift.airline.Option;
+import org.apache.activemq.artemis.cli.Artemis;
 import org.apache.activemq.artemis.cli.commands.tools.LockAbstract;
-import org.apache.activemq.artemis.cli.commands.tools.PrintData;
 import org.apache.activemq.artemis.cli.factory.BrokerFactory;
 import org.apache.activemq.artemis.cli.factory.security.SecurityManagerFactory;
 import org.apache.activemq.artemis.components.ExternalComponent;
@@ -60,7 +60,7 @@ public class Run extends LockAbstract {
    public Object execute(ActionContext context) throws Exception {
       super.execute(context);
 
-      PrintData.printBanner();
+      Artemis.printBanner();
 
       BrokerDTO broker = getBrokerDTO();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/92c84a16/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
index d5e895d..20cbfae 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/PrintData.java
@@ -17,8 +17,6 @@
 package org.apache.activemq.artemis.cli.commands.tools;
 
 import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -33,6 +31,7 @@ import io.airlift.airline.Command;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQBuffers;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.cli.Artemis;
 import org.apache.activemq.artemis.cli.commands.ActionContext;
 import org.apache.activemq.artemis.core.journal.RecordInfo;
 import org.apache.activemq.artemis.core.message.impl.CoreMessagePersister;
@@ -82,7 +81,7 @@ public class PrintData extends OptionalLocking {
    public static void printData(File bindingsDirectory, File messagesDirectory, File pagingDirectory)
throws Exception {
       // Having the version on the data report is an information very useful to understand
what happened
       // When debugging stuff
-      printBanner();
+      Artemis.printBanner();
 
       File serverLockFile = new File(messagesDirectory, "server.lock");
 
@@ -136,20 +135,6 @@ public class PrintData extends OptionalLocking {
 
    }
 
-   public static void printBanner() throws Exception {
-      copy(PrintData.class.getResourceAsStream("banner.txt"), System.out);
-   }
-
-   private static long copy(InputStream in, OutputStream out) throws Exception {
-      byte[] buffer = new byte[1024];
-      int len = in.read(buffer);
-      while (len != -1) {
-         out.write(buffer, 0, len);
-         len = in.read(buffer);
-      }
-      return len;
-   }
-
    private static void printPages(File pageDirectory, DescribeJournal describeJournal) {
       try {
 


Mime
View raw message