Author: rob.stryker(a)jboss.com
Date: 2008-03-07 17:01:13 -0500 (Fri, 07 Mar 2008)
New Revision: 6793
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
Log:
JBIDE-1646 - poller threw multiple dialogs
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2008-03-07
21:10:15 UTC (rev 6792)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2008-03-07
22:01:13 UTC (rev 6793)
@@ -117,19 +117,22 @@
new JMXEvent(event, b);
}
} catch (SecurityException se) {
- 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);
- setCredentials(user, pass);
- waitingForCredentials = false;
+ 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) {
Show replies by date