curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [1/8] git commit: more work on CLI
Date Wed, 28 May 2014 17:33:51 GMT
Repository: curator
Updated Branches:
  refs/heads/curator-rpc f261b0cfd -> 598ad996c


more work on CLI


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

Branch: refs/heads/curator-rpc
Commit: e11db6dfcfd719e0912fbe1c2ab211ceffcb23c4
Parents: f261b0c
Author: randgalt <randgalt@apache.org>
Authored: Tue May 27 17:45:47 2014 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Tue May 27 17:45:47 2014 -0500

----------------------------------------------------------------------
 .../apache/curator/x/rpc/CuratorProjectionServer.java    | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/e11db6df/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
----------------------------------------------------------------------
diff --git a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
index f5e49f4..d91a52d 100644
--- a/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
+++ b/curator-x-rpc/src/main/java/org/apache/curator/x/rpc/CuratorProjectionServer.java
@@ -32,6 +32,8 @@ import io.airlift.units.DataSize;
 import io.airlift.units.Duration;
 import org.apache.curator.x.rpc.idl.event.EventService;
 import org.apache.curator.x.rpc.idl.projection.CuratorProjectionService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import java.io.File;
 import java.io.IOException;
 import java.util.Map;
@@ -40,9 +42,11 @@ import java.util.concurrent.atomic.AtomicReference;
 
 public class CuratorProjectionServer
 {
+    private final Logger log = LoggerFactory.getLogger(getClass());
     private final RpcManager rpcManager;
     private final ThriftServer server;
     private final AtomicReference<State> state = new AtomicReference<State>(State.LATENT);
+    private final Configuration configuration;
 
     private enum State
     {
@@ -91,6 +95,7 @@ public class CuratorProjectionServer
 
     public CuratorProjectionServer(Configuration configuration)
     {
+        this.configuration = configuration;
         rpcManager = new RpcManager(configuration.getProjectionExpiration().toMillis());
         EventService eventService = new EventService(rpcManager, configuration.getPingTime().toMillis());
         CuratorProjectionService projectionService = new CuratorProjectionService(rpcManager);
@@ -103,14 +108,20 @@ public class CuratorProjectionServer
         Preconditions.checkState(state.compareAndSet(State.LATENT, State.STARTED), "Already
started");
 
         server.start();
+
+        log.info("Server listening on port: " + configuration.getPort());
     }
 
     public void stop()
     {
         if ( state.compareAndSet(State.STARTED, State.STOPPED) )
         {
+            log.info("Stopping...");
+
             rpcManager.close();
             server.close();
+
+            log.info("Stopped");
         }
     }
 


Mime
View raw message