Author: rob.stryker(a)jboss.com
Date: 2012-05-14 15:02:09 -0400 (Mon, 14 May 2012)
New Revision: 41000
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.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossJMXConnectionProviderModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java
Log:
JBIDE-11825
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-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -37,7 +37,6 @@
* @author André Dietisheim
*/
public class JBoss7ManagerServicePoller implements IServerStatePoller2 {
-
public static final String POLLER_ID =
"org.jboss.ide.eclipse.as.core.server.JBoss7ManagerServicePoller";
//$NON-NLS-1$
private IServer server;
private AS7ManagementDetails managementDetails;
@@ -71,27 +70,55 @@
};
}
+ private synchronized void setRequiredProperties(List<String> props) {
+ this.requiredProperties = props;
+ }
+ private synchronized void setRequiredInfoException(RequiresInfoException e) {
+ this.requiresInfoException = e;
+ }
+
+ private synchronized void setPollingException(PollingException e) {
+ this.pollingException = e;
+ }
+
+ private synchronized Properties getRequiredPropertiesReturned() {
+ return requiredPropertiesReturned;
+ }
+
+ private synchronized boolean getDone() {
+ return done;
+ }
+
+ private synchronized void setDone(boolean done) {
+ this.done = done;
+ }
+
+ private synchronized boolean getCanceled() {
+ return canceled;
+ }
+
private String[] handleAsynchCallbacks(String[] prompts) {
List<String> tmp = new ArrayList<String>();
tmp.addAll(Arrays.asList(prompts));
- requiredProperties = tmp;
- requiresInfoException = new RequiresInfoException("Requires proper
credentials"); //$NON-NLS-1$
- while( !done && !canceled && requiredPropertiesReturned == null ) {
+ setRequiredProperties(tmp);
+ RequiresInfoException e2 = new RequiresInfoException("Requires proper
credentials"); //$NON-NLS-1$
+ setRequiredInfoException(e2);
+ while( !getDone() && !getCanceled() && getRequiredPropertiesReturned()
== null ) {
try {
Thread.sleep(500);
} catch(InterruptedException ie) {/* Do nothing */}
}
- if( done || canceled )
+ if( getDone() || getCanceled() )
return new String[0];
String[] retPrompts = new String[prompts.length];
for( int i = 0; i < retPrompts.length; i++) {
- retPrompts[i] = (String)requiredPropertiesReturned.get(prompts[i]);
+ retPrompts[i] = (String)getRequiredPropertiesReturned().get(prompts[i]);
}
// If not cleared then it will keep asking for username/password
- requiresInfoException = null;
+ setRequiredInfoException(null);
return retPrompts;
}
@@ -108,7 +135,7 @@
return server;
}
- public boolean isComplete() throws PollingException, RequiresInfoException {
+ public synchronized boolean isComplete() throws PollingException, RequiresInfoException
{
if (pollingException != null)
throw pollingException;
if( requiresInfoException != null )
@@ -116,7 +143,7 @@
return done;
}
- public boolean getState() throws PollingException, RequiresInfoException {
+ public synchronized boolean getState() throws PollingException, RequiresInfoException {
if( done )
return expectedState;
return !expectedState;
@@ -132,13 +159,13 @@
public void runLoop() {
try {
- while( !done && !canceled ) {
+ while( !getDone() && !getCanceled() ) {
if (expectedState == SERVER_DOWN) {
- done = checkShutdown(service);
+ setDone(checkShutdown(service));
} else {
- done = checkRunning(service);
+ setDone(checkRunning(service));
}
- if( !done ) {
+ if( !getDone() ) {
try {
Thread.sleep(300);
} catch(InterruptedException ie) {
@@ -147,7 +174,7 @@
}
}
} catch (Exception e) {
- pollingException = new PollingException(e.getMessage());
+ setPollingException(new PollingException(e.getMessage()));
}
}
@@ -176,15 +203,15 @@
JBoss7ManagerUtil.dispose(service);
}
- public List<String> getRequiredProperties() {
+ public synchronized List<String> getRequiredProperties() {
return requiredProperties == null ? new ArrayList<String>() :
requiredProperties;
}
- public void provideCredentials(Properties properties) {
+ public synchronized void provideCredentials(Properties properties) {
requiredPropertiesReturned = properties;
}
- public void cancel(int type) {
+ public synchronized void cancel(int type) {
canceled = true;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -57,10 +57,13 @@
public void serverChanged(IServer server) {
if( belongsHere(server)) {
getConnections();
- IConnectionWrapper connection = createConnection(server);
- idToConnection.put(server.getId(), connection);
- if( connection != null )
- fireAdded(idToConnection.get(server.getId()));
+ Object o = idToConnection.get(server.getId());
+ if( o == null ) {
+ IConnectionWrapper connection = createConnection(server);
+ idToConnection.put(server.getId(), connection);
+ if( connection != null )
+ fireAdded(idToConnection.get(server.getId()));
+ }
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -81,8 +81,8 @@
super.cleanupConnection(server, connection);
if( connectionToConnector.get(connection) != null ) {
try {
+ connectionToConnector.get(connection).close();
connectionToConnector.remove(connection);
- connectionToConnector.get(connection).close();
} catch(Exception e) { /* Ignore */ }
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossJMXConnectionProviderModel.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossJMXConnectionProviderModel.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossJMXConnectionProviderModel.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -40,7 +40,9 @@
}
public void registerProvider(int type, AbstractJBossJMXConnectionProvider provider) {
- initProviders();
+ if( providers == null) {
+ providers = new HashMap<Integer, AbstractJBossJMXConnectionProvider>();
+ }
providers.put(type, provider);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBossServerConnection.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -213,7 +213,7 @@
connectToStartedServer();
return Status.OK_STATUS;
}
- }.schedule();
+ }.schedule(5000);
}
protected void connectToStartedServer() {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.management.as71/src/org/jboss/ide/eclipse/as/internal/management/as71/AS71Manager.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -264,7 +264,11 @@
}
public void dispose() {
- StreamUtils.safeClose(client);
+ new Thread("Closing AS7 Management Streams") {
+ public void run() {
+ StreamUtils.safeClose(client);
+ }
+ }.start();
}
/*package*/ ModelNode execute(ModelNode node) throws JBoss7ManangerException {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java 2012-05-14
18:59:52 UTC (rev 40999)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEJBoss7StartLaunchDelegate.java 2012-05-14
19:02:09 UTC (rev 41000)
@@ -37,7 +37,6 @@
}
String command = RSELaunchConfigProperties.getStartupCommand(configuration);
executeRemoteCommand(command, beh);
- launchPingThread(beh);
}
@Override