[jbosstools-commits] JBoss Tools SVN: r43738 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: extensions/polling and 4 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Sep 17 00:00:02 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-09-17 00:00:02 -0400 (Mon, 17 Sep 2012)
New Revision: 43738

Added:
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePollerType.java
Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java
Log:
JBIDE-12613 creation of IServerStatePollerType

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/ExtensionManager.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -34,6 +34,8 @@
 import org.jboss.ide.eclipse.as.core.server.IProvideCredentials;
 import org.jboss.ide.eclipse.as.core.server.IServerAlreadyStartedHandler;
 import org.jboss.ide.eclipse.as.core.server.IServerProvider;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
 
 /**
@@ -73,14 +75,14 @@
 	 * @param id the id
 	 * @return the poller
 	 */
-	public ServerStatePollerType getPollerType(String id) {
+	public IServerStatePollerType getPollerType(String id) {
 		if( pollers == null ) 
 			loadPollers();
 		return pollers.get(id);
 	}
 	
 	/** Get only the pollers that can poll for startups */
-	public ServerStatePollerType[] getStartupPollers(IServerType serverType) {
+	public IServerStatePollerType[] getStartupPollers(IServerType serverType) {
 		if( pollers == null ) 
 			loadPollers();
 		ArrayList<ServerStatePollerType> list = new ArrayList<ServerStatePollerType>();
@@ -95,7 +97,7 @@
 	}
 	
 	/** Get only the pollers that can poll for shutdowns */
-	public ServerStatePollerType[] getShutdownPollers(IServerType serverType) {
+	public IServerStatePollerType[] getShutdownPollers(IServerType serverType) {
 		if( pollers == null ) 
 			loadPollers();
 		ArrayList<ServerStatePollerType> list = new ArrayList<ServerStatePollerType>();
@@ -110,7 +112,7 @@
 	}
 	
 
-	protected boolean pollerSupportsServerType(ServerStatePollerType type, IServerType serverType) {
+	protected boolean pollerSupportsServerType(IServerStatePollerType type, IServerType serverType) {
 		String sTypes = type.getServerTypes();
 		if(sTypes == null || sTypes.equals("")) //$NON-NLS-1$
 			return true;

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/ProcessTerminatedPoller.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -17,8 +17,8 @@
 import org.eclipse.wst.server.core.IServer;
 import org.jboss.ide.eclipse.as.core.server.IProcessProvider;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
 
 /**
  * Essentially does nothing because the process already has a listener
@@ -33,7 +33,7 @@
 
 	public static final String POLLER_ID = "org.jboss.ide.eclipse.as.core.runtime.server.processTerminatedPoller"; //$NON-NLS-1$
 	
-	private ServerStatePollerType type;
+	private IServerStatePollerType type;
 	private IServer server;
 	
 	public void beginPolling(IServer server, boolean expectedState) {
@@ -73,11 +73,11 @@
 		return null;
 	}
 	
-	public ServerStatePollerType getPollerType() {
+	public IServerStatePollerType getPollerType() {
 		return type;
 	}
 
-	public void setPollerType(ServerStatePollerType type) {
+	public void setPollerType(IServerStatePollerType type) {
 		this.type = type;
 	}
 

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/TimeoutPoller.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -16,8 +16,7 @@
 
 import org.eclipse.wst.server.core.IServer;
 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.server.IServerStatePollerType;
 
 /**
  * Wait 15 seconds, then say it's at it's expected state
@@ -30,7 +29,7 @@
 	private boolean expectedState;
 	private long endTime;
 	private IServer server;
-	private ServerStatePollerType type;
+	private IServerStatePollerType type;
 
 	public void beginPolling(IServer server, boolean expectedState) {
 		this.expectedState = expectedState;
@@ -72,11 +71,11 @@
 		return null;
 	}
 	
-	public ServerStatePollerType getPollerType() {
+	public IServerStatePollerType getPollerType() {
 		return type;
 	}
 
-	public void setPollerType(ServerStatePollerType type) {
+	public void setPollerType(IServerStatePollerType type) {
 		this.type = type;
 	}
 

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/WebPortPoller.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -27,8 +27,8 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller2;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.util.ServerConverter;
 import org.jboss.ide.eclipse.as.core.util.ServerUtil;
 
@@ -36,7 +36,7 @@
 
 	public static final String WEB_POLLER_ID = "org.jboss.ide.eclipse.as.core.runtime.server.WebPoller"; //$NON-NLS-1$
 	private IServer server;
-	private ServerStatePollerType type;
+	private IServerStatePollerType type;
 	private boolean canceled, done;
 	private boolean state;
 	private boolean expectedState;
@@ -112,11 +112,11 @@
 		return false;
 	}
 	
-	public ServerStatePollerType getPollerType() {
+	public IServerStatePollerType getPollerType() {
 		return type;
 	}
 
-	public void setPollerType(ServerStatePollerType type) {
+	public void setPollerType(IServerStatePollerType type) {
 		this.type = type;
 	}
 

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePoller.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -12,7 +12,6 @@
 
 import org.eclipse.wst.server.core.IServer;
 import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
 
 /**
  * A server state poller will 
@@ -46,8 +45,8 @@
 	 */
 	public static final int TIMEOUT_BEHAVIOR_FAIL = 2;
 	
-	public ServerStatePollerType getPollerType();
-	public void setPollerType(ServerStatePollerType type);
+	public IServerStatePollerType getPollerType();
+	public void setPollerType(IServerStatePollerType type);
 	/*
 	 * expected to launch own thread
 	 */

Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePollerType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePollerType.java	                        (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerStatePollerType.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -0,0 +1,11 @@
+package org.jboss.ide.eclipse.as.core.server;
+
+
+public interface IServerStatePollerType {
+	public boolean supportsStartup();
+	public boolean supportsShutdown();
+	public String getName();
+	public String getId(); 
+	public String getServerTypes();
+	public IServerStatePoller createPoller(); 
+}

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerStatePollerType.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -18,13 +18,14 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 
 /**
  * A wrapper for pollers
  * @author Rob Stryker rob.stryker at redhat.com
  *
  */
-public class ServerStatePollerType {
+public class ServerStatePollerType implements IServerStatePollerType {
 	private IConfigurationElement el;
 	public ServerStatePollerType(IConfigurationElement el) {
 		this.el = el;

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -25,7 +25,7 @@
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller2;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
 import org.jboss.ide.eclipse.as.management.core.IJBoss7ManagerService;
 import org.jboss.ide.eclipse.as.management.core.JBoss7ManagerUtil;
@@ -40,7 +40,7 @@
 	public static final String POLLER_ID = "org.jboss.ide.eclipse.as.core.server.JBoss7ManagerServicePoller"; //$NON-NLS-1$
 	private IServer server;
 	private AS7ManagementDetails managementDetails;
-	private ServerStatePollerType type;
+	private IServerStatePollerType type;
 	private boolean expectedState;
 	private IJBoss7ManagerService service;
 	private boolean done = false;
@@ -126,11 +126,11 @@
 		return retPrompts;
 	}
 	
-	public ServerStatePollerType getPollerType() {
+	public IServerStatePollerType getPollerType() {
 		return type;
 	}
 
-	public void setPollerType(ServerStatePollerType type) {
+	public void setPollerType(IServerStatePollerType type) {
 		this.type = type;
 	}
 

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java	2012-09-16 17:45:00 UTC (rev 43737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/PollThreadUtils.java	2012-09-17 04:00:02 UTC (rev 43738)
@@ -24,12 +24,11 @@
 import org.jboss.ide.eclipse.as.core.server.IServerProvider;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
 import org.jboss.ide.eclipse.as.core.server.IServerStatePoller2;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePollerType;
 import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
 import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
 import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
 import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerStatePollerType;
-import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
 
 /**
  * @author Rob Stryker
@@ -70,13 +69,13 @@
 	}
 
 	/**
-	 * Returns the poller for the given poller id. 
+	 * Returns a new poller instance for the given poller type id. 
 	 * 
 	 * @param pollerId the id of the poller to use
 	 * @return the poller for the given id
 	 */
 	public static IServerStatePoller getPoller(String pollerId) {
-		ServerStatePollerType type = ExtensionManager.getDefault().getPollerType(pollerId);
+		IServerStatePollerType type = ExtensionManager.getDefault().getPollerType(pollerId);
 		if (type != null) {
 			IServerStatePoller tempPoller = type.createPoller();
 			tempPoller.setPollerType(type);



More information about the jbosstools-commits mailing list