Author: rob.stryker(a)jboss.com
Date: 2011-11-25 01:43:32 -0500 (Fri, 25 Nov 2011)
New Revision: 36648
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
Log:
Allowing delegates to participate in stopping even if ignore start / stop is checked.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java 2011-11-25
05:26:11 UTC (rev 36647)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/AbstractJBossBehaviourDelegate.java 2011-11-25
06:43:32 UTC (rev 36648)
@@ -19,6 +19,7 @@
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
+import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.PollThreadUtils;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -44,6 +45,16 @@
public void publishFinish(IProgressMonitor monitor) throws CoreException {
}
+ public void stop(boolean force) {
+ if( LaunchCommandPreferences.isIgnoreLaunchCommand(getServer())) {
+ actualBehavior.setServerStopped();
+ return;
+ }
+ stopImpl(force);
+ }
+
+ protected abstract void stopImpl(boolean force);
+
protected abstract void forceStop();
protected abstract IStatus gracefullStop();
@@ -54,6 +65,12 @@
public void onServerStopping() {
}
+ public void onServerStarted() {
+ }
+
+ public void onServerStopped() {
+ }
+
@Override
public IStatus canChangeState(String launchMode) {
return Status.OK_STATUS;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-11-25
05:26:11 UTC (rev 36647)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-11-25
06:43:32 UTC (rev 36648)
@@ -48,26 +48,44 @@
super();
}
- public IJBossBehaviourDelegate getDelegate() {
+ public synchronized IJBossBehaviourDelegate getDelegate() {
IJBossServerPublishMethodType type =
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer());
String id = type == null ? LocalPublishMethod.LOCAL_PUBLISH_METHOD : type.getId();
if( id.equals(lastModeId) && delegate != null &&
delegate.getBehaviourTypeId().equals(id))
return delegate;
BehaviourImpl impl =
BehaviourModel.getModel().getBehaviour(getServer().getServerType().getId()).getImpl(id);
- delegate = impl.getBehaviourDelegate();
- delegate.setActualBehaviour(this);
+ IJBossBehaviourDelegate d = impl.getBehaviourDelegate();
+ d.setActualBehaviour(this);
+ lastModeId = id;
+ delegate = d;
return delegate;
}
public void stop(boolean force) {
- if( LaunchCommandPreferences.isIgnoreLaunchCommand(getServer())) {
- setServerStopped();
- return;
- }
getDelegate().stop(force);
}
+ @Override
+ public void setServerStarting() {
+ super.setServerStarting();
+ getDelegate().onServerStarting();
+ }
+
+ @Override
+ public void setServerStarted() {
+ super.setServerStarted();
+ getDelegate().onServerStarted();
+ }
+
+ @Override
+ public void setServerStopping() {
+ super.setServerStopping();
+ getDelegate().onServerStopping();
+ }
+
+
+
public void setServerStopped() {
super.setServerStopped();
IModule[] mods = getServer().getModules();
@@ -96,18 +114,6 @@
setMode(mode);
}
- @Override
- public void setServerStarting() {
- super.setServerStarting();
- getDelegate().onServerStarting();
- }
-
- @Override
- public void setServerStopping() {
- super.setServerStopping();
- getDelegate().onServerStopping();
- }
-
protected void publishStart(final IProgressMonitor monitor) throws CoreException {
super.publishStart(monitor);
getDelegate().publishStart(monitor);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2011-11-25
05:26:11 UTC (rev 36647)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2011-11-25
06:43:32 UTC (rev 36648)
@@ -161,6 +161,7 @@
protected int getServerStateVal() {
return serverStateVal;
}
+
public void setServerStarted() {
serverStateVal = IServer.STATE_STARTED;
setServerState(IServer.STATE_STARTED);
@@ -180,6 +181,7 @@
serverStateVal = IServer.STATE_STOPPING;
setServerState(IServer.STATE_STOPPING);
}
+
protected void initialize(IProgressMonitor monitor) {
serverStateVal = getServer().getServerState();
getServer().addServerListener(new IServerListener() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java 2011-11-25
05:26:11 UTC (rev 36647)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IJBossBehaviourDelegate.java 2011-11-25
06:43:32 UTC (rev 36648)
@@ -31,6 +31,10 @@
public void onServerStopping();
+ public void onServerStarted();
+
+ public void onServerStopped();
+
public IStatus canChangeState(String launchMode);
public String getDefaultStopArguments() throws CoreException;
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-11-25
05:26:11 UTC (rev 36647)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossBehaviorDelegate.java 2011-11-25
06:43:32 UTC (rev 36648)
@@ -67,7 +67,7 @@
}
@Override
- public void stop(boolean force) {
+ public void stopImpl(boolean force) {
int state = getServer().getServerState();
if (force
|| !isProcessRunning()
Show replies by date