geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r937110 - in /geronimo/yoko/trunk: ./ yoko-core/ yoko-core/src/test/java/org/apache/yoko/processmanager/ yoko-core/src/test/java/org/apache/yoko/processmanager/internal/
Date Fri, 23 Apr 2010 00:03:09 GMT
Author: djencks
Date: Fri Apr 23 00:03:09 2010
New Revision: 937110

URL: http://svn.apache.org/viewvc?rev=937110&view=rev
Log:
build cleanup, in particular use java 5 concurrent

Modified:
    geronimo/yoko/trunk/pom.xml
    geronimo/yoko/trunk/yoko-core/pom.xml
    geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java
    geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java
    geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java

Modified: geronimo/yoko/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/pom.xml?rev=937110&r1=937109&r2=937110&view=diff
==============================================================================
--- geronimo/yoko/trunk/pom.xml (original)
+++ geronimo/yoko/trunk/pom.xml Fri Apr 23 00:03:09 2010
@@ -42,24 +42,15 @@
         <!-- versions of external dependencies -->
         <ant.version>1.6.5</ant.version>
         <antrun.version>1.1</antrun.version>
-        <antlr.version>2.7.5</antlr.version>
+        <!--<antlr.version>2.7.5</antlr.version>-->
         <bcel.version>5.2</bcel.version>
-        <concurrent.version>1.3.4</concurrent.version>
         <junit.version>4.5</junit.version>
-        <maven.version>2.2.1</maven.version>
-        <compiler.version>2.0.2</compiler.version>
-        <eclipse.version>2.3</eclipse.version>
-        <javadoc.version>2.2</javadoc.version>
-        <jar.version>2.1</jar.version>
-        <java.source.version>1.5</java.source.version>
         <compile.flags>-Xlint:unchecked,deprecation,fallthrough,finally</compile.flags>
         <java.endorsed.dirs>${basedir}/target/classes</java.endorsed.dirs>
         <site.version>2.0-beta-4</site.version>
         <compile.forked>false</compile.forked>
-        <compile.flags>-Xlint:unchecked,deprecation,fallthrough,finally</compile.flags>
-        <no.checkstyle>false</no.checkstyle>
-        <no.pmd>false</no.pmd>
-        <notice.dir>.</notice.dir>
+        <!--<no.checkstyle>false</no.checkstyle>-->
+        <!--<no.pmd>false</no.pmd>-->
     </properties>
 
     <modelVersion>4.0.0</modelVersion>
@@ -127,16 +118,16 @@
                 <artifactId>org.apache.servicemix.bundles.bcel</artifactId>
                 <version>5.2_2</version>
             </dependency>
-            <dependency>
-                <groupId>org.apache.maven</groupId>
-                <artifactId>maven-plugin-api</artifactId>
-                <version>${maven.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.maven</groupId>
-                <artifactId>maven-project</artifactId>
-                <version>${maven.version}</version>
-            </dependency>
+            <!--<dependency>-->
+                <!--<groupId>org.apache.maven</groupId>-->
+                <!--<artifactId>maven-plugin-api</artifactId>-->
+                <!--<version>${maven.version}</version>-->
+            <!--</dependency>-->
+            <!--<dependency>-->
+                <!--<groupId>org.apache.maven</groupId>-->
+                <!--<artifactId>maven-project</artifactId>-->
+                <!--<version>${maven.version}</version>-->
+            <!--</dependency>-->
             <dependency>
                 <groupId>ant</groupId>
                 <artifactId>ant</artifactId>
@@ -147,12 +138,6 @@
                 <artifactId>ant-nodeps</artifactId>
                 <version>${ant.version}</version>
             </dependency>
-            <dependency>
-                <groupId>concurrent</groupId>
-                <artifactId>concurrent</artifactId>
-                <version>${concurrent.version}</version>
-                <scope>test</scope>
-            </dependency>
         </dependencies>
     </dependencyManagement>
 

Modified: geronimo/yoko/trunk/yoko-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/pom.xml?rev=937110&r1=937109&r2=937110&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/pom.xml (original)
+++ geronimo/yoko/trunk/yoko-core/pom.xml Fri Apr 23 00:03:09 2010
@@ -49,11 +49,6 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>concurrent</groupId>
-            <artifactId>concurrent</artifactId>
-            <scope>test</scope>
-        </dependency>
 
     </dependencies>
 

Modified: geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java?rev=937110&r1=937109&r2=937110&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java
(original)
+++ geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/JavaProcess.java
Fri Apr 23 00:03:09 2010
@@ -23,13 +23,12 @@ import java.lang.reflect.InvocationTarge
 import java.rmi.RemoteException;
 import java.rmi.registry.Registry;
 import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
 
 import org.apache.yoko.processmanager.internal.ProcessAgent;
 import org.apache.yoko.processmanager.internal.ProcessAgentImpl;
 import org.apache.yoko.processmanager.internal.Util;
 
-import EDU.oswego.cs.dl.util.concurrent.CountDown;
-
 public class JavaProcess {
 
 	private String name;
@@ -37,8 +36,8 @@ public class JavaProcess {
 	private ProcessAgent processAgent;
 	private ProcessManager manager;
 
-	CountDown processExited = new CountDown(1);
-	CountDown processStarted = new CountDown(1);
+	CountDownLatch processExited = new CountDownLatch(1);
+	CountDownLatch processStarted = new CountDownLatch(1);
 
 	public JavaProcess(String name, ProcessManager manager) {
 		this.name = name;
@@ -144,7 +143,7 @@ public class JavaProcess {
 		result = processAgent.invokeStatic(className, method, args);
 		}
 		catch(RemoteException e) {
-			if(processExited.currentCount() != 0) {
+			if(processExited.getCount() != 0) {
                 e.printStackTrace();
 				throw new Error(e);
 			}
@@ -180,7 +179,7 @@ public class JavaProcess {
 			//throw new Error(e);
 		}
 		try {
-			processExited.acquire();
+			processExited.await();
 		} catch (InterruptedException e) {
 			throw new Error(e);
 		}
@@ -188,7 +187,7 @@ public class JavaProcess {
 
 	private void waitForProcessStartup(int maxWaitMillis) {
 		try {
-			processStarted.acquire();
+			processStarted.await();
 		} catch (InterruptedException e) {
 			throw new Error(e);
 		}

Modified: geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java?rev=937110&r1=937109&r2=937110&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java
(original)
+++ geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/ProcessManager.java
Fri Apr 23 00:03:09 2010
@@ -63,7 +63,7 @@ public class ProcessManager extends Unic
 		}
 		else {
 			process.setAgent(agent);
-			process.processStarted.release();
+			process.processStarted.countDown();
 		}
 	}
 	
@@ -76,7 +76,7 @@ public class ProcessManager extends Unic
 		}
 		else {
 			process.setAgent(agent);
-			process.processExited.release();
+			process.processExited.countDown();
 		}
 	}
 	

Modified: geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java
URL: http://svn.apache.org/viewvc/geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java?rev=937110&r1=937109&r2=937110&view=diff
==============================================================================
--- geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java
(original)
+++ geronimo/yoko/trunk/yoko-core/src/test/java/org/apache/yoko/processmanager/internal/ProcessAgentImpl.java
Fri Apr 23 00:03:09 2010
@@ -24,8 +24,9 @@ import java.rmi.RemoteException;
 import java.rmi.registry.LocateRegistry;
 import java.rmi.registry.Registry;
 import java.rmi.server.UnicastRemoteObject;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
-import EDU.oswego.cs.dl.util.concurrent.CountDown;
 import org.apache.yoko.osgi.ProviderLocator;
 
 public class ProcessAgentImpl extends UnicastRemoteObject implements ProcessAgent {
@@ -36,7 +37,7 @@ public class ProcessAgentImpl extends Un
         super();
     }
 
-    private CountDown shutdownCountDown = new CountDown(1);
+    private CountDownLatch shutdownCountDown = new CountDownLatch(1);
     private boolean agentExited = false;
     private boolean exitedFromParent = false;
     private int exitCode = 0;
@@ -67,7 +68,7 @@ public class ProcessAgentImpl extends Un
 
         agent.shutdownHook = new Thread(new Runnable() {
                 public void run() {
-                    agent.shutdownCountDown.release();
+                    agent.shutdownCountDown.countDown();
                     try {
                         agent.mainThread.join();
                     } catch (InterruptedException e) {
@@ -104,7 +105,7 @@ public class ProcessAgentImpl extends Un
     private void waitForShutdown() {
         try {
             while(true) {
-                if(shutdownCountDown.attempt(1000)) {
+                if(shutdownCountDown.await(1000, TimeUnit.MILLISECONDS)) {
                     break;
                 }
                 // Throws RemoteException if processManager is gone.
@@ -134,7 +135,7 @@ public class ProcessAgentImpl extends Un
     public void exit(int exitCode) throws RemoteException {
         this.exitedFromParent = true;
         this.exitCode = exitCode;
-        shutdownCountDown.release();
+        shutdownCountDown.countDown();
     }
 
     public Object invokeStatic(String className, String methodName, Object[] args) {



Mime
View raw message