activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/3] activemq-artemis git commit: Bringing data print back to artemis_home without instance defined. This is useful to debug data from tests and user's exports.
Date Fri, 25 Sep 2015 02:31:39 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master d58be06c3 -> 4cdcc618f


Bringing data print back to artemis_home without instance defined.
This is useful to debug data from tests and user's exports.


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

Branch: refs/heads/master
Commit: b0b5ca6896d56bd9c3d2049457180e702f8c7615
Parents: d58be06
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Sep 24 21:27:14 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Sep 24 22:30:52 2015 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/artemis/cli/Artemis.java  | 2 ++
 .../activemq/artemis/cli/commands/ActionAbstract.java       | 4 ----
 .../apache/activemq/artemis/cli/commands/Configurable.java  | 3 ++-
 .../activemq/artemis/cli/commands/tools/LockAbstract.java   | 9 ++++++++-
 4 files changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/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 a72ee51..ace192e 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
@@ -108,6 +108,8 @@ public class Artemis {
          builder = builder.withCommands(Run.class, Stop.class, Kill.class);
       }
       else {
+         builder.withGroup("data").withDescription("data tools group (print) (example ./artemis
data print)").
+            withDefaultCommand(HelpData.class).withCommands(PrintData.class);
          builder = builder.withCommand(Create.class);
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
index d5d68bd..406da24 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/ActionAbstract.java
@@ -57,10 +57,6 @@ public abstract class ActionAbstract implements Action {
             brokerInstance = brokerInstance.replace("\\", "/");
             System.setProperty("artemis.instance", brokerInstance);
          }
-         if (brokerInstance == null) {
-            // if still null we will try to improvise with "."
-            brokerInstance = ".";
-         }
       }
       return brokerInstance;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
index c4bd2d4..8caf8c2 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Configurable.java
@@ -126,6 +126,7 @@ public abstract class Configurable extends ActionAbstract {
             fileConfiguration.setJournalDirectory(defaultLocation + "/journal");
             fileConfiguration.setLargeMessagesDirectory(defaultLocation + "/largemessages");
             fileConfiguration.setPagingDirectory(defaultLocation + "/paging");
+            fileConfiguration.setBrokerInstance(new File("."));
          }
          else {
             fileConfiguration = new FileConfiguration();
@@ -135,10 +136,10 @@ public abstract class Configurable extends ActionAbstract {
             FileDeploymentManager fileDeploymentManager = new FileDeploymentManager(serverConfiguration);
             fileDeploymentManager.addDeployable(fileConfiguration).addDeployable(jmsConfiguration);
             fileDeploymentManager.readConfiguration();
+            fileConfiguration.setBrokerInstance(new File(getBrokerInstance()));
          }
       }
 
-      fileConfiguration.setBrokerInstance(new File(getBrokerInstance()));
 
       return fileConfiguration;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b0b5ca68/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
index 9a6984d..4a2a99f 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/tools/LockAbstract.java
@@ -24,7 +24,14 @@ public abstract class LockAbstract  extends DataAbstract implements Action
{
    @Override
    public Object execute(ActionContext context) throws Exception {
       super.execute(context);
-      lockCLI(getLockPlace());
+
+      if (getBrokerInstance() == null) {
+         System.err.println("Warning: You are running a data tool outside of any broker instance.
Modifying data on a running server might break the server's data");
+         System.err.println();
+      }
+      else {
+         lockCLI(getLockPlace());
+      }
 
       return null;
    }


Mime
View raw message