[166412] Should auto-publish when server state initialized
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
index 6281443..c7e186e 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/Server.java
@@ -188,7 +188,6 @@
setServerPublishState(IServer.PUBLISH_STATE_INCREMENTAL);
if (!changed[0])
- //return;
return Status.OK_STATUS;
if (getServerState() != IServer.STATE_STOPPED && behaviourDelegate != null)
@@ -302,6 +301,9 @@
behaviourDelegate = ((ServerType) serverType).createServerBehaviourDelegate();
InternalInitializer.initializeServerBehaviourDelegate(behaviourDelegate, Server.this, monitor);
Trace.trace(Trace.PERFORMANCE, "Server.getBehaviourDelegate(): <" + (System.currentTimeMillis() - time) + "> " + getServerType().getId());
+
+ if (getServerState() == IServer.STATE_STARTED)
+ autoPublish();
} catch (Throwable t) {
Trace.trace(Trace.SEVERE, "Could not create behaviour delegate " + toString(), t);
}
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
index 74d1b5d..2002b7f 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
@@ -286,7 +286,7 @@
public StopJob() {
super("Disposing servers");
}
-
+
public boolean belongsTo(Object family) {
return SHUTDOWN_JOB_FAMILY.equals(family);
}
@@ -297,9 +297,13 @@
}
}
- StopJob job = new StopJob();
- job.setUser(false);
- job.schedule();
+ try {
+ StopJob job = new StopJob();
+ job.setUser(false);
+ job.schedule();
+ } catch (Throwable t) {
+ // ignore errors
+ }
}
/**