cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dar...@apache.org
Subject [5/8] git commit: updated refs/heads/managed-context to 7cac1bd
Date Mon, 30 Sep 2013 23:13:53 GMT
More runnables


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/37b80d29
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/37b80d29
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/37b80d29

Branch: refs/heads/managed-context
Commit: 37b80d2964a6b811be2f7c766fe40bd44dc7e38e
Parents: 6b58518
Author: Darren Shepherd <darren.s.shepherd@gmail.com>
Authored: Mon Sep 30 10:30:51 2013 -0700
Committer: Darren Shepherd <darren.s.shepherd@gmail.com>
Committed: Mon Sep 30 10:30:51 2013 -0700

----------------------------------------------------------------------
 .../apache/cloudstack/storage/LocalHostEndpoint.java   | 13 ++++++-------
 .../apache/cloudstack/storage/RemoteHostEndPoint.java  |  5 +++--
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37b80d29/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
index 83d34a0..53803bf 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/LocalHostEndpoint.java
@@ -21,24 +21,23 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
-import com.cloud.configuration.Config;
-import com.cloud.utils.component.ComponentContext;
+import javax.inject.Inject;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl;
+import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.storage.command.CopyCommand;
 import org.apache.cloudstack.storage.command.DownloadCommand;
 import org.apache.cloudstack.storage.resource.LocalNfsSecondaryStorageResource;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
+import com.cloud.configuration.Config;
 import com.cloud.resource.ServerResource;
+import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.net.NetUtils;
 
-import javax.inject.Inject;
-
 public class LocalHostEndpoint implements EndPoint {
     private ScheduledExecutorService executor;
     protected ServerResource resource;
@@ -97,7 +96,7 @@ public class LocalHostEndpoint implements EndPoint {
         return new Answer(cmd, false, "unsupported command:" + cmd.toString());
     }
 
-    private class CmdRunner implements Runnable {
+    private class CmdRunner extends ManagedContextRunnable {
         final Command cmd;
         final AsyncCompletionCallback<Answer> callback;
 
@@ -107,7 +106,7 @@ public class LocalHostEndpoint implements EndPoint {
         }
 
         @Override
-        public void run() {
+        protected void runInContext() {
             Answer answer = sendMessage(cmd);
             callback.complete(answer);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/37b80d29/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
index 3693813..3cae2b9 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/RemoteHostEndPoint.java
@@ -26,6 +26,7 @@ import javax.inject.Inject;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
+import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
@@ -104,7 +105,7 @@ public class RemoteHostEndPoint implements EndPoint {
         throw new CloudRuntimeException("Failed to send command, due to Agent:" + getId()
+ ", " + errMsg);
     }
 
-    private class CmdRunner implements Listener, Runnable {
+    private class CmdRunner extends ManagedContextRunnable implements Listener {
         final AsyncCompletionCallback<Answer> callback;
         Answer answer;
 
@@ -162,7 +163,7 @@ public class RemoteHostEndPoint implements EndPoint {
         }
 
         @Override
-        public void run() {
+        protected void runInContext() {
             callback.complete(answer);
         }
     }


Mime
View raw message