geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r375073 - /geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
Date Sun, 05 Feb 2006 18:36:00 GMT
Author: sppatel
Date: Sun Feb  5 10:35:58 2006
New Revision: 375073

URL: http://svn.apache.org/viewcvs?rev=375073&view=rev
Log:
catch securityexception

Modified:
    geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java

Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java?rev=375073&r1=375072&r2=375073&view=diff
==============================================================================
--- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
(original)
+++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.devtools.eclipse.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
Sun Feb  5 10:35:58 2006
@@ -72,6 +72,7 @@
 	private Kernel kernel = null;
 
 	private Timer timer = null;
+	PingThread pingThread;
 
 	public GeronimoServerBehaviour() {
 		super();
@@ -88,7 +89,7 @@
 
 		if (getServer().getServerState() != IServer.STATE_STOPPED) {
 			setServerState(IServer.STATE_STOPPING);
-			if (getKernel() != null) {
+			if (kernel != null) {
 				kernel.shutdown();
 			}
 		}
@@ -116,7 +117,7 @@
 
 	}
 
-	private Kernel getKernel() {
+	private Kernel getKernel() throws SecurityException {
 
 		if (kernel == null) {
 			Map map = new HashMap();
@@ -135,6 +136,8 @@
 							.getMBeanServerConnection();
 					kernel = new KernelDelegate(mbServerConnection);
 					Trace.trace(Trace.INFO, "Connected to kernel.");
+				} catch (SecurityException e) {
+					throw e;
 				} catch (Exception e) {
 					Trace.trace(Trace.WARNING, "Kernel connection failed.");
 				}
@@ -153,6 +156,13 @@
 	protected boolean isKernelAlive() {
 		try {
 			return getKernel() != null && kernel.isRunning();
+		} catch (SecurityException e) {
+			GeronimoPlugin.log(Status.ERROR,
+					"Invalid username and/or password.", e);
+			pingThread.interrupt();
+			if (getServer().getServerState() != IServer.STATE_STOPPED) {
+				stop(true);
+			}
 		} catch (Exception e) {
 			GeronimoPlugin
 					.log(
@@ -431,7 +441,7 @@
 
 		getServer().addServerListener(listener);
 
-		PingThread pingThread = new PingThread(this);
+		pingThread = new PingThread(this);
 		pingThread.start();
 
 		Trace.trace(Trace.INFO, "<-- GeronimoServerBehavior.setupLaunch()");



Mime
View raw message