### Eclipse Workspace Patch 1.0
#P org.jboss.ide.eclipse.as.core
Index: jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java
===================================================================
--- jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java	(revision 10148)
+++ jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXModel.java	(working copy)
@@ -1,475 +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.extensions.jmx;
-
-import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.naming.InitialContext;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-
-/**
- * Model and objects related to JMX
- * @author rob.stryker@redhat.com
- *
- */
-public class JMXModel {
-	/* Singleton */
-	protected static JMXModel instance;
-	public static JMXModel getDefault() {
-		if( instance == null )
-			instance = new JMXModel();
-		return instance;
-	}
-	
-	
-	protected HashMap<String, JMXModelRoot> root;
-	/* constructor */
-	protected JMXModel() {
-		root = new HashMap<String, JMXModelRoot>();
-	}
-
-	/**
-	 * Get the Model Root for one particular server
-	 * @param server
-	 * @return that server's model
-	 */
-	public JMXModelRoot getModel(IServer server) {
-		if (root.get(server.getId()) == null) {
-			JMXModelRoot serverRoot = new JMXModelRoot(server);
-			root.put(server.getId(), serverRoot);
-		}
-		return root.get(server.getId());
-	}
-
-	/**
-	 * Clear the server's model
-	 * @param server
-	 */
-	public void clearModel(IServer server) {
-		root.remove(server.getId());
-	}
-
-	/**
-	 * The model for one server
-	 */
-	public static class JMXModelRoot {
-		protected IServer server;
-		protected JMXDomain[] domains = null;
-		protected JMXException exception = null;
-
-		public JMXModelRoot(IServer server) {
-			this.server = server;
-		}
-
-		public JMXDomain[] getDomains() {
-			return domains;
-		}
-
-		public JMXException getException() {
-			return exception;
-		}
-
-		/**
-		 * Lazily load the domains
-		 */
-		public void loadDomains() {
-			exception = null;
-			JMXRunnable run = new JMXRunnable() {
-				public void run(MBeanServerConnection connection) {
-					try {
-						String[] domainNames = connection.getDomains();
-						JMXDomain[] domains = new JMXDomain[domainNames.length];
-						for (int i = 0; i < domainNames.length; i++) {
-							domains[i] = new JMXDomain(server, domainNames[i]);
-						}
-						JMXModelRoot.this.domains = domains;
-					} catch (IOException ioe) {
-						exception = new JMXException(ioe);
-					}
-				}
-			};
-			JMXSafeRunner.run(server, run);
-		}
-	}
-
-	/**
-	 * A JMX Domain
-	 */
-	public static class JMXDomain {
-		protected String name;
-		protected IServer server;
-		protected JMXBean[] mbeans = null;
-		protected JMXException exception = null;
-
-		public JMXDomain(IServer server, String name) {
-			this.server = server;
-			this.name = name;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public JMXException getException() {
-			return exception;
-		}
-
-		public JMXBean[] getBeans() {
-			return mbeans;
-		}
-
-		public void resetChildren() {
-			mbeans = null;
-			exception = null;
-		}
-		
-		/**
-		 * Lazily load the beans for this domain
-		 */
-		public void loadBeans() {
-			exception = null;
-			JMXRunnable run = new JMXRunnable() {
-				public void run(MBeanServerConnection connection) {
-					try {
-						Set<?> s = connection.queryMBeans(new ObjectName(name
-								+ ":*"), null);
-						Iterator<?> i = s.iterator();
-						JMXBean[] beans = new JMXBean[s.size()];
-						int count = 0;
-						while (i.hasNext()) {
-							ObjectInstance tmp = (ObjectInstance) i.next();
-							beans[count++] = new JMXBean(server, tmp);
-						}
-						mbeans = beans;
-					} catch (MalformedObjectNameException mone) {
-						exception = new JMXException(mone);
-					} catch (IOException ioe) {
-						exception = new JMXException(ioe);
-					}
-				}
-			};
-			JMXSafeRunner.run(server, run);
-		}
-	}
-
-	/**
-	 * The JMX Bean Object
-	 */
-	public static class JMXBean {
-		protected String domain;
-		protected String name;
-		protected String clazz;
-		protected IServer server;
-		protected ObjectName objectName;
-		protected MBeanInfo info;
-		protected WrappedMBeanOperationInfo[] operations;
-		protected WrappedMBeanAttributeInfo[] attributes;
-		
-		protected JMXException exception;
-
-		public JMXBean(IServer server, ObjectInstance instance) {
-			this.server = server;
-			this.domain = instance.getObjectName().getDomain();
-			this.clazz = instance.getClassName();
-			this.objectName = instance.getObjectName();
-			this.name = instance.getObjectName().getCanonicalName();
-		}
-
-		public String getDomain() {
-			return domain;
-		}
-
-		public String getName() {
-			return name;
-		}
-
-		public String getClazz() {
-			return clazz;
-		}
-
-		public IServer getServer() {
-			return server;
-		}
-		
-		public void resetChildren() {
-			info = null;
-			exception = null;
-		}
-		
-		public WrappedMBeanOperationInfo[] getOperations() {
-			return operations;
-		}
-		
-
-		public WrappedMBeanAttributeInfo[] getAttributes() {
-			return attributes;
-		}
-
-		public JMXException getException() {
-			return this.exception;
-		}
-
-		/**
-		 * Load the child operations and attributes
-		 */
-		public void loadInfo() {
-			exception = null;
-			JMXRunnable run = new JMXRunnable() {
-				public void run(MBeanServerConnection connection) {
-					Exception tmp = null;
-					try {
-						info = connection.getMBeanInfo(new ObjectName(name));
-						loadAttributes(connection);
-						loadOperations(connection);
-					} catch (InstanceNotFoundException e) {
-						tmp = e;
-					} catch (IntrospectionException e) {
-						tmp = e;
-					} catch (MalformedObjectNameException e) {
-						tmp = e;
-					} catch (ReflectionException e) {
-						tmp = e;
-					} catch (NullPointerException e) {
-						tmp = e;
-					} catch (IOException e) {
-						tmp = e;
-					} catch( UndeclaredThrowableException e) {
-						tmp = e;
-					}
-					if (tmp != null) {
-						exception = new JMXException(tmp);
-					}
-				}
-			};
-			JMXSafeRunner.run(server, run);
-		}
-		
-
-		protected void loadOperations(MBeanServerConnection connection) {
-			if (info == null)
-				return;
-			MBeanOperationInfo[] ops = info.getOperations();
-			WrappedMBeanOperationInfo[] wrappedOps = new WrappedMBeanOperationInfo[ops.length];
-			for (int i = 0; i < ops.length; i++) {
-				wrappedOps[i] = new WrappedMBeanOperationInfo(server, this,
-						ops[i]);
-			}
-			operations = wrappedOps;
-		}
-
-		protected void loadAttributes(MBeanServerConnection connection) {
-			if (info == null)
-				return;
-			MBeanAttributeInfo[] atts = info.getAttributes();
-			ArrayList wrapped = new ArrayList();
-			WrappedMBeanAttributeInfo tmp;
-			for (int i = 0; i < atts.length; i++) {
-				try {
-					tmp = new WrappedMBeanAttributeInfo(server, this, atts[i]);
-					tmp.loadValue(connection);
-					wrapped.add(tmp);
-				} catch( Exception e ) {
-					// some attributes may not load because the result is not serializable.
-					// no need to report every error
-				}
-			}
-			attributes = (WrappedMBeanAttributeInfo[]) wrapped.toArray(new WrappedMBeanAttributeInfo[wrapped.size()]);
-		}
-
-		public ObjectName getObjectName() {
-			return objectName;
-		}
-
-
-
-	}
-
-	public static class WrappedMBeanOperationInfo {
-		protected IServer server;
-		protected JMXBean bean;
-		protected MBeanOperationInfo info;
-		protected WrappedMBeanOperationParameter[] params;
-
-		public WrappedMBeanOperationInfo(IServer server, JMXBean bean,
-				MBeanOperationInfo info) {
-			this.server = server;
-			this.bean = bean;
-			this.info = info;
-		}
-		public MBeanOperationInfo getInfo() {
-			return info;
-		}
-		public JMXBean getBean() {
-			return bean;
-		}
-		
-		public WrappedMBeanOperationParameter[] getParameters() {
-			if( params == null ) {
-				MBeanParameterInfo[] paramInfo = info.getSignature();
-				params = new WrappedMBeanOperationParameter[paramInfo.length];
-				for( int i = 0; i < paramInfo.length; i++ ) {
-					params[i] = new WrappedMBeanOperationParameter(this, paramInfo[i]);
-				}
-			}
-			return params;
-		}
-		
-		public void clearParamValues() {
-			if( params != null ) {
-				for( int i = 0; i < params.length; i++ ) 
-					params[i].setValue(null);
-			}
-		}
-	}
-
-	public static class WrappedMBeanOperationParameter {
-		protected WrappedMBeanOperationInfo operation;
-		protected MBeanParameterInfo parameterInfo;
-		protected Object value;
-		
-		public WrappedMBeanOperationParameter(WrappedMBeanOperationInfo operation, MBeanParameterInfo param) {
-			this.parameterInfo = param;
-			this.operation = operation;
-		}
-		
-		public IServer getServer() { return operation.server; }
-		public JMXBean getBean() { return operation.bean; }
-
-		public Object getValue() { return value; }
-		public void setValue(Object o) { this.value = o; }
-		public MBeanParameterInfo getInfo() { return this.parameterInfo; }
-	}
-	
-	public static class WrappedMBeanAttributeInfo {
-		protected IServer server;
-		protected JMXBean bean;
-		protected MBeanAttributeInfo info;
-		protected Object value;
-		
-		public WrappedMBeanAttributeInfo(IServer server, JMXBean bean,
-				MBeanAttributeInfo info) {
-			this.server = server;
-			this.bean = bean;
-			this.info = info;
-		}
-		public MBeanAttributeInfo getInfo() {
-			return info;
-		}
-		public JMXBean getBean() {
-			return bean;
-		}
-		public void loadValue(MBeanServerConnection connection) throws Exception {
-			value = connection.getAttribute(
-					new ObjectName(bean.getName()), info.getName());
-		}
-		public Object getValue() {
-			return value;
-		}
-	}
-
-	
-	public static class JMXException extends Exception {
-		private static final long serialVersionUID = 1L;
-		private Exception exception;
-
-		public JMXException(Exception e) {
-			this.exception = e;
-		}
-
-		public Exception getException() {
-			return this.exception;
-		}
-	}
-
-	public interface JMXRunnable {
-		public void run(MBeanServerConnection connection) throws Exception;
-	}
-
-	public static class JMXSafeRunner {
-		public static void run(IServer s, JMXRunnable r) {
-			// do nothing if the server is down.
-			if( s.getServerState() != IServer.STATE_STARTED ) return;
-			
-			JMXClassLoaderRepository.getDefault().addConcerned(s, r);
-			ClassLoader currentLoader = Thread.currentThread()
-					.getContextClassLoader();
-			ClassLoader newLoader = JMXClassLoaderRepository.getDefault()
-					.getClassLoader(s);
-			Thread.currentThread().setContextClassLoader(newLoader);
-			InitialContext ic = null;
-			try {
-				JMXUtil.setCredentials(s);
-				Properties p = JMXUtil.getDefaultProperties(s);
-				ic = new InitialContext(p);
-				Object obj = ic.lookup("jmx/invoker/RMIAdaptor");
-				ic.close();
-				if (obj instanceof MBeanServerConnection) {
-					MBeanServerConnection connection = (MBeanServerConnection) obj;
-					r.run(connection);
-				}
-			} catch (Exception e) {
-				// only if the server *IS* started should we log the error  
-				if( s.getServerState() == IServer.STATE_STARTED ) {
-					JBossServerCorePlugin.getDefault().getLog().log(
-							new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
-									"Error while running JMX-safe code", e));
-				}
-			}
-			JMXClassLoaderRepository.getDefault().removeConcerned(s, r);
-			Thread.currentThread().setContextClassLoader(currentLoader);
-		}
-	}
-
-	public static class JMXAttributesWrapper {
-		protected JMXBean bean;
-
-		public JMXAttributesWrapper(JMXBean bean) {
-			this.bean = bean;
-		}
-
-		public JMXBean getBean() {
-			return bean;
-		}
-	}
-
-}
Index: jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
--- jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java	(revision 10148)
+++ jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java	(working copy)
@@ -1,279 +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.extensions.polling;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import javax.management.MBeanException;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.OperationsException;
-import javax.management.ReflectionException;
-import javax.naming.CommunicationException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXClassLoaderRepository;
-import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXUtil;
-import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXUtil.CredentialException;
-import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
-import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
-import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
-
-/**
- * A poller dedicated to server startup, checks via JMX
- * @author Rob rob.stryker@redhat.com
- *
- */
-public class JMXPoller implements IServerStatePoller {
-
-	public static final String POLLER_ID = "org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller";
-	
-	public static final String STARTED_PROPERTY = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.STARTED_PROPERTY";
-	public static final String EVENT_TYPE_STARTING = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.eventTypes.STARTING";
-	
-	public static final String REQUIRED_USER = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_USER";
-	public static final String REQUIRED_PASS = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.REQUIRED_PASS";
-	
-	public static final int STATE_STARTED = 1;
-	public static final int STATE_STOPPED = 0;
-	public static final int STATE_TRANSITION = -1;
-
-	private int started;
-	private boolean canceled;
-	private boolean done;
-	private boolean waitingForCredentials = false;
-	private IServer server;
-	private ServerStatePollerType type;
-	private PollingException pollingException = null;
-	private RequiresInfoException requiresInfoException = null;
-	private Properties requiredPropertiesReturned = null;
-
-	private EventLogTreeItem event;
-
-	public void beginPolling(IServer server, boolean expectedState,
-			PollThread pt) {
-		this.canceled = false;
-		this.done = false;
-		this.server = server;
-		event = pt.getActiveEvent();
-		launchJMXPoller();
-	}
-
-	private class PollerRunnable implements Runnable {
-		public void run() {
-			JMXClassLoaderRepository.getDefault().addConcerned(server, this);
-			ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
-			ClassLoader twiddleLoader = JMXClassLoaderRepository.getDefault().getClassLoader(server);
-			if( pollingException != null ) {done = true; return;}
-			if (twiddleLoader != null) {
-
-				Thread.currentThread().setContextClassLoader(twiddleLoader);
-				Properties props = JMXUtil.getDefaultProperties(server);
-				setCredentials();
-				if( pollingException != null ) {done = true; return;}
-
-				Exception failingException = null;
-				while (!done && !canceled) {
-					InitialContext ic;
-					try {
-						ic = new InitialContext(props);
-						Object obj = ic.lookup("jmx/invoker/RMIAdaptor");
-						ic.close();
-						if (obj instanceof MBeanServerConnection) {
-							MBeanServerConnection connection = (MBeanServerConnection) obj;
-							Object attInfo = connection.getAttribute(
-									new ObjectName("jboss.system:type=Server"),
-									"Started");
-							boolean b = ((Boolean) attInfo).booleanValue();
-							started = b ? STATE_STARTED : STATE_TRANSITION;
-							done = b;
-							new JMXEvent(event, b);
-						}
-					} catch (SecurityException se) {
-						synchronized(this) {
-							if( !waitingForCredentials ) {
-								waitingForCredentials = true;
-								requiresInfoException = new PollingSecurityException(
-										"Security Exception: " + se.getMessage());
-							} else {
-								// we're waiting. are they back yet?
-								if( requiredPropertiesReturned != null ) {
-									requiresInfoException = null;
-									String user, pass;
-									user = (String)requiredPropertiesReturned.get(REQUIRED_USER);
-									pass = (String)requiredPropertiesReturned.get(REQUIRED_PASS);
-									requiredPropertiesReturned = null;
-									setCredentials(user, pass);
-									waitingForCredentials = false;
-								}
-							}
-						}
-					} catch (CommunicationException ce) {
-						started = STATE_STOPPED;
-						new JMXEvent(event, ce);
-					} catch (NamingException nnfe) {
-						started = STATE_STOPPED;
-						new JMXEvent(event, nnfe);
-					} catch( OperationsException e ) {
-						failingException = e;
-					} catch (MBeanException e) {
-						failingException = e;
-					} catch (ReflectionException e) {
-						failingException = e;
-					} catch (NullPointerException e) {
-						failingException = e;
-					} catch (IOException e) {
-						failingException = e;
-					}
-					
-					if( failingException != null ) {
-						pollingException = new PollingException(failingException.getMessage());
-						done = true;
-					}
-
-					try {
-						Thread.sleep(500);
-					} catch (InterruptedException e) {
-					}
-				} // end while
-			}
-
-			Thread.currentThread().setContextClassLoader(currentLoader);
-			JMXClassLoaderRepository.getDefault().removeConcerned(server, this);
-		}
-		
-		protected void setCredentials() {
-			try {
-				JMXUtil.setCredentials(server);
-			} catch( CredentialException ce ) {
-				pollingException = new PollingException(ce.getWrapped().getMessage());
-			}
-		}
-		
-		protected void setCredentials(String user, String pass) {
-			try {
-				JMXUtil.setCredentials(server, user, pass);
-			} catch( CredentialException ce ) {
-				pollingException = new PollingException(ce.getWrapped().getMessage());
-			}
-		}
-	}
-
-
-	
-	private void launchJMXPoller() {
-		PollerRunnable run = new PollerRunnable();
-		Thread t = new Thread(run, "JMX Poller");
-		t.start();
-	}
-
-	public void cancel(int type) {
-		canceled = true;
-	}
-
-	public void cleanup() {
-	}
-
-	public class PollingSecurityException extends RequiresInfoException {
-		private static final long serialVersionUID = 1L;
-		public PollingSecurityException(String msg) {
-			super(msg);
-		}
-	}
-
-	public boolean getState() throws PollingException, RequiresInfoException {
-		if (pollingException != null)
-			throw pollingException;
-		if( requiresInfoException != null )
-			throw requiresInfoException;
-		
-		if (started == 0)
-			return SERVER_DOWN;
-		if (started == 1)
-			return SERVER_UP;
-
-		if (!done && !canceled)
-			return SERVER_DOWN; // Not there yet.
-
-		return SERVER_UP; // done or canceled, doesnt matter
-	}
-
-	public boolean isComplete() throws PollingException, RequiresInfoException {
-		if (pollingException != null)
-			throw pollingException;
-		if( requiresInfoException != null )
-			throw requiresInfoException;
-		return done;
-	}
-
-	public class JMXEvent extends EventLogTreeItem {
-		public JMXEvent(SimpleTreeItem parent, boolean started) {
-			super(parent, PollThread.SERVER_STATE_MAJOR_TYPE, EVENT_TYPE_STARTING );
-			setProperty(STARTED_PROPERTY, new Boolean(started));
-		}
-		
-		public JMXEvent(SimpleTreeItem parent, Exception e) {
-			super(parent, PollThread.SERVER_STATE_MAJOR_TYPE, EventLogModel.EVENT_TYPE_EXCEPTION );
-			setProperty(EventLogModel.EXCEPTION_PROPERTY, e);
-		}
-	}
-	
-	
-	public void failureHandled(Properties properties) {
-		if( properties == null ) {
-			done = true;
-			pollingException = new PollingException("Request for more information ignored");
-		} else
-			requiredPropertiesReturned = properties;
-	}
-
-	public List<String> getRequiredProperties() {
-		ArrayList<String> list = new ArrayList<String>();
-		list.add(REQUIRED_USER);
-		list.add(REQUIRED_PASS);
-		return list;
-	}
-
-	public ServerStatePollerType getPollerType() {
-		return type;
-	}
-
-	public void setPollerType(ServerStatePollerType type) {
-		this.type = type;
-	}
-	
-	public IServer getServer() {
-		return server;
-	}
-	
-	public int getTimeoutBehavior() {
-		return TIMEOUT_BEHAVIOR_IGNORE;
-	}
-}
Index: plugin.xml
===================================================================
--- plugin.xml	(revision 10181)
+++ plugin.xml	(working copy)
@@ -334,12 +334,12 @@
             name="Timeout Poller"
             supportsStartup="true"
             supportsShutdown="true"/>
-      <serverPoller
+<!--      <serverPoller
             class="org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller"
             id="org.jboss.ide.eclipse.as.core.runtime.server.JMXPoller"
             name="JMX Poller"
             supportsStartup="true"
-            supportsShutdown="false"/>
+            supportsShutdown="false"/> -->
       <serverPoller
             class="org.jboss.ide.eclipse.as.core.extensions.polling.ProcessTerminatedPoller"
             id="org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller"
Index: jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java
===================================================================
--- jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java	(revision 10181)
+++ jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXUtil.java	(working copy)
@@ -1,130 +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.extensions.jmx;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.security.Principal;
-import java.util.Properties;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-/**
- * Utility class
- * 
- * @author Rob Stryker rob.stryker@redhat.com
- * 
- */
-public class JMXUtil {
-
-	/**
-	 * In the current thread, set the credentials from some server
-	 * 
-	 * @param server
-	 */
-	public static void setCredentials(IServer server)
-			throws CredentialException {
-		String user = ServerConverter.getJBossServer(server).getUsername();
-		String pass = ServerConverter.getJBossServer(server).getPassword();
-		setCredentials(server, user, pass);
-	}
-
-	public static void setCredentials(IServer server, Object principal,
-			Object credential) throws CredentialException {
-		Exception temp = null;
-		try {
-			// get our methods
-			Class simplePrincipal = Thread.currentThread()
-					.getContextClassLoader().loadClass(
-							"org.jboss.security.SimplePrincipal");
-			Class securityAssoc = Thread.currentThread()
-					.getContextClassLoader().loadClass(
-							"org.jboss.security.SecurityAssociation");
-			securityAssoc.getMethods(); // force-init the methods since the
-			// class hasn't been initialized yet.
-
-			Constructor newSimplePrincipal = simplePrincipal
-					.getConstructor(new Class[] { String.class });
-			Object newPrincipalInstance = newSimplePrincipal
-					.newInstance(new Object[] { principal });
-
-			// set the principal
-			Method setPrincipalMethod = securityAssoc.getMethod("setPrincipal",
-					new Class[] { Principal.class });
-			setPrincipalMethod.invoke(null,
-					new Object[] { newPrincipalInstance });
-
-			// set the credential
-			Method setCredentialMethod = securityAssoc.getMethod(
-					"setCredential", new Class[] { Object.class });
-			setCredentialMethod.invoke(null, new Object[] { credential });
-		} catch (ClassNotFoundException e) {
-			temp = e;
-		} catch (SecurityException e) {
-			temp = e;
-		} catch (NoSuchMethodException e) {
-			temp = e;
-		} catch (IllegalArgumentException e) {
-			temp = e;
-		} catch (InstantiationException e) {
-			temp = e;
-		} catch (IllegalAccessException e) {
-			temp = e;
-		} catch (InvocationTargetException e) {
-			temp = e;
-		}
-		if( temp != null )
-			throw new CredentialException(temp); 
-	}
-
-	public static class CredentialException extends Exception {
-		private static final long serialVersionUID = 1L;
-		protected Exception wrapped;
-
-		public CredentialException(Exception wrapped) {
-			this.wrapped = wrapped;
-		}
-
-		public Exception getWrapped() {
-			return wrapped;
-		}
-	}
-
-	public static Properties getDefaultProperties(IServer server) {
-		JBossServer jbs = ServerConverter.getJBossServer(server);
-		Properties props = new Properties();
-		if( jbs != null ) {
-			
-			int port = jbs.getJNDIPort();
-			props.put("java.naming.factory.initial",
-					"org.jnp.interfaces.NamingContextFactory");
-			props.put("java.naming.factory.url.pkgs",
-					"org.jboss.naming:org.jnp.interfaces");
-			props.put("java.naming.provider.url", "jnp://" + jbs.getHost() + ":"
-					+ port);
-		} 
-		return props;
-	}
-}
Index: jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
--- jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java	(revision 10148)
+++ jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java	(working copy)
@@ -21,9 +21,6 @@
  */
 package org.jboss.ide.eclipse.as.core.server.internal;
 
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -38,12 +35,12 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
 import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXRunnable;
-import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXModel.JMXSafeRunner;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
 import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
 import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
 
+import com.sun.xml.internal.bind.v2.TODO;
+
 /**
  * 
  * @author Rob Stryker
@@ -180,45 +177,46 @@
 	}
 	
 
-	protected void publishStart(IProgressMonitor monitor) throws CoreException {
-		super.publishStart(monitor);
-		if( shouldSuspendScanner() )
-			suspendDeployment();
-	}
-
-	protected void publishFinish(IProgressMonitor monitor) throws CoreException {
-		if( shouldSuspendScanner() )
-			resumeDeployment();
-		super.publishFinish(monitor);
-	}
-	
-	protected boolean shouldSuspendScanner() {
-		if( getServer().getServerType().getId().equals("org.jboss.ide.eclipse.as.50"))
-			return false;
-		if( getServer().getServerState() != IServer.STATE_STARTED)
-			return false;
-		return true;
-	}
-	
-	protected void suspendDeployment() {
-		JMXRunnable r = new JMXRunnable() {
-			public void run(MBeanServerConnection connection) throws Exception {
-				ObjectName name = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
-				connection.invoke(name, "stop", new Object[] {  }, new String[] {});
-			}
-		};
-		JMXSafeRunner.run(getServer(), r);
-	}
-	
-	protected void resumeDeployment() {
-		JMXRunnable r = new JMXRunnable() {
-			public void run(MBeanServerConnection connection) throws Exception {
-				ObjectName name = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
-				connection.invoke(name, "start", new Object[] {  }, new String[] {});
-			}
-		};
-		JMXSafeRunner.run(getServer(), r);
-	}
+//	protected void publishStart(IProgressMonitor monitor) throws CoreException {
+//		super.publishStart(monitor);
+//		if( shouldSuspendScanner() )
+//			suspendDeployment();
+//	}
+//
+//	protected void publishFinish(IProgressMonitor monitor) throws CoreException {
+//		if( shouldSuspendScanner() )
+//			resumeDeployment();
+//		super.publishFinish(monitor);
+//	}
+//	
+//	protected boolean shouldSuspendScanner() {
+//		if( getServer().getServerType().getId().equals("org.jboss.ide.eclipse.as.50"))
+//			return false;
+//		if( getServer().getServerState() != IServer.STATE_STARTED)
+//			return false;
+//		return true;
+//	}
+//	
+//	 //TODO FIX THIS
+//	protected void suspendDeployment() {
+//		JMXRunnable r = new JMXRunnable() {
+//			public void run(MBeanServerConnection connection) throws Exception {
+//				ObjectName name = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
+//				connection.invoke(name, "stop", new Object[] {  }, new String[] {});
+//			}
+//		};
+//		JMXSafeRunner.run(getServer(), r);
+//	}
+//	
+//	protected void resumeDeployment() {
+//		JMXRunnable r = new JMXRunnable() {
+//			public void run(MBeanServerConnection connection) throws Exception {
+//				ObjectName name = new ObjectName("jboss.deployment:flavor=URL,type=DeploymentScanner");
+//				connection.invoke(name, "start", new Object[] {  }, new String[] {});
+//			}
+//		};
+//		JMXSafeRunner.run(getServer(), r);
+//	}
 		
 
 }
Index: jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java
===================================================================
--- jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java	(revision 10148)
+++ jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JMXClassLoaderRepository.java	(working copy)
@@ -1,142 +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.extensions.jmx;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-
-/**
- * A repository for classloaders that relate to servers, 
- * specifically jmx. It basically loads teh jboss-clientall.jar. 
- * 
- * 
- * @author Rob Stryker
- *
- */
-public class JMXClassLoaderRepository {
-	protected static JMXClassLoaderRepository instance;
-	public static JMXClassLoaderRepository getDefault() {
-		if( instance == null ) {
-			instance = new JMXClassLoaderRepository();
-		}
-		return instance;
-	}
-	
-	protected HashMap<String, ClassLoader> idToLoader;
-	protected HashMap<String, ArrayList<Object>> idToConcerned;
-	protected JMXClassLoaderRepository() {
-		idToLoader = new HashMap<String, ClassLoader>();
-		idToConcerned = new HashMap<String, ArrayList<Object>>();
-	}
-	
-	/**
-	 * Add a concerned citizen to the list of said citizens.
-	 * These are people who may at any time ask to access
-	 * the classloader. 
-	 * 
-	 * @param server
-	 * @param concerned
-	 */
-	public void addConcerned(IServer server, Object concerned) {
-		ArrayList<Object> list = idToConcerned.get(server.getId());
-		if( list == null ) {
-			list = new ArrayList<Object>();
-			idToConcerned.put(server.getId(), list);
-		}
-		if( !list.contains(concerned))
-			list.add(concerned);
-	}
-	
-	/**
-	 * Removes an element from the list of concerned citizens.
-	 * If no one cares about this server any longer, remove
-	 * its classloader cache and forget about it.
-	 * 
-	 * @param server
-	 * @param concerned
-	 */
-	public void removeConcerned(IServer server, Object concerned) {
-		ArrayList<Object> list = idToConcerned.get(server.getId());
-		if( list != null ) {
-			list.remove(concerned);
-			if( list.size() == 0 ) {
-				idToConcerned.remove(server.getId());
-				idToLoader.remove(server.getId());
-			}
-		}
-	}
-	
-	/**
-	 * Get the classloader for some server.
-	 * If there are 0 concerned citizens, null should be returned.
-	 * @param server
-	 * @return
-	 */
-	public ClassLoader getClassLoader(IServer server) {
-		ClassLoader loader = idToLoader.get(server.getId());
-		if( loader == null && anyoneCares(server)) {
-			loadClassLoader(server);
-		}
-		return idToLoader.get(server.getId());
-	}
-	
-	/**
-	 * Actually create and store the classloader
-	 * @param s
-	 */
-	protected void loadClassLoader(IServer s) {
-		try {
-			IRuntime rt = s.getRuntime();
-			IPath loc = rt.getLocation();
-			URL url = loc.append("client").append("jbossall-client.jar")
-					.toFile().toURI().toURL();
-			URLClassLoader loader = new URLClassLoader(new URL[] { url, }, 
-					Thread.currentThread().getContextClassLoader());
-			idToLoader.put(s.getId(), loader);
-		} catch (MalformedURLException murle) {
-			JBossServerCorePlugin.getDefault().getLog().log(
-					new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
-							"Cannot load JMX classes for server: " + s.getName(), murle));
-		}
-	}
-
-	/**
-	 * Are there any concerned citizens for this server?
-	 * @param server
-	 * @return
-	 */
-	protected boolean anyoneCares(IServer server) {
-		ArrayList<Object> list = idToConcerned.get(server.getId());
-		if( list != null && list.size() > 0 ) return true;
-		return false;
-	}
-}
Index: META-INF/MANIFEST.MF
===================================================================
--- META-INF/MANIFEST.MF	(revision 10148)
+++ META-INF/MANIFEST.MF	(working copy)
@@ -25,7 +25,6 @@
 Export-Package: org.jboss.ide.eclipse.as.core,
  org.jboss.ide.eclipse.as.core.extensions.descriptors,
  org.jboss.ide.eclipse.as.core.extensions.events,
- org.jboss.ide.eclipse.as.core.extensions.jmx,
  org.jboss.ide.eclipse.as.core.extensions.polling,
  org.jboss.ide.eclipse.as.core.modules,
  org.jboss.ide.eclipse.as.core.publishers,
