Author: dgolovin
Date: 2008-10-22 19:23:37 -0400 (Wed, 22 Oct 2008)
New Revision: 11091
Removed:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IDeployableServer.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerConstants.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerPublisher.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerRuntime.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IPollerFailureHandler.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IServerStatePoller.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListener.java
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListenerManager.java
Log:
fix jboss tools compilation errors in as component
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IDeployableServer.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IDeployableServer.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IDeployableServer.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,39 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public interface IDeployableServer {
- public static final String DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.deployDirectory";
- public static final String TEMP_DEPLOY_DIRECTORY =
"org.jboss.ide.eclipse.as.core.server.tempDeployDirectory";
-
- public String getDeployDirectory();
- public String getConfigDirectory();
- public ServerAttributeHelper getAttributeHelper();
- public IServer getServer();
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerConstants.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerConstants.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerConstants.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,66 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-
-/**
- *
- * @author Rob Stryker
- *
- */
-public interface IJBossServerConstants {
-
- // Launch configuration constants
- public static final String JBOSS_SERVER_HOME_DIR = "jboss.server.home.dir";
- public static final String JBOSS_SERVER_BASE_DIR = "jboss.server.base.dir";
- public static final String JBOSS_SERVER_NAME = "jboss.server.name";
- public static final String JBOSS_HOME_DIR = "jboss.home.dir";
-
- // Folder constants
- public static final String DEFAULT_SERVER_NAME = "default";
- public static final String DEPLOY = "deploy";
- public static final String SERVER = "server";
-
- // Property keys stored in the server object
- public static final String SERVER_USERNAME =
"org.jboss.ide.eclipse.as.core.server.userName";
- public static final String SERVER_PASSWORD =
"org.jboss.ide.eclipse.as.core.server.password";
- public static final String JNDI_PORT =
"org.jboss.ide.eclipse.as.core.server.jndiPort";
- public static final String WEB_PORT =
"org.jboss.ide.eclipse.as.core.server.webPort";
- public static final String JNDI_PORT_DETECT =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect";
- public static final String WEB_PORT_DETECT=
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect";
- public static final String JNDI_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.jndiPortAutoDetect.XPath";
- public static final String WEB_PORT_DETECT_XPATH =
"org.jboss.ide.eclipse.as.core.server.webPortAutoDetect.XPath";
- public static final String JNDI_PORT_DEFAULT_XPATH = "Ports" + Path.SEPARATOR
+ "JNDI";
- public static final String WEB_PORT_DEFAULT_XPATH = "Ports" + Path.SEPARATOR +
"JBoss Web";
- public static final int JNDI_DEFAULT_PORT = 1099;
- public static final int JBOSS_WEB_DEFAULT_PORT = 8080;
-
-
- // Poller constants
- public static final String STARTUP_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.startupPollerKey";
- public static final String SHUTDOWN_POLLER_KEY =
"org.jboss.ide.eclipse.as.core.server.attributes.shutdownPollerKey";
- public static final String DEFAULT_STARTUP_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller";
- public static final String DEFAULT_SHUTDOWN_POLLER =
"org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller";
-
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerPublisher.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerPublisher.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerPublisher.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-
-/**
- *
- * @author Rob Stryker
- *
- */
-public interface IJBossServerPublisher {
- public static final int NO_PUBLISH = 0;
- public static final int INCREMENTAL_PUBLISH = 1;
- public static final int FULL_PUBLISH = 2;
- public static final int REMOVE_PUBLISH = 3;
-
- // pre-publish
- public boolean accepts(IServer server, IModule[] module);
-
-
- public IStatus publishModule(IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- EventLogTreeItem log, IProgressMonitor monitor) throws CoreException;
-
- // post publish
- public int getPublishState();
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerRuntime.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerRuntime.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IJBossServerRuntime.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,49 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import java.util.HashMap;
-
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.wst.server.core.IRuntime;
-
-/**
- *
- * @author Rob Stryker
- */
-public interface IJBossServerRuntime {
- public static String PROPERTY_VM_ID = "PROPERTY_VM_ID";
- public static String PROPERTY_VM_TYPE_ID = "PROPERTY_VM_TYPE_ID";
-
- public static String PROPERTY_CONFIGURATION_NAME =
"org.jboss.ide.eclipse.as.core.runtime.configurationName";
-
- public IRuntime getRuntime();
- public IVMInstall getVM();
- public void setVM(IVMInstall install);
- public String getJBossConfiguration();
- public void setJBossConfiguration(String config);
-
- // for startup
- public String getDefaultRunArgs();
- public String getDefaultRunVMArgs();
- public HashMap<String, String> getDefaultRunEnvVars();
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IPollerFailureHandler.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IPollerFailureHandler.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IPollerFailureHandler.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,33 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import java.util.List;
-
-/**
- * @author rob.stryker <rob.stryker(a)redhat.com>
- *
- */
-public interface IPollerFailureHandler {
- public boolean accepts(IServerStatePoller poller, String action, List<String>
requiredProperties);
- public void handle(IServerStatePoller poller, String action, List<String>
requiredProperties);
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IServerStatePoller.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IServerStatePoller.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/IServerStatePoller.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,95 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
-
-/**
- * A server state poller will
- * @author Rob Stryker
- *
- */
-public interface IServerStatePoller {
-
- public static final boolean SERVER_UP = true;
- public static final boolean SERVER_DOWN = false;
-
- public static final int CANCEL = 0;
- public static final int TIMEOUT_REACHED = 1;
- public static final int SUCCESS = 2;
- public static final int FAILED = 3;
-
- /**
- * Force a successful state change if we timeout
- */
- public static final int TIMEOUT_BEHAVIOR_SUCCEED = 0;
-
- /**
- * Ignore the timeout and let the wst tools handle the timeout
- */
- public static final int TIMEOUT_BEHAVIOR_IGNORE = 1;
-
- /**
- * Force a failure upon timeout
- */
- public static final int TIMEOUT_BEHAVIOR_FAIL = 2;
-
- public ServerStatePollerType getPollerType();
- public void setPollerType(ServerStatePollerType type);
- public void beginPolling(IServer server, boolean expectedState, PollThread pt); //
expected to launch own thread
- public IServer getServer();
- public boolean isComplete() throws PollingException, RequiresInfoException;
- public boolean getState() throws PollingException, RequiresInfoException;
- public void cleanup(); // clean up any resources / processes. Will ALWAYS be called
- public List<String> getRequiredProperties();
- public void failureHandled(Properties properties);
-
- /**
- * Cancel the polling.
- * @param type CANCEL or TIMEOUT_REACHED
- */
- public void cancel(int type);
-
- /**
- * Returns a TIMEOUT_BEHAVIOR_XXX constant
- * @return
- */
- public int getTimeoutBehavior();
-
- public class PollingException extends Exception {
- private static final long serialVersionUID = -7830978018908940551L;
- public PollingException(String message) {super(message);}
- }
-
- public class RequiresInfoException extends Exception {
- private static final long serialVersionUID = 5050044329807740335L;
- private boolean checked = false;
- public RequiresInfoException(String msg) {super(msg);}
- public void setChecked() { this.checked = true; }
- public boolean getChecked() { return this.checked; }
- }
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListener.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListener.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListener.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,45 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerEvent;
-
-/**
- * This is a stub superclass which can be used
- * to override only those methods you care about.
- *
- * @author Rob Stryker
- *
- */
-public class UnitedServerListener {
-
- public void init(IServer server) {}
- public void serverAdded(IServer server) {}
- public void serverChanged(IServer server) {}
- public void serverRemoved(IServer server) {}
- public void serverChanged(ServerEvent event) {}
- public void publishStarted(IServer server){}
- public void publishFinished(IServer server, IStatus status){}
- public void cleanUp(IServer server) {}
-}
Deleted:
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListenerManager.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListenerManager.java 2008-10-22
23:22:51 UTC (rev 11090)
+++
branches/jbosstools-3.0.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/server/UnitedServerListenerManager.java 2008-10-22
23:23:37 UTC (rev 11091)
@@ -1,117 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.server;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.server.core.IPublishListener;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.IServerListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerEvent;
-
-/**
- * The UnitedServerListenerManager keeps an array of
- * UnitedServerListeners. The manager registers itself as
- * a listener for all server operations and passes
- * all requests to every UnitedServerListener that's been
- * added to the model.
- *
- * @author Rob Stryker
- *
- */
-public class UnitedServerListenerManager implements
- IServerLifecycleListener, IServerListener, IPublishListener {
- protected static UnitedServerListenerManager instance;
- public static UnitedServerListenerManager getDefault() {
- if( instance == null )
- instance = new UnitedServerListenerManager();
- return instance;
- }
-
- protected ArrayList<UnitedServerListener> list;
- protected UnitedServerListenerManager() {
- list = new ArrayList<UnitedServerListener>();
- ServerCore.addServerLifecycleListener(this);
- IServer[] allServers = ServerCore.getServers();
- for( int i = 0; i < allServers.length; i++ ) {
- allServers[i].addServerListener(this);
- allServers[i].addPublishListener(this);
- }
- }
-
-
- public void addListener(UnitedServerListener listener) {
- if( !list.contains(listener)) {
- list.add(listener);
- IServer[] allServers = ServerCore.getServers();
- for( int i = 0; i < allServers.length; i++ )
- listener.init(allServers[i]);
- }
- }
- public void removeListener(UnitedServerListener listener) {
- list.remove(listener);
- IServer[] allServers = ServerCore.getServers();
- for( int i = 0; i < allServers.length; i++ )
- listener.cleanUp(allServers[i]);
- }
-
- public void serverAdded(IServer server) {
- server.addServerListener(this);
- server.addPublishListener(this);
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); ) {
- i.next().serverAdded(server);
- }
- }
- public void serverChanged(IServer server) {
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); ) {
- i.next().serverChanged(server);
- }
- }
- public void serverRemoved(IServer server) {
- server.removeServerListener(this);
- server.removePublishListener(this);
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); ) {
- i.next().serverRemoved(server);
- }
- }
-
- public void serverChanged(ServerEvent event) {
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); ) {
- i.next().serverChanged(event);
- }
- }
-
- public void publishStarted(IServer server) {
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); )
- i.next().publishStarted(server);
- }
-
- public void publishFinished(IServer server, IStatus status) {
- for( Iterator<UnitedServerListener> i = list.iterator(); i.hasNext(); )
- i.next().publishFinished(server, status);
- }
-
-}