geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r676108 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core: Activator.java GeronimoServerBehaviourDelegate.java
Date Sat, 12 Jul 2008 01:09:22 GMT
Author: mcconne
Date: Fri Jul 11 18:09:21 2008
New Revision: 676108

URL: http://svn.apache.org/viewvc?rev=676108&view=rev
Log:
GERONIMODEVTOOLS-349 GEP and Server synchronization fix -- Thanks Ashish Jain for this patch
!!

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/Activator.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/Activator.java?rev=676108&r1=676107&r2=676108&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/Activator.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/Activator.java
Fri Jul 11 18:09:21 2008
@@ -19,6 +19,7 @@
 import org.eclipse.core.runtime.Plugin;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
 import org.eclipse.wst.server.core.ServerCore;
 import org.osgi.framework.BundleContext;
 
@@ -49,6 +50,32 @@
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
+		ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
+			public void serverAdded(IServer server) {
+				triggerStartUpdateServerTask(server);
+			}
+
+			public void serverChanged(IServer server) {
+				
+			}
+
+			public void serverRemoved(IServer server) {
+			}
+		});
+		IServer[] servers = ServerCore.getServers();
+		for(int i = 0; i < servers.length; i++) {
+			triggerStartUpdateServerTask(servers[i]);
+		}
+	}
+
+	private void triggerStartUpdateServerTask(IServer server) {
+		GeronimoServerBehaviourDelegate delegate = (GeronimoServerBehaviourDelegate) server.getAdapter(GeronimoServerBehaviourDelegate.class);
+		if (delegate == null) {
+			delegate = (GeronimoServerBehaviourDelegate) server.loadAdapter(GeronimoServerBehaviourDelegate.class,
null);
+		}
+		if (delegate != null) {
+			delegate.startUpdateServerStateTask();
+		}
 	}
 
 	/*

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?rev=676108&r1=676107&r2=676108&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Fri Jul 11 18:09:21 2008
@@ -321,9 +321,6 @@
 	 */
 	protected void initialize(IProgressMonitor monitor) {
         Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.initialize", monitor);
-
-		startUpdateServerStateTask();
-
         Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.initialize");
 	}
 
@@ -699,7 +696,7 @@
 	
 	protected abstract void stopKernel();
 
-	protected void startUpdateServerStateTask() {
+	public void startUpdateServerStateTask() {
         Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.startUpdateServerStateTask",
getServer().getName());
 
 		timer = new Timer(true);



Mime
View raw message