return false;
} else if (state == Connection.STATE_CONNECTED) {
interval = Globals.getConfig().getLongProperty(
Globals.IMQ + ".authentication.client.response.timeout",
DEFAULT_INTERVAL);
MQTimer timer = Globals.getTimer(true);
stateWatcher = new StateWatcher(Connection.STATE_INITIALIZED, this);
try {
timer.schedule(stateWatcher, interval*1000);
} catch (IllegalStateException ex) {
logger.log(Logger.DEBUG,"InternalError: timer canceled ", ex);
}
} else if (state == Connection.STATE_INITIALIZED
|| state == Connection.STATE_AUTH_REQUESTED
|| state == Connection.STATE_AUTH_RESPONSED) {
if (stateWatcher != null) {
try {
stateWatcher.cancel();
} catch (IllegalStateException ex) {
logger.log(Logger.DEBUG,"Error setting state on "+
" connection " + this + " to state " +
state, ex);
}
stateWatcher = null;
}
// if next state not from client, return
if (state == Connection.STATE_INITIALIZED) {
return true;
}
if (state == Connection.STATE_AUTH_RESPONSED) {
return true;
}
MQTimer timer = Globals.getTimer(true);
stateWatcher = new StateWatcher(
Connection.STATE_AUTH_RESPONSED, this);
try {
timer.schedule(stateWatcher, interval*1000);
} catch (IllegalStateException ex) {
logger.log(Logger.DEBUG,"InternalError: timer canceled ", ex);
}
} else if (state >= Connection.STATE_AUTHENTICATED
|| state == Connection.STATE_UNAVAILABLE)