provisionr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject [2/2] git commit: PROVISIONR-41. Fix Sonar violations (part 1)
Date Wed, 03 Jul 2013 14:56:51 GMT
PROVISIONR-41. Fix Sonar violations (part 1)


Project: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/commit/e896d1ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/tree/e896d1ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-provisionr/diff/e896d1ca

Branch: refs/heads/master
Commit: e896d1ca2432657911842524e38660596e1faaa4
Parents: 416958b
Author: Andrei Savu <asavu@apache.org>
Authored: Wed Jul 3 17:54:48 2013 +0300
Committer: Andrei Savu <asavu@apache.org>
Committed: Wed Jul 3 17:54:48 2013 +0300

----------------------------------------------------------------------
 .../karaf/commands/AddGroupCommand.java         |  2 +-
 .../activiti/karaf/commands/AddUserCommand.java |  2 +-
 .../commands/CleanHistoryActivitiCommand.java   | 14 +++----
 .../karaf/commands/DeleteGroupCommand.java      |  2 +-
 .../karaf/commands/DeleteUserCommand.java       |  2 +-
 .../karaf/commands/InfoActivitiCommand.java     | 18 +++++----
 .../karaf/commands/KillActivitiCommand.java     |  6 +--
 .../karaf/commands/ListGroupsCommand.java       |  2 +-
 .../karaf/commands/ListUsersCommand.java        |  2 +-
 .../karaf/commands/SignalActivitiCommand.java   |  8 ++--
 .../karaf/commands/StartActivitiCommand.java    |  2 +-
 .../handlers/AbstractActivitiPrintHandler.java  |  1 -
 .../handlers/DefaultActivitiPrintHandler.java   |  8 ++--
 .../activiti/karaf/commands/util/Commands.java  |  5 +--
 .../provisionr/api/network/RuleBuilder.java     |  4 +-
 .../org/apache/provisionr/api/pool/Machine.java |  6 ++-
 .../org/apache/provisionr/api/pool/Pool.java    | 11 ++++--
 .../apache/provisionr/core/CoreConstants.java   |  2 +-
 .../provisionr/core/CoreProcessVariables.java   |  3 +-
 .../org/apache/provisionr/core/CoreSignals.java |  2 +-
 .../org/apache/provisionr/core/Mustache.java    | 14 +++++--
 .../org/apache/provisionr/core/PoolStatus.java  | 10 ++---
 .../java/org/apache/provisionr/core/Ssh.java    | 10 ++---
 .../core/activities/CheckProcessesEnded.java    | 19 +++++-----
 .../core/activities/DownloadFiles.java          | 21 +++++++----
 .../core/activities/InstallPackages.java        | 20 ++++++----
 .../core/activities/InstallRepositories.java    | 25 ++++++++-----
 .../core/activities/IsMachinePortOpen.java      |  4 +-
 .../activities/KillMachineSetUpProcesses.java   | 32 ++++++++--------
 .../core/activities/PuppetActivity.java         | 14 +++----
 .../activities/SpawnProcessForEachMachine.java  | 10 ++---
 .../provisionr/core/logging/StreamLogger.java   | 14 ++++++-
 .../core/templates/PoolTemplateInstaller.java   |  8 ++--
 .../core/templates/xml/FileEntry.java           |  4 ++
 .../core/templates/xml/XmlTemplate.java         | 20 ++++++++--
 .../apache/provisionr/rundeck/Attribute.java    |  4 ++
 .../org/apache/provisionr/rundeck/Project.java  |  3 ++
 .../provisionr/rundeck/RundeckServlet.java      |  7 +---
 .../provisionr/commands/CreateImageCommand.java |  5 ++-
 .../provisionr/commands/CreatePoolCommand.java  |  3 +-
 .../provisionr/commands/DestroyPoolCommand.java |  2 +-
 .../provisionr/commands/ListPoolsCommand.java   |  2 +-
 .../commands/ListServicesCommand.java           |  4 +-
 .../commands/ListTemplatesCommand.java          |  6 +--
 .../predicates/ProvisionrPredicates.java        |  6 +--
 .../provisionr/amazon/ProcessVariables.java     | 22 +++++------
 .../activities/AllInstancesMatchPredicate.java  | 15 +++-----
 .../AllSpotRequestsMatchPredicate.java          | 25 ++++++-------
 .../amazon/activities/CancelSpotRequests.java   | 15 +++-----
 .../activities/CheckAllRequestsAreActive.java   |  2 +-
 .../amazon/activities/DumpConsoleOutput.java    |  9 +++--
 .../GetInstanceIdsFromSpotRequests.java         |  4 +-
 .../activities/PublishListOfMachines.java       |  2 +-
 .../amazon/activities/RunSpotInstances.java     | 20 +++++-----
 .../amazon/activities/SetupAdminAccess.java     | 39 +++++++++++++-------
 .../amazon/activities/TerminateInstances.java   | 14 +++----
 .../provisionr/amazon/core/ErrorCodes.java      |  2 +-
 .../provisionr/amazon/core/ImageTable.java      |  1 +
 .../apache/provisionr/amazon/core/KeyPairs.java |  2 +-
 .../core/ProviderClientCacheSupplier.java       |  2 +-
 .../provisionr/amazon/core/SecurityGroups.java  |  2 +-
 .../functions/ConvertIpPermissionToRule.java    |  7 +++-
 .../functions/ConvertRuleToIpPermission.java    |  5 ++-
 .../amazon/options/ProviderOptions.java         |  2 +-
 .../amazon/options/SoftwareOptions.java         |  2 +-
 .../provisionr/cloudstack/NetworkOptions.java   |  3 +-
 .../provisionr/cloudstack/ProviderOptions.java  |  9 +++--
 .../activities/CloudStackActivity.java          |  6 +--
 .../activities/DeleteSecurityGroup.java         |  6 +--
 .../cloudstack/activities/RunInstances.java     | 19 +++++-----
 .../cloudstack/commands/CommandSupport.java     |  7 ++--
 .../cloudstack/commands/OfferingsCommand.java   |  5 ++-
 .../cloudstack/commands/TemplatesCommand.java   |  6 +--
 .../cloudstack/commands/ZonesCommand.java       |  8 ++--
 .../core/ConvertIngressRuleToRule.java          | 19 ++++++----
 .../provisionr/cloudstack/core/KeyPairs.java    |  2 +-
 .../provisionr/cloudstack/core/Networks.java    | 16 ++++----
 .../cloudstack/core/SecurityGroups.java         |  8 ++--
 .../cloudstack/core/VirtualMachines.java        |  4 +-
 .../provisionr/cloudstack/core/Zones.java       |  4 +-
 .../org/apache/provisionr/test/Generics.java    |  5 +--
 .../org/apache/provisionr/test/KarafTests.java  |  2 +-
 .../test/ProcessVariablesCollector.java         |  2 +-
 .../apache/provisionr/test/TestConstants.java   |  5 ++-
 84 files changed, 388 insertions(+), 309 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddGroupCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddGroupCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddGroupCommand.java
index dc535d1..5d0696e 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddGroupCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddGroupCommand.java
@@ -38,7 +38,7 @@ public class AddGroupCommand extends ActivitiCommand {
     private String type = "security-role";
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         IdentityService identityService = getProcessEngine().getIdentityService();
 
         Group group = identityService.newGroup(id);

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddUserCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddUserCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddUserCommand.java
index 3236e2e..98b1069 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddUserCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/AddUserCommand.java
@@ -39,7 +39,7 @@ public class AddUserCommand extends ActivitiCommand {
     private String email = "";
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         if (getProcessEngine() == null) {
             throw new NullPointerException("Please configure a processEngine instance for this command");
         }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/CleanHistoryActivitiCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/CleanHistoryActivitiCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/CleanHistoryActivitiCommand.java
index 59bcfc6..fbb2a73 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/CleanHistoryActivitiCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/CleanHistoryActivitiCommand.java
@@ -41,7 +41,7 @@ public class CleanHistoryActivitiCommand extends ActivitiCommand {
     private String[] definitionIDs;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         ProcessEngine engine = this.getProcessEngine();
         if (engine == null) {
             out().println("Process Engine NOT Found!");
@@ -49,7 +49,7 @@ public class CleanHistoryActivitiCommand extends ActivitiCommand {
         }
         HistoryService historyService = engine.getHistoryService();
 
-        // order of priority if instnaceIDs or definitionIDs and all on the list
+        // order of priority if instanceIDs or definitionIDs and all on the list
         // process instnaceID and exist or process definitionIDs and exit or process all 
         // TODO figure out how to add mutually exclusive options - instanceIDs | definitions | all
 
@@ -86,7 +86,7 @@ public class CleanHistoryActivitiCommand extends ActivitiCommand {
         for (HistoricProcessInstance hpi : hpiList) {
             String processId = hpi.getId();
             hs.deleteHistoricProcessInstance(hpi.getId());
-            out().printf("History removed for process instance %s \n", processId);
+            out().printf("History removed for process instance %s %n", processId);
         }
     }
 
@@ -97,9 +97,9 @@ public class CleanHistoryActivitiCommand extends ActivitiCommand {
                 .processInstanceId(instanceId).singleResult();
             if (hpi != null) {
                 hs.deleteHistoricProcessInstance(hpi.getId());
-                out().printf("History removed for process instance %s \n", hpi.getId());
+                out().printf("History removed for process instance %s %n", hpi.getId());
             } else {
-                out().printf("No History found for process instance %s \n", instanceId);
+                out().printf("No History found for process instance %s %n", instanceId);
             }
         }
     }
@@ -111,13 +111,13 @@ public class CleanHistoryActivitiCommand extends ActivitiCommand {
                 .processDefinitionId(definitionId)
                 .orderByProcessDefinitionId().asc().list();
             if (hpiList == null || hpiList.size() == 0) {
-                out().printf("No History found for process definition %s \n", definitionId);
+                out().printf("No History found for process definition %s %n", definitionId);
                 break;
             }
             for (HistoricProcessInstance hpi : hpiList) {
                 String processId = hpi.getId();
                 hs.deleteHistoricProcessInstance(hpi.getId());
-                out().printf("History removed for process instance %s with definition %s\n", processId,
+                out().printf("History removed for process instance %s with definition %s%n", processId,
                     definitionId);
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteGroupCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteGroupCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteGroupCommand.java
index 48b65b0..d08f70e 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteGroupCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteGroupCommand.java
@@ -28,7 +28,7 @@ public class DeleteGroupCommand extends ActivitiCommand {
     private String id;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         getProcessEngine().getIdentityService().deleteGroup(id);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteUserCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteUserCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteUserCommand.java
index e9609b0..bc47fbb 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteUserCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/DeleteUserCommand.java
@@ -29,7 +29,7 @@ public class DeleteUserCommand extends ActivitiCommand {
     private String id;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         if (getProcessEngine() == null) {
             throw new NullPointerException("Please configure a processEngine instance for this command");
         }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/InfoActivitiCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/InfoActivitiCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/InfoActivitiCommand.java
index 3a0b357..9e05dd9 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/InfoActivitiCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/InfoActivitiCommand.java
@@ -234,15 +234,17 @@ public class InfoActivitiCommand extends ActivitiCommand {
         out().println("======== Process Instance Details");
         printProcessInstanceInfo(hpi);
 
-        List<HistoricActivityInstance> actInstList = hs.createHistoricActivityInstanceQuery()
-            .processInstanceId(hpi.getId()).orderByHistoricActivityInstanceStartTime().asc().list();
-        if (actInstList != null && actInstList.size() > 0) {
-            out().println("======== Activity Execution Details");
-            for (HistoricActivityInstance actInst : actInstList) {
-                printActivityInstanceInfo(actInst);
+        if (hpi != null) {
+            List<HistoricActivityInstance> actInstList = hs.createHistoricActivityInstanceQuery()
+                .processInstanceId(hpi.getId()).orderByHistoricActivityInstanceStartTime().asc().list();
+            if (actInstList != null && actInstList.size() > 0) {
+                out().println("======== Activity Execution Details");
+                for (HistoricActivityInstance actInst : actInstList) {
+                    printActivityInstanceInfo(actInst);
+                }
+            } else {
+                LOG.info("No Activity execution details");
             }
-        } else {
-            LOG.info("No Activity execution details");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/KillActivitiCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/KillActivitiCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/KillActivitiCommand.java
index 9ad47c1..60403f9 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/KillActivitiCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/KillActivitiCommand.java
@@ -37,7 +37,7 @@ public class KillActivitiCommand extends ActivitiCommand {
     private boolean killAll;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         ProcessEngine processEngine = this.getProcessEngine();
         if (processEngine == null) {
             out().println("Process Engine NOT Found!");
@@ -49,7 +49,7 @@ public class KillActivitiCommand extends ActivitiCommand {
         if (this.instanceIDs != null && this.instanceIDs.length > 0) {
             for (String instanceID : instanceIDs) {
                 runtimeService.deleteProcessInstance(instanceID, "Forcefully terminating the instance");
-                out().printf("Process instance %s terminated\n", instanceID);
+                out().printf("Process instance %s terminated%n", instanceID);
             }
             return null;
         }
@@ -63,7 +63,7 @@ public class KillActivitiCommand extends ActivitiCommand {
             for (ProcessInstance pi : piList) {
                 String instanceID = pi.getProcessInstanceId();
                 runtimeService.deleteProcessInstance(instanceID, "Forcefully terminating the instance");
-                out().printf("Process instance %s terminated\n", instanceID);
+                out().printf("Process instance %s terminated%n", instanceID);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListGroupsCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListGroupsCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListGroupsCommand.java
index fe2a730..cca4c4b 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListGroupsCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListGroupsCommand.java
@@ -26,7 +26,7 @@ import org.apache.felix.gogo.commands.Command;
 public class ListGroupsCommand extends ActivitiCommand {
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         List<Group> groups = getProcessEngine().getIdentityService()
             .createGroupQuery().orderByGroupId().asc().list();
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListUsersCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListUsersCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListUsersCommand.java
index 62afaff..a44ba25 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListUsersCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/ListUsersCommand.java
@@ -26,7 +26,7 @@ import org.apache.felix.gogo.commands.Command;
 public class ListUsersCommand extends ActivitiCommand {
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         List<User> users = getProcessEngine().getIdentityService()
             .createUserQuery().orderByUserId().asc().list();
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/SignalActivitiCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/SignalActivitiCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/SignalActivitiCommand.java
index 4993c74..0d15044 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/SignalActivitiCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/SignalActivitiCommand.java
@@ -43,7 +43,7 @@ public class SignalActivitiCommand extends ActivitiCommand {
     private String[] activities;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         ProcessEngine engine = this.getProcessEngine();
         if (engine == null) {
             out().println("Process Engine NOT Found!");
@@ -77,10 +77,10 @@ public class SignalActivitiCommand extends ActivitiCommand {
             if (!exec.isEnded()) {
                 rt.signal(exec.getId());
             } else {
-                out().printf("Execution %s already ended \n" + exec.getId());
+                out().printf("Execution %s already ended %n" + exec.getId());
             }
         } catch (Exception ex) {
-            out().printf("Exception:%s in signaling the execution %s \n", ex.getMessage(), exec.getId());
+            out().printf("Exception:%s in signaling the execution %s %n", ex.getMessage(), exec.getId());
         }
     }
 
@@ -96,7 +96,7 @@ public class SignalActivitiCommand extends ActivitiCommand {
             }
         } else {
             for (String activity : activities) {
-                out().printf("Signaling activity %s in process instance %s \n", activity, pi);
+                out().printf("Signaling activity %s in process instance %s %n", activity, pi);
                 List<Execution> executions = rt.createExecutionQuery()
                     .processInstanceId(pi)
                     .activityId(activity)

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/StartActivitiCommand.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/StartActivitiCommand.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/StartActivitiCommand.java
index 90d4114..ac47f31 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/StartActivitiCommand.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/StartActivitiCommand.java
@@ -33,7 +33,7 @@ public class StartActivitiCommand extends ActivitiCommand {
     private String definitionID;
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         ProcessEngine pe = this.getProcessEngine();
         if (pe == null) {
             out().println("Process Engine NOT Found!");

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/AbstractActivitiPrintHandler.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/AbstractActivitiPrintHandler.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/AbstractActivitiPrintHandler.java
index be0cb85..e22146a 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/AbstractActivitiPrintHandler.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/AbstractActivitiPrintHandler.java
@@ -81,7 +81,6 @@ public abstract class AbstractActivitiPrintHandler implements ActivitiPrintHandl
     protected void printVariable(PrintWriter out, HistoricVariableUpdate var) {
 
         LinkedHashMap<String, String> nvMap = new LinkedHashMap<String, String>();
-        // nvMap.put("Variable Type", var.getVariableTypeName());
         if (this.isVerbose()) {
             nvMap.put("Variable ID", var.getId());
             nvMap.put("Revision", "" + var.getRevision());

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/DefaultActivitiPrintHandler.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/DefaultActivitiPrintHandler.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/DefaultActivitiPrintHandler.java
index 67a1f5d..7caa83c 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/DefaultActivitiPrintHandler.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/handlers/DefaultActivitiPrintHandler.java
@@ -16,14 +16,13 @@
 
 package org.apache.provisionr.activiti.karaf.commands.handlers;
 
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import java.io.PrintWriter;
 import java.io.StringReader;
 import java.lang.reflect.Modifier;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
 import org.apache.provisionr.activiti.karaf.commands.util.Commands;
 
 /**
@@ -47,7 +46,8 @@ public class DefaultActivitiPrintHandler extends AbstractActivitiPrintHandler {
         try {
             jsonText = gson.toJson(varValue);
         } catch (Exception ex) {
-            jsonText = "{\n  " + varValue + "\n}"; // use default toString object            
+            // use default toString object
+            jsonText = String.format("{%n%s%n}", varValue);
             LOG.log(Level.SEVERE, "Serializing Activiti Variable. " + ex.getMessage(), ex);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/util/Commands.java
----------------------------------------------------------------------
diff --git a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/util/Commands.java b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/util/Commands.java
index f3edd30..c1f018d 100644
--- a/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/util/Commands.java
+++ b/activiti/commands/src/main/java/org/apache/provisionr/activiti/karaf/commands/util/Commands.java
@@ -37,9 +37,8 @@ public class Commands {
 
     public void printNameValues(PrintWriter out, Map<String, String> nvMap) {
         String fmt = "  %-16.16s %-20.60s\n";
-        for (String key : nvMap.keySet()) {
-            String value = nvMap.get(key);
-            out.printf(fmt, key + ":", value);
+        for (Map.Entry<String, String> entry : nvMap.entrySet()) {
+            out.printf(fmt, entry.getKey() + ":", entry.getValue());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/api/src/main/java/org/apache/provisionr/api/network/RuleBuilder.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/provisionr/api/network/RuleBuilder.java b/api/src/main/java/org/apache/provisionr/api/network/RuleBuilder.java
index 06de459..c610f09 100644
--- a/api/src/main/java/org/apache/provisionr/api/network/RuleBuilder.java
+++ b/api/src/main/java/org/apache/provisionr/api/network/RuleBuilder.java
@@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.collect.Range;
 import com.google.common.collect.Ranges;
+import org.apache.provisionr.api.pool.Machine;
 
 public class RuleBuilder {
 
@@ -44,7 +45,8 @@ public class RuleBuilder {
         checkArgument(ports.hasLowerBound(), "ports should have a closed lower bound ");
 
         checkArgument(ports.lowerEndpoint() > 0, "ports should be a positive range");
-        checkArgument(ports.upperEndpoint() < 65535, "ports upper bound should less than 65535");
+        checkArgument(ports.upperEndpoint() < Machine.MAX_PORT_NUMBER,
+            "ports upper bound should less than 65535");
 
         this.ports = checkNotNull(ports, "ports is null");
         return this;

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/api/src/main/java/org/apache/provisionr/api/pool/Machine.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/provisionr/api/pool/Machine.java b/api/src/main/java/org/apache/provisionr/api/pool/Machine.java
index a8febf8..7d30d31 100644
--- a/api/src/main/java/org/apache/provisionr/api/pool/Machine.java
+++ b/api/src/main/java/org/apache/provisionr/api/pool/Machine.java
@@ -18,11 +18,11 @@
 
 package org.apache.provisionr.api.pool;
 
-import org.apache.provisionr.api.util.WithOptions;
 import com.google.common.base.Objects;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 import java.util.Map;
+import org.apache.provisionr.api.util.WithOptions;
 
 /**
  * Details about a running machine from a pool
@@ -31,6 +31,8 @@ import java.util.Map;
  */
 public class Machine extends WithOptions {
 
+    public static final int MAX_PORT_NUMBER = 65535;
+
     public static MachineBuilder builder() {
         return new MachineBuilder();
     }
@@ -76,7 +78,7 @@ public class Machine extends WithOptions {
         this.privateDnsName = checkNotNull(privateDnsName, "privateDnsName is null");
         this.privateIp = checkNotNull(privateIp, "privateIp is null");
 
-        checkArgument(sshPort > 0 && sshPort < 65535, "invalid port number for ssh");
+        checkArgument(sshPort > 0 && sshPort <= MAX_PORT_NUMBER, "invalid port number for ssh");
         this.sshPort = sshPort;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/api/src/main/java/org/apache/provisionr/api/pool/Pool.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/provisionr/api/pool/Pool.java b/api/src/main/java/org/apache/provisionr/api/pool/Pool.java
index 37f23f4..777a177 100644
--- a/api/src/main/java/org/apache/provisionr/api/pool/Pool.java
+++ b/api/src/main/java/org/apache/provisionr/api/pool/Pool.java
@@ -18,16 +18,17 @@
 
 package org.apache.provisionr.api.pool;
 
+import com.google.common.base.Objects;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.Map;
+import javax.annotation.Generated;
 import org.apache.provisionr.api.access.AdminAccess;
 import org.apache.provisionr.api.hardware.Hardware;
 import org.apache.provisionr.api.network.Network;
 import org.apache.provisionr.api.provider.Provider;
 import org.apache.provisionr.api.software.Software;
 import org.apache.provisionr.api.util.WithOptions;
-import com.google.common.base.Objects;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import java.util.Map;
 
 public class Pool extends WithOptions {
 
@@ -115,6 +116,7 @@ public class Pool extends WithOptions {
     }
 
     @Override
+    @Generated("intellij")
     public boolean equals(Object obj) {
         if (obj == null) {
             return false;
@@ -132,6 +134,7 @@ public class Pool extends WithOptions {
     }
 
     @Override
+    @Generated("intellij")
     public String toString() {
         return "Pool{" +
             "provider=" + provider +

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/CoreConstants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/CoreConstants.java b/core/src/main/java/org/apache/provisionr/core/CoreConstants.java
index 175bcc2..8491680 100644
--- a/core/src/main/java/org/apache/provisionr/core/CoreConstants.java
+++ b/core/src/main/java/org/apache/provisionr/core/CoreConstants.java
@@ -18,7 +18,7 @@
 
 package org.apache.provisionr.core;
 
-public class CoreConstants {
+public final class CoreConstants {
 
     private CoreConstants() {
     }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/CoreProcessVariables.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/CoreProcessVariables.java b/core/src/main/java/org/apache/provisionr/core/CoreProcessVariables.java
index e27e334..6768457 100644
--- a/core/src/main/java/org/apache/provisionr/core/CoreProcessVariables.java
+++ b/core/src/main/java/org/apache/provisionr/core/CoreProcessVariables.java
@@ -18,10 +18,9 @@
 
 package org.apache.provisionr.core;
 
-public class CoreProcessVariables {
+public final class CoreProcessVariables {
 
     private CoreProcessVariables() {
-        throw new RuntimeException("Should not instantiate");
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/CoreSignals.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/CoreSignals.java b/core/src/main/java/org/apache/provisionr/core/CoreSignals.java
index dd75ed0..3280ece 100644
--- a/core/src/main/java/org/apache/provisionr/core/CoreSignals.java
+++ b/core/src/main/java/org/apache/provisionr/core/CoreSignals.java
@@ -18,7 +18,7 @@
 
 package org.apache.provisionr.core;
 
-public class CoreSignals {
+public final class CoreSignals {
 
     private CoreSignals() {
     }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/Mustache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/Mustache.java b/core/src/main/java/org/apache/provisionr/core/Mustache.java
index fef5c47..8cbade3 100644
--- a/core/src/main/java/org/apache/provisionr/core/Mustache.java
+++ b/core/src/main/java/org/apache/provisionr/core/Mustache.java
@@ -33,7 +33,7 @@ import java.util.Map;
 /**
  * Utility functions for rendering mustache templates as strings
  */
-public class Mustache {
+public final class Mustache {
 
     private Mustache() {
     }
@@ -43,9 +43,17 @@ public class Mustache {
         return toString(Resources.getResource(contextClass, resource), scopes);
     }
 
+    /**
+     * Render a Mustache template as a String
+     *
+     * @param resource url to resource
+     * @param scopes
+     * @return
+     * @throws IOException
+     */
     public static String toString(URL resource, Map<String, ?> scopes) throws IOException {
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-        Writer writer = new OutputStreamWriter(outputStream);
+        Writer writer = new OutputStreamWriter(outputStream, Charsets.UTF_8);
 
         String content = Resources.toString(resource, Charsets.UTF_8);
 
@@ -54,7 +62,7 @@ public class Mustache {
             .execute(writer, scopes);
 
         writer.close();
-        return outputStream.toString();
+        return outputStream.toString("UTF-8");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/PoolStatus.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/PoolStatus.java b/core/src/main/java/org/apache/provisionr/core/PoolStatus.java
index bd1a755..00984e2 100644
--- a/core/src/main/java/org/apache/provisionr/core/PoolStatus.java
+++ b/core/src/main/java/org/apache/provisionr/core/PoolStatus.java
@@ -21,16 +21,16 @@ package org.apache.provisionr.core;
 /**
  * A standard set of pool statuses
  */
-public class PoolStatus {
+public final class PoolStatus {
 
     private PoolStatus() {
     }
 
-    public static String UNDEFINED = "undefined";
+    public static final String UNDEFINED = "undefined";
 
-    public static String SETUP = "setup";
+    public static final String SETUP = "setup";
 
-    public static String READY = "ready";
+    public static final String READY = "ready";
 
-    public static String TERMINATED = "terminated";
+    public static final String TERMINATED = "terminated";
 }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/Ssh.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/Ssh.java b/core/src/main/java/org/apache/provisionr/core/Ssh.java
index 8cf9ee7..357c6de 100644
--- a/core/src/main/java/org/apache/provisionr/core/Ssh.java
+++ b/core/src/main/java/org/apache/provisionr/core/Ssh.java
@@ -18,10 +18,6 @@
 
 package org.apache.provisionr.core;
 
-import org.apache.provisionr.api.access.AdminAccess;
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.core.logging.ErrorStreamLogger;
-import org.apache.provisionr.core.logging.InfoStreamLogger;
 import com.google.common.base.Charsets;
 import static com.google.common.base.Preconditions.checkArgument;
 import java.io.ByteArrayInputStream;
@@ -34,12 +30,16 @@ import net.schmizz.sshj.connection.channel.direct.Session;
 import net.schmizz.sshj.transport.verification.HostKeyVerifier;
 import net.schmizz.sshj.userauth.keyprovider.OpenSSHKeyFile;
 import net.schmizz.sshj.xfer.InMemorySourceFile;
+import org.apache.provisionr.api.access.AdminAccess;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.core.logging.ErrorStreamLogger;
+import org.apache.provisionr.core.logging.InfoStreamLogger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Marker;
 import org.slf4j.MarkerFactory;
 
-public class Ssh {
+public final class Ssh {
 
     private static final Logger LOG = LoggerFactory.getLogger(Ssh.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/CheckProcessesEnded.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/CheckProcessesEnded.java b/core/src/main/java/org/apache/provisionr/core/activities/CheckProcessesEnded.java
index 5a446d4..a88df9f 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/CheckProcessesEnded.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/CheckProcessesEnded.java
@@ -49,19 +49,20 @@ public class CheckProcessesEnded implements JavaDelegate {
     }
 
     @Override
-    public void execute(DelegateExecution execution) throws Exception {
+    public void execute(DelegateExecution execution) {
         @SuppressWarnings("unchecked")
         List<String> processIds = (List<String>) execution.getVariable(variableWithProcessIds);
 
-        List<String> ended = Lists.newArrayList(Iterables.filter(processIds, new Predicate<String>() {
-            @Override
-            public boolean apply(String processInstanceId) {
-                ProcessInstance instance = runtimeService.createProcessInstanceQuery()
-                    .processInstanceId(processInstanceId).singleResult();
+        List<String> ended = Lists.newArrayList(Iterables.filter(processIds,
+            new Predicate<String>() {
+                @Override
+                public boolean apply(String processInstanceId) {
+                    ProcessInstance instance = runtimeService.createProcessInstanceQuery()
+                        .processInstanceId(processInstanceId).singleResult();
 
-                return instance == null || instance.isEnded();
-            }
-        }));
+                    return instance == null || instance.isEnded();
+                }
+            }));
 
         boolean done = (processIds.size() == ended.size());
         execution.setVariable(resultVariable, done);

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/DownloadFiles.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/DownloadFiles.java b/core/src/main/java/org/apache/provisionr/core/activities/DownloadFiles.java
index da721b3..7b45476 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/DownloadFiles.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/DownloadFiles.java
@@ -18,16 +18,18 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.api.pool.Pool;
-import org.apache.provisionr.api.software.Software;
-import org.apache.provisionr.core.Mustache;
 import com.google.common.base.Function;
+import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.api.pool.Pool;
+import org.apache.provisionr.api.software.Software;
+import org.apache.provisionr.core.Mustache;
 
 public class DownloadFiles extends PuppetActivity {
 
@@ -38,9 +40,14 @@ public class DownloadFiles extends PuppetActivity {
     }
 
     @Override
-    public String createPuppetScript(Pool pool, Machine machine) throws Exception {
-        return Mustache.toString(InstallPackages.class, FILES_TEMPLATE,
-            ImmutableMap.of("files", filesAsListOfMaps(pool.getSoftware())));
+    public String createPuppetScript(Pool pool, Machine machine) {
+        try {
+            return Mustache.toString(InstallPackages.class, FILES_TEMPLATE,
+                ImmutableMap.of("files", filesAsListOfMaps(pool.getSoftware())));
+
+        } catch (IOException e) {
+            throw Throwables.propagate(e);
+        }
     }
 
     private List<Map<String, String>> filesAsListOfMaps(Software software) {

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/InstallPackages.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/InstallPackages.java b/core/src/main/java/org/apache/provisionr/core/activities/InstallPackages.java
index c9a8667..8cf557d 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/InstallPackages.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/InstallPackages.java
@@ -18,15 +18,16 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.api.pool.Pool;
-import org.apache.provisionr.api.software.Software;
-import org.apache.provisionr.core.Mustache;
+import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.api.pool.Pool;
+import org.apache.provisionr.api.software.Software;
+import org.apache.provisionr.core.Mustache;
 
 public class InstallPackages extends PuppetActivity {
 
@@ -37,9 +38,14 @@ public class InstallPackages extends PuppetActivity {
     }
 
     @Override
-    public String createPuppetScript(Pool pool, Machine machine) throws IOException {
-        return Mustache.toString(InstallPackages.class, PACKAGES_TEMPLATE,
-            ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware())));
+    public String createPuppetScript(Pool pool, Machine machine) {
+        try {
+            return Mustache.toString(InstallPackages.class, PACKAGES_TEMPLATE,
+                ImmutableMap.of("packages", packagesAsListOfMaps(pool.getSoftware())));
+
+        } catch (IOException e) {
+            throw Throwables.propagate(e);
+        }
     }
 
     private List<Map<String, String>> packagesAsListOfMaps(Software software) {

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/InstallRepositories.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/InstallRepositories.java b/core/src/main/java/org/apache/provisionr/core/activities/InstallRepositories.java
index 072138d..473f4dd 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/InstallRepositories.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/InstallRepositories.java
@@ -18,17 +18,19 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.api.pool.Pool;
-import org.apache.provisionr.api.software.Repository;
-import org.apache.provisionr.api.software.Software;
-import org.apache.provisionr.core.Mustache;
 import com.google.common.base.Function;
 import com.google.common.base.Joiner;
+import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.api.pool.Pool;
+import org.apache.provisionr.api.software.Repository;
+import org.apache.provisionr.api.software.Software;
+import org.apache.provisionr.core.Mustache;
 
 public class InstallRepositories extends PuppetActivity {
 
@@ -40,10 +42,15 @@ public class InstallRepositories extends PuppetActivity {
     }
 
     @Override
-    public String createPuppetScript(Pool pool, Machine machine) throws Exception {
-        return Mustache.toString(getClass(), REPOSITORIES_TEMPLATE,
-            ImmutableMap.<String, List<Map<String, String>>>of(
-                "repositories", repositoriesAsListOfMaps(pool.getSoftware())));
+    public String createPuppetScript(Pool pool, Machine machine) {
+        try {
+            return Mustache.toString(getClass(), REPOSITORIES_TEMPLATE,
+                ImmutableMap.<String, List<Map<String, String>>>of(
+                    "repositories", repositoriesAsListOfMaps(pool.getSoftware())));
+
+        } catch (IOException e) {
+            throw Throwables.propagate(e);
+        }
     }
 
     private List<Map<String, String>> repositoriesAsListOfMaps(Software software) {

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/IsMachinePortOpen.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/IsMachinePortOpen.java b/core/src/main/java/org/apache/provisionr/core/activities/IsMachinePortOpen.java
index 59a13d7..1d3865f 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/IsMachinePortOpen.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/IsMachinePortOpen.java
@@ -18,7 +18,6 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.pool.Machine;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 import java.io.IOException;
@@ -26,6 +25,7 @@ import java.net.InetSocketAddress;
 import java.net.Socket;
 import org.activiti.engine.delegate.DelegateExecution;
 import org.activiti.engine.delegate.JavaDelegate;
+import org.apache.provisionr.api.pool.Machine;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -51,7 +51,7 @@ public class IsMachinePortOpen implements JavaDelegate {
     }
 
     @Override
-    public void execute(DelegateExecution execution) throws Exception {
+    public void execute(DelegateExecution execution) {
         Machine machine = (Machine) execution.getVariable(MACHINE);
         checkNotNull(machine, "expecting a process variable named machine (multi-instance?)");
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/KillMachineSetUpProcesses.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/KillMachineSetUpProcesses.java b/core/src/main/java/org/apache/provisionr/core/activities/KillMachineSetUpProcesses.java
index 2763c9d..abed671 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/KillMachineSetUpProcesses.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/KillMachineSetUpProcesses.java
@@ -19,13 +19,10 @@
 package org.apache.provisionr.core.activities;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
-
 import java.util.List;
-
 import org.activiti.engine.RuntimeService;
 import org.activiti.engine.delegate.DelegateExecution;
 import org.activiti.engine.delegate.JavaDelegate;
@@ -46,22 +43,25 @@ public class KillMachineSetUpProcesses implements JavaDelegate {
     }
 
     @Override
-    public void execute(DelegateExecution execution) throws Exception {
+    public void execute(DelegateExecution execution) {
         @SuppressWarnings("unchecked")
         List<String> processIds = (List<String>) execution.getVariable(variableWithProcessIds);
 
-        List<String> forceEnded = Lists.newArrayList(Iterables.filter(processIds, new Predicate<String>() {
-            @Override
-            public boolean apply(String processInstanceId) {
-                ProcessInstance instance = runtimeService.createProcessInstanceQuery()
-                    .processInstanceId(processInstanceId).singleResult();
-                if (instance != null && !instance.isEnded()) {
-                    runtimeService.deleteProcessInstance(processInstanceId, "Pending process needs to be killed");
-                    return true;
+        List<String> forceEnded = Lists.newArrayList(Iterables.filter(processIds,
+            new Predicate<String>() {
+                @Override
+                public boolean apply(String processInstanceId) {
+                    ProcessInstance instance = runtimeService.createProcessInstanceQuery()
+                        .processInstanceId(processInstanceId).singleResult();
+                    if (instance != null && !instance.isEnded()) {
+                        runtimeService.deleteProcessInstance(processInstanceId,
+                            "Pending process needs to be killed");
+                        return true;
+                    }
+                    return false;
                 }
-                return false;
-            }
-        }));
-        LOG.info("Killed pending machine setup processes: {}", forceEnded);
+            }));
+
+        LOG.warn("Killed pending machine setup processes: {}", forceEnded);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/PuppetActivity.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/PuppetActivity.java b/core/src/main/java/org/apache/provisionr/core/activities/PuppetActivity.java
index f072a9a..c6a8bad 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/PuppetActivity.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/PuppetActivity.java
@@ -18,11 +18,6 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.access.AdminAccess;
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.api.pool.Pool;
-import org.apache.provisionr.core.CoreProcessVariables;
-import org.apache.provisionr.core.Ssh;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.collect.ImmutableMap;
 import java.util.Map;
@@ -30,6 +25,11 @@ import net.schmizz.sshj.SSHClient;
 import net.schmizz.sshj.connection.channel.direct.Session;
 import org.activiti.engine.delegate.DelegateExecution;
 import org.activiti.engine.delegate.JavaDelegate;
+import org.apache.provisionr.api.access.AdminAccess;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.api.pool.Pool;
+import org.apache.provisionr.core.CoreProcessVariables;
+import org.apache.provisionr.core.Ssh;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,7 +62,7 @@ public abstract class PuppetActivity implements JavaDelegate {
     /**
      * This method creates a Puppet script for remote execution
      */
-    public abstract String createPuppetScript(Pool pool, Machine machine) throws Exception;
+    public abstract String createPuppetScript(Pool pool, Machine machine);
 
     /**
      * Override this method to change the credentials used for SSH access
@@ -74,7 +74,7 @@ public abstract class PuppetActivity implements JavaDelegate {
     /**
      * Map of additional files to create on the remote machine. Contains pairs of (remotePath, content)
      */
-    public Map<String, String> createAdditionalFiles(Pool pool, Machine machine) throws Exception {
+    public Map<String, String> createAdditionalFiles(Pool pool, Machine machine) {
         return ImmutableMap.of();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/activities/SpawnProcessForEachMachine.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/activities/SpawnProcessForEachMachine.java b/core/src/main/java/org/apache/provisionr/core/activities/SpawnProcessForEachMachine.java
index 84dcd30..1705f59 100644
--- a/core/src/main/java/org/apache/provisionr/core/activities/SpawnProcessForEachMachine.java
+++ b/core/src/main/java/org/apache/provisionr/core/activities/SpawnProcessForEachMachine.java
@@ -18,10 +18,6 @@
 
 package org.apache.provisionr.core.activities;
 
-import org.apache.provisionr.api.pool.Machine;
-import org.apache.provisionr.api.pool.Pool;
-import org.apache.provisionr.core.CoreConstants;
-import org.apache.provisionr.core.CoreProcessVariables;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -30,6 +26,10 @@ import org.activiti.engine.ProcessEngine;
 import org.activiti.engine.delegate.DelegateExecution;
 import org.activiti.engine.delegate.JavaDelegate;
 import org.activiti.engine.runtime.ProcessInstance;
+import org.apache.provisionr.api.pool.Machine;
+import org.apache.provisionr.api.pool.Pool;
+import org.apache.provisionr.core.CoreConstants;
+import org.apache.provisionr.core.CoreProcessVariables;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,7 +61,7 @@ public class SpawnProcessForEachMachine implements JavaDelegate {
     }
 
     @Override
-    public void execute(DelegateExecution execution) throws Exception {
+    public void execute(DelegateExecution execution) {
         final Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL);
         checkNotNull(pool, "Expecting to find a pool description as process variable");
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/logging/StreamLogger.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/logging/StreamLogger.java b/core/src/main/java/org/apache/provisionr/core/logging/StreamLogger.java
index d68066d..989ab94 100644
--- a/core/src/main/java/org/apache/provisionr/core/logging/StreamLogger.java
+++ b/core/src/main/java/org/apache/provisionr/core/logging/StreamLogger.java
@@ -18,8 +18,10 @@
 
 package org.apache.provisionr.core.logging;
 
+import com.google.common.base.Charsets;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.base.Throwables;
+import com.google.common.io.Closeables;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
@@ -54,16 +56,24 @@ public abstract class StreamLogger extends Thread {
 
     @Override
     public void run() {
-        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        BufferedReader bufferedReader = null;
+        InputStreamReader inputStreamReader = null;
         try {
+            inputStreamReader = new InputStreamReader(inputStream, Charsets.UTF_8);
+            bufferedReader = new BufferedReader(inputStreamReader);
+
             String line;
-            while ((line = reader.readLine()) != null) {
+            while ((line = bufferedReader.readLine()) != null) {
                 if (!line.isEmpty()) {
                     log(logger, marker, line);
                 }
             }
         } catch (IOException e) {
             throw Throwables.propagate(e);
+
+        } finally {
+            Closeables.closeQuietly(bufferedReader);
+            Closeables.closeQuietly(inputStreamReader);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/templates/PoolTemplateInstaller.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/templates/PoolTemplateInstaller.java b/core/src/main/java/org/apache/provisionr/core/templates/PoolTemplateInstaller.java
index a421b46..d94989f 100644
--- a/core/src/main/java/org/apache/provisionr/core/templates/PoolTemplateInstaller.java
+++ b/core/src/main/java/org/apache/provisionr/core/templates/PoolTemplateInstaller.java
@@ -18,12 +18,12 @@
 
 package org.apache.provisionr.core.templates;
 
-import org.apache.provisionr.core.templates.xml.XmlTemplate;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.collect.Maps;
 import java.io.File;
 import java.util.concurrent.ConcurrentMap;
 import org.apache.felix.fileinstall.ArtifactInstaller;
+import org.apache.provisionr.core.templates.xml.XmlTemplate;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
 import org.slf4j.Logger;
@@ -69,7 +69,7 @@ public class PoolTemplateInstaller implements ArtifactInstaller {
      * The absolute file path is the unique identifier
      */
     @Override
-    public void install(File file) throws Exception {
+    public void install(File file) {
         final String absolutePath = file.getAbsolutePath();
         LOG.info("Installing Pool template from  " + absolutePath);
 
@@ -87,7 +87,7 @@ public class PoolTemplateInstaller implements ArtifactInstaller {
      * Uninstall a pool description identified by the absolute file path
      */
     @Override
-    public void uninstall(File file) throws Exception {
+    public void uninstall(File file) {
         final String absolutePath = file.getAbsolutePath();
         LOG.info("Uninstalling Pool template for path " + absolutePath);
 
@@ -102,7 +102,7 @@ public class PoolTemplateInstaller implements ArtifactInstaller {
      * This method performs no actions if there is no pool registered for this file
      */
     @Override
-    public void update(File file) throws Exception {
+    public void update(File file) {
         if (templates.containsKey(file.getAbsolutePath())) {
             uninstall(file);
             install(file);

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/templates/xml/FileEntry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/templates/xml/FileEntry.java b/core/src/main/java/org/apache/provisionr/core/templates/xml/FileEntry.java
index 27f6788..999a889 100644
--- a/core/src/main/java/org/apache/provisionr/core/templates/xml/FileEntry.java
+++ b/core/src/main/java/org/apache/provisionr/core/templates/xml/FileEntry.java
@@ -20,6 +20,7 @@ package org.apache.provisionr.core.templates.xml;
 
 import com.google.common.annotations.VisibleForTesting;
 import static com.google.common.base.Preconditions.checkNotNull;
+import javax.annotation.Generated;
 import javax.xml.bind.annotation.XmlAttribute;
 
 /**
@@ -63,6 +64,7 @@ public class FileEntry {
     }
 
     @Override
+    @Generated("intellij")
     public boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
@@ -77,6 +79,7 @@ public class FileEntry {
     }
 
     @Override
+    @Generated("intellij")
     public int hashCode() {
         int result = source != null ? source.hashCode() : 0;
         result = 31 * result + (destination != null ? destination.hashCode() : 0);
@@ -84,6 +87,7 @@ public class FileEntry {
     }
 
     @Override
+    @Generated("intellij")
     public String toString() {
         return "FileEntry{" +
             "source='" + source + '\'' +

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/core/src/main/java/org/apache/provisionr/core/templates/xml/XmlTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/provisionr/core/templates/xml/XmlTemplate.java b/core/src/main/java/org/apache/provisionr/core/templates/xml/XmlTemplate.java
index da2bba3..4854e98 100644
--- a/core/src/main/java/org/apache/provisionr/core/templates/xml/XmlTemplate.java
+++ b/core/src/main/java/org/apache/provisionr/core/templates/xml/XmlTemplate.java
@@ -19,6 +19,7 @@
 package org.apache.provisionr.core.templates.xml;
 
 import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Charsets;
 import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.base.Throwables;
 import static com.google.common.collect.Lists.newArrayList;
@@ -26,9 +27,12 @@ import com.google.common.io.CharStreams;
 import com.google.common.io.Closeables;
 import java.io.ByteArrayInputStream;
 import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
 import java.util.List;
+import javax.annotation.Generated;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -62,7 +66,7 @@ public class XmlTemplate implements PoolTemplate {
         try {
             JAXBContext context = JAXBContext.newInstance(XmlTemplate.class);
             return (XmlTemplate) context.createUnmarshaller()
-                .unmarshal(new ByteArrayInputStream(content.getBytes()));
+                .unmarshal(new ByteArrayInputStream(content.getBytes(Charsets.UTF_8)));
 
         } catch (JAXBException e) {
             throw Throwables.propagate(e);
@@ -73,14 +77,19 @@ public class XmlTemplate implements PoolTemplate {
      * @return an XmlTemplate instance resulted from parsing a file
      */
     public static XmlTemplate newXmlTemplate(File file) {
-        FileReader reader = null;
+        Reader reader = null;
+        FileInputStream inputStream = null;
         try {
-            reader = new FileReader(file);
+            inputStream = new FileInputStream(file);
+            reader = new InputStreamReader(inputStream, Charsets.UTF_8);
+
             return newXmlTemplate(CharStreams.toString(reader));
 
         } catch (IOException e) {
             throw Throwables.propagate(e);
+
         } finally {
+            Closeables.closeQuietly(inputStream);
             Closeables.closeQuietly(reader);
         }
     }
@@ -215,6 +224,7 @@ public class XmlTemplate implements PoolTemplate {
     }
 
     @Override
+    @Generated("intellij")
     public boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
@@ -233,6 +243,7 @@ public class XmlTemplate implements PoolTemplate {
     }
 
     @Override
+    @Generated("intellij")
     public int hashCode() {
         int result = id != null ? id.hashCode() : 0;
         result = 31 * result + (description != null ? description.hashCode() : 0);
@@ -245,6 +256,7 @@ public class XmlTemplate implements PoolTemplate {
     }
 
     @Override
+    @Generated("intellij")
     public String toString() {
         return "XmlTemplate{" +
             "id='" + id + '\'' +

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Attribute.java
----------------------------------------------------------------------
diff --git a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Attribute.java b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Attribute.java
index 91c790f..fc56ed8 100644
--- a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Attribute.java
+++ b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Attribute.java
@@ -19,6 +19,7 @@
 package org.apache.provisionr.rundeck;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import javax.annotation.Generated;
 import javax.xml.bind.annotation.XmlAttribute;
 
 /**
@@ -59,6 +60,7 @@ public class Attribute {
     }
 
     @Override
+    @Generated("intellij")
     public boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
@@ -72,6 +74,7 @@ public class Attribute {
     }
 
     @Override
+    @Generated("intellij")
     public int hashCode() {
         int result = name != null ? name.hashCode() : 0;
         result = 31 * result + (value != null ? value.hashCode() : 0);
@@ -79,6 +82,7 @@ public class Attribute {
     }
 
     @Override
+    @Generated("intellij")
     public String toString() {
         return "Attribute{" +
             "name='" + name + '\'' +

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Project.java
----------------------------------------------------------------------
diff --git a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Project.java b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Project.java
index 21379e0..0b2009a 100644
--- a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Project.java
+++ b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/Project.java
@@ -22,6 +22,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.collect.Lists;
 import java.util.Collections;
 import java.util.List;
+import javax.annotation.Generated;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -56,6 +57,7 @@ public class Project {
     }
 
     @Override
+    @Generated("intellij")
     public boolean equals(Object o) {
         if (this == o) return true;
         if (o == null || getClass() != o.getClass()) return false;
@@ -67,6 +69,7 @@ public class Project {
     }
 
     @Override
+    @Generated("intellij")
     public int hashCode() {
         return nodes != null ? nodes.hashCode() : 0;
     }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/RundeckServlet.java
----------------------------------------------------------------------
diff --git a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/RundeckServlet.java b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/RundeckServlet.java
index fe65fab..3ab74e4 100644
--- a/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/RundeckServlet.java
+++ b/integration/rundeck/src/main/java/org/apache/provisionr/rundeck/RundeckServlet.java
@@ -39,13 +39,9 @@ import org.activiti.engine.runtime.ProcessInstance;
 import org.apache.provisionr.api.pool.Machine;
 import org.apache.provisionr.api.pool.Pool;
 import org.apache.provisionr.core.CoreProcessVariables;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class RundeckServlet extends HttpServlet {
 
-    private static final Logger LOG = LoggerFactory.getLogger(RundeckServlet.class);
-
     private final ProcessEngine processEngine;
     private final Marshaller marshaller;
 
@@ -57,7 +53,8 @@ public class RundeckServlet extends HttpServlet {
     }
 
     @Override
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+        throws ServletException, IOException {
         response.setContentType("application/xml;charset=UTF-8");
         writeRundeckResourceModelXmlTo(response.getWriter());
     }

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/CreateImageCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/CreateImageCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/CreateImageCommand.java
index 0d865d6..74c6e81 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/CreateImageCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/CreateImageCommand.java
@@ -41,9 +41,10 @@ public class CreateImageCommand extends CreateCommand {
 
     @Override
     protected Object doExecute() throws Exception {
-        Provisionr service = getService();
-        final Pool pool = createPoolOfOne(service);
+        // Provisionr service = getService();
+        // final Pool pool = createPoolOfOne(service);
         // TODO: create service.startCachingProcess(uuid, pool) in the Provisionr class
+
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/CreatePoolCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/CreatePoolCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/CreatePoolCommand.java
index aaf5d2b..4091066 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/CreatePoolCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/CreatePoolCommand.java
@@ -82,7 +82,7 @@ public class CreatePoolCommand extends CreateCommand {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         checkArgument(size > 0, "size should be a positive integer");
 
         Provisionr service = getService();
@@ -107,6 +107,7 @@ public class CreatePoolCommand extends CreateCommand {
             .imageId(imageId)
             .cachedImage(cachedImage)
             .createSoftware();
+
         final Hardware hardware = Hardware.builder()
             .type(hardwareType)
             .blockDevices(parseBlockDeviceOptions(blockDeviceOptions))

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/DestroyPoolCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/DestroyPoolCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/DestroyPoolCommand.java
index d068754..214adcf 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/DestroyPoolCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/DestroyPoolCommand.java
@@ -48,7 +48,7 @@ public class DestroyPoolCommand extends OsgiCommandSupport {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         checkNotNull(businessKey, "pool business key is mandatory");
 
         ProcessInstance instance = processEngine.getRuntimeService().createProcessInstanceQuery()

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/ListPoolsCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListPoolsCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListPoolsCommand.java
index 3410495..ac2ebae 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListPoolsCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListPoolsCommand.java
@@ -51,7 +51,7 @@ public class ListPoolsCommand extends OsgiCommandSupport {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         List<ProcessInstance> processes;
         if (key.isEmpty()) {
             processes = processEngine.getRuntimeService().createProcessInstanceQuery().list();

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/ListServicesCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListServicesCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListServicesCommand.java
index cbd82ef..44f9424 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListServicesCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListServicesCommand.java
@@ -18,7 +18,6 @@
 
 package org.apache.provisionr.commands;
 
-import org.apache.provisionr.api.Provisionr;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -27,6 +26,7 @@ import java.io.PrintStream;
 import java.util.List;
 import org.apache.felix.gogo.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.provisionr.api.Provisionr;
 
 @Command(scope = "provisionr", name = "services", description = "List provisioning services")
 public class ListServicesCommand extends OsgiCommandSupport {
@@ -40,7 +40,7 @@ public class ListServicesCommand extends OsgiCommandSupport {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         List<String> ids = Lists.newArrayList();
         for (Provisionr service : services) {
             ids.add(service.getId());

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/ListTemplatesCommand.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListTemplatesCommand.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListTemplatesCommand.java
index 8cc81d1..c97150c 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/ListTemplatesCommand.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/ListTemplatesCommand.java
@@ -18,13 +18,13 @@
 
 package org.apache.provisionr.commands;
 
-import org.apache.provisionr.core.templates.PoolTemplate;
 import com.google.common.annotations.VisibleForTesting;
 import static com.google.common.base.Preconditions.checkNotNull;
 import java.io.PrintStream;
 import java.util.List;
 import org.apache.felix.gogo.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.provisionr.core.templates.PoolTemplate;
 
 /**
  * List pre-configured templates that can be used to create clusters on different providers
@@ -41,9 +41,9 @@ public class ListTemplatesCommand extends OsgiCommandSupport {
     }
 
     @Override
-    protected Object doExecute() throws Exception {
+    protected Object doExecute() {
         for (PoolTemplate template : templates) {
-            out.printf("- %s\n\t%s\n", template.getId(), template.getDescription());
+            out.printf("- %s%n\t%s%n", template.getId(), template.getDescription());
         }
 
         return null;

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/karaf/commands/src/main/java/org/apache/provisionr/commands/predicates/ProvisionrPredicates.java
----------------------------------------------------------------------
diff --git a/karaf/commands/src/main/java/org/apache/provisionr/commands/predicates/ProvisionrPredicates.java b/karaf/commands/src/main/java/org/apache/provisionr/commands/predicates/ProvisionrPredicates.java
index 72a0b47..d705706 100644
--- a/karaf/commands/src/main/java/org/apache/provisionr/commands/predicates/ProvisionrPredicates.java
+++ b/karaf/commands/src/main/java/org/apache/provisionr/commands/predicates/ProvisionrPredicates.java
@@ -18,10 +18,10 @@
 
 package org.apache.provisionr.commands.predicates;
 
-import org.apache.provisionr.api.Provisionr;
 import com.google.common.base.Predicate;
+import org.apache.provisionr.api.Provisionr;
 
-public class ProvisionrPredicates {
+public final class ProvisionrPredicates {
 
     private ProvisionrPredicates() {
     }
@@ -31,7 +31,7 @@ public class ProvisionrPredicates {
 
             @Override
             public boolean apply(Provisionr candidate) {
-                return candidate.getId().equals(id);
+                return candidate != null && candidate.getId().equals(id);
             }
 
             @Override

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/providers/amazon/src/main/java/org/apache/provisionr/amazon/ProcessVariables.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/org/apache/provisionr/amazon/ProcessVariables.java b/providers/amazon/src/main/java/org/apache/provisionr/amazon/ProcessVariables.java
index dd7fa76..1817218 100644
--- a/providers/amazon/src/main/java/org/apache/provisionr/amazon/ProcessVariables.java
+++ b/providers/amazon/src/main/java/org/apache/provisionr/amazon/ProcessVariables.java
@@ -18,7 +18,7 @@
 
 package org.apache.provisionr.amazon;
 
-public class ProcessVariables {
+public final class ProcessVariables {
 
     private ProcessVariables() {
         /* singleton */
@@ -40,7 +40,7 @@ public class ProcessVariables {
      * The amount the user is willing to pay for spot instances in the
      * Amazon pool he's trying to start. If set, the request is for spot
      * instances, if null the request is for on demand instances.
-     * 
+     *
      * @see org.apache.provisionr.amazon.activities.RunSpotInstances
      */
     public static final String SPOT_BID = "spotBid";
@@ -50,30 +50,30 @@ public class ProcessVariables {
      * for the first time. Because the describe call is not consistent
      * until a reasonable delay passes, this will be used to timeout the
      * Activiti retries so that the requests are not resent if they were
-     * successful. 
-     * 
+     * successful.
+     *
      * @see org.apache.provisionr.amazon.activities.RunSpotInstances
      */
     public static final String SPOT_REQUESTS_SENT = "spotRequestsSent";
 
     /**
-     * List of request IDs as returned by Amazon for spot instances. These need to 
+     * List of request IDs as returned by Amazon for spot instances. These need to
      * be followed up to get the actual instance IDs.
-     * 
+     *
      * @see org.apache.provisionr.amazon.activities.RunSpotInstances
      */
     public static final String SPOT_INSTANCE_REQUEST_IDS = "spotInstanceRequestIds";
 
     /**
      * Have all spot instance requests been handled by Amazon? (none are pending)
-     * 
-     *  @see org.apache.provisionr.amazon.activities.CheckNoRequestsAreOpen
+     *
+     * @see org.apache.provisionr.amazon.activities.CheckNoRequestsAreOpen
      */
     public static final String NO_SPOT_INSTANCE_REQUESTS_OPEN = "noSpotInstanceRequestsOpen";
 
     /**
      * Are all spot instance requests in an active state? (none cancelled, none terminated)
-     * 
+     *
      * @see org.apache.provisionr.amazon.activities.CheckAllRequestsAreActive
      */
     public static final String ALL_SPOT_INSTANCE_REQUESTS_ACTIVE = "allSpotInstanceRequestsActive";
@@ -87,10 +87,10 @@ public class ProcessVariables {
 
     /**
      * List of requested EBS volume IDs
-     * 
+     *
      * @see org.apache.provisionr.amazon.activities.CreateEBSVolumes
      */
-    public static final String VOLUME_IDS = "volumeIds"; 
+    public static final String VOLUME_IDS = "volumeIds";
 
     /**
      * Are all started instances running?

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllInstancesMatchPredicate.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllInstancesMatchPredicate.java b/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllInstancesMatchPredicate.java
index 30f20fc..95d2fe4 100644
--- a/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllInstancesMatchPredicate.java
+++ b/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllInstancesMatchPredicate.java
@@ -18,24 +18,21 @@
 
 package org.apache.provisionr.amazon.activities;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import com.amazonaws.AmazonServiceException;
 import com.amazonaws.services.ec2.AmazonEC2;
 import com.amazonaws.services.ec2.model.DescribeInstancesRequest;
 import com.amazonaws.services.ec2.model.DescribeInstancesResult;
 import com.amazonaws.services.ec2.model.Instance;
-import org.apache.provisionr.amazon.ProcessVariables;
-import org.apache.provisionr.amazon.core.ProviderClientCache;
-import org.apache.provisionr.api.pool.Pool;
 import com.google.common.base.Optional;
+import static com.google.common.base.Preconditions.checkNotNull;
 import com.google.common.base.Predicate;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Iterables;
-
 import java.util.List;
-
 import org.activiti.engine.delegate.DelegateExecution;
+import org.apache.provisionr.amazon.ProcessVariables;
+import org.apache.provisionr.amazon.core.ProviderClientCache;
+import org.apache.provisionr.api.pool.Pool;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -54,9 +51,9 @@ public abstract class AllInstancesMatchPredicate extends AmazonActivity {
     }
 
     @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
+    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
         @SuppressWarnings("unchecked")
-        Optional<List<String>> instanceIds = 
+        Optional<List<String>> instanceIds =
             Optional.fromNullable((List<String>) execution.getVariable(ProcessVariables.INSTANCE_IDS));
 
         if (!instanceIds.isPresent()) {

http://git-wip-us.apache.org/repos/asf/incubator-provisionr/blob/e896d1ca/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
----------------------------------------------------------------------
diff --git a/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java b/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
index 20397d6..361ade2 100644
--- a/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
+++ b/providers/amazon/src/main/java/org/apache/provisionr/amazon/activities/AllSpotRequestsMatchPredicate.java
@@ -18,40 +18,37 @@
 
 package org.apache.provisionr.amazon.activities;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.activiti.engine.delegate.DelegateExecution;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import com.amazonaws.services.ec2.AmazonEC2;
 import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsRequest;
 import com.amazonaws.services.ec2.model.DescribeSpotInstanceRequestsResult;
 import com.amazonaws.services.ec2.model.SpotInstanceRequest;
+import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import java.util.List;
+import org.activiti.engine.delegate.DelegateExecution;
 import org.apache.provisionr.amazon.ProcessVariables;
 import org.apache.provisionr.amazon.core.ProviderClientCache;
 import org.apache.provisionr.api.pool.Pool;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class AllSpotRequestsMatchPredicate extends AmazonActivity {
 
     private static final Logger LOG = LoggerFactory.getLogger(AllSpotRequestsMatchPredicate.class);
 
-    protected final String resultVariable;
+    private final String resultVariable;
     private final Predicate<SpotInstanceRequest> predicate;
 
-    protected AllSpotRequestsMatchPredicate(ProviderClientCache cache, String resultVariable, 
-            Predicate<SpotInstanceRequest> predicate) {
+    protected AllSpotRequestsMatchPredicate(ProviderClientCache cache, String resultVariable,
+                                            Predicate<SpotInstanceRequest> predicate) {
         super(cache);
         this.resultVariable = checkNotNull(resultVariable, "resultVariable is null");
         this.predicate = checkNotNull(predicate, "predicate is null");
     }
 
     @Override
-    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
+    public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) {
 
         LOG.info(">> Checking if all spot requests match predicate {}", predicate);
 


Mime
View raw message