geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r400194 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/ org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/ org.apache.geronimo.st.v11.core/src/org/apache/ger...
Date Fri, 05 May 2006 22:13:53 GMT
Author: sppatel
Date: Fri May  5 15:13:50 2006
New Revision: 400194

URL: http://svn.apache.org/viewcvs?rev=400194&view=rev
Log:
fix cnf exceptions under 1.5

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java?rev=400194&r1=400193&r2=400194&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GenericGeronimoServerBehaviour.java
Fri May  5 15:13:50 2006
@@ -99,9 +99,12 @@
 		Trace.trace(Trace.INFO, "<< publishModule()");
 	}
 
-	protected void invokeCommand(int deltaKind, IModule module)
-			throws CoreException {
+	protected void invokeCommand(int deltaKind, IModule module) throws CoreException {
+		ClassLoader old = Thread.currentThread().getContextClassLoader();
 		try {
+			ClassLoader cl = getContextClassLoader();
+			if(cl != null)
+				Thread.currentThread().setContextClassLoader(cl);
 			switch (deltaKind) {
 			case ADDED: {
 				doDeploy(module);
@@ -122,6 +125,8 @@
 			throw e;
 		} catch (Exception e) {
 			e.printStackTrace();
+		} finally {
+			Thread.currentThread().setContextClassLoader(old);
 		}
 	}
 
@@ -358,4 +363,6 @@
 	public void dispose() {
 		stopUpdateServerStateTask();
 	}
+	
+	abstract protected ClassLoader getContextClassLoader();
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java?rev=400194&r1=400193&r2=400194&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
Fri May  5 15:13:50 2006
@@ -21,11 +21,14 @@
 
 public class PingThread extends Thread {
 
-	private static final int PING_DELAY = 5000;
+	private static final int PING_DELAY = 10000;
+
 	private static final int PING_INTERVAL = 5000;
+
 	private static final int MAX_PINGS = 40;
 
 	private IGeronimoServerBehavior geronimoServer;
+
 	private IServer server;
 
 	public PingThread(IGeronimoServerBehavior geronimoServer, IServer server) {
@@ -54,13 +57,20 @@
 
 		for (int tries = MAX_PINGS; tries > 0; tries--) {
 
-			if (geronimoServer.isFullyStarted()) {
-				Trace.trace(Trace.INFO, "Ping: success");
-				geronimoServer.setServerStarted();
-				return;
+			ClassLoader old = Thread.currentThread().getContextClassLoader();
+			try {
+				ClassLoader cl = ((GenericGeronimoServerBehaviour) geronimoServer).getContextClassLoader();
+				Thread.currentThread().setContextClassLoader(cl);
+				if (geronimoServer.isFullyStarted()) {
+					Trace.trace(Trace.INFO, "Ping: success");
+					geronimoServer.setServerStarted();
+					return;
+				}
+			} finally {
+				Thread.currentThread().setContextClassLoader(old);
 			}
 
-			Trace.trace(Trace.INFO, "Ping: failed");
+			Trace.trace(Trace.INFO, "Ping: fail");
 
 			try {
 				sleep(PING_INTERVAL);

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java?rev=400194&r1=400193&r2=400194&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
Fri May  5 15:13:50 2006
@@ -67,7 +67,7 @@
 	}
 
 	private void updateFromStopped() {
-		if (delegate.isFullyStarted()) {
+		if (isFullyStarted()) {
 			delegate.setServerStarted();
 		} else {
 			((Server) server).setServerState(IServer.STATE_STARTING);
@@ -75,12 +75,22 @@
 	}
 
 	private void updateFromStarting() {
-		if (delegate.isFullyStarted())
+		if (isFullyStarted())
 			delegate.setServerStopped();
 	}
 
 	private void updateFromStarted() {
-		if (!delegate.isFullyStarted())
+		if (!isFullyStarted())
 			delegate.setServerStopped();
+	}
+	
+	private boolean isFullyStarted() {
+		ClassLoader old = Thread.currentThread().getContextClassLoader();
+		try {
+			Thread.currentThread().setContextClassLoader(((GenericGeronimoServerBehaviour) delegate).getContextClassLoader());
+			return delegate.isFullyStarted();
+		} finally {
+			Thread.currentThread().setContextClassLoader(old);
+		}
 	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java?rev=400194&r1=400193&r2=400194&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v1.core/src/org/apache/geronimo/st/v1/core/GeronimoServerBehaviour.java
Fri May  5 15:13:50 2006
@@ -188,4 +188,11 @@
 		}
 		return path;
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServerBehaviour#getContextClassLoader()
+	 */
+	protected ClassLoader getContextClassLoader() {
+		return Kernel.class.getClassLoader();
+	}
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java?rev=400194&r1=400193&r2=400194&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/org/apache/geronimo/st/v11/core/GeronimoServerBehaviour.java
Fri May  5 15:13:50 2006
@@ -202,4 +202,11 @@
 		}
 		return null;
 	}
+	
+	/* (non-Javadoc)
+	 * @see org.apache.geronimo.st.core.GenericGeronimoServerBehaviour#getContextClassLoader()
+	 */
+	protected ClassLoader getContextClassLoader() {
+		return Kernel.class.getClassLoader();
+	}
 }



Mime
View raw message