incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1215271 - in /incubator/lcf/branches/release-0.4-incubating-branch: ./ CHANGES.txt framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java
Date Fri, 16 Dec 2011 20:57:24 GMT
Author: kwright
Date: Fri Dec 16 20:57:24 2011
New Revision: 1215271

URL: http://svn.apache.org/viewvc?rev=1215271&view=rev
Log:
Pull up fix for CONNECTORS-319.

Modified:
    incubator/lcf/branches/release-0.4-incubating-branch/   (props changed)
    incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt
    incubator/lcf/branches/release-0.4-incubating-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java

Propchange: incubator/lcf/branches/release-0.4-incubating-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 16 20:57:24 2011
@@ -14,4 +14,4 @@
 /incubator/lcf/branches/CONNECTORS-290:1204836-1205502
 /incubator/lcf/branches/CONNECTORS-313:1213173-1214848
 /incubator/lcf/branches/CONNECTORS-32:1092556-1094216
-/incubator/lcf/trunk:1214045,1214707,1214850,1214893,1215025,1215091,1215096,1215099
+/incubator/lcf/trunk:1214045,1214707,1214850,1214893,1215025,1215091,1215096,1215099,1215269

Modified: incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt?rev=1215271&r1=1215270&r2=1215271&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt (original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt Fri Dec 16 20:57:24 2011
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 0.4-dev =====================
 
+CONNECTORS-319: Added a shutdown hook to the AgentRun command,
+so that if you ^C out of it you can rerun.
+(Karl Wright)
+
 CONNECTORS-325: Adeguate the content identifier with the Alfresco node reference
 (Piergiorgio Lucidi)
 

Modified: incubator/lcf/branches/release-0.4-incubating-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java?rev=1215271&r1=1215270&r2=1215271&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/AgentRun.java
Fri Dec 16 20:57:24 2011
@@ -44,6 +44,9 @@ public class AgentRun extends BaseAgents
       System.err.println("Agent already in use");
       System.exit(1);
     }
+    
+    ManifoldCF.addShutdownHook(new AgentRunShutdownRunner());
+    
     // Set the agents in use signal.
     lockManager.setGlobalFlag(agentInUseSignal);    
     try
@@ -105,4 +108,21 @@ public class AgentRun extends BaseAgents
       System.exit(1);
     }
   }
+  
+  protected static class AgentRunShutdownRunner implements IShutdownHook
+  {
+    public AgentRunShutdownRunner()
+    {
+    }
+    
+    public void doCleanup()
+      throws ManifoldCFException
+    {
+      IThreadContext tc = ThreadContextFactory.make();
+      ILockManager lockManager = LockManagerFactory.make(tc);
+      lockManager.clearGlobalFlag(agentInUseSignal);
+    }
+    
+  }
+  
 }



Mime
View raw message