// generate a FAILOVER_STARTED event. The event must be broadcasted AFTER valve closure,
// to insure the client-side stack is in a deterministic state
broadcastFailoverEvent(new FailoverEvent(FailoverEvent.FAILOVER_STARTED, this));
int failedNodeID = state.getServerID();
ConnectionFactoryDelegate clusteredDelegate =
state.getClusteredConnectionFactoryDelegate();
// re-try creating the connection
res = clusteredDelegate.
createConnectionDelegate(state.getUsername(), state.getPassword(), failedNodeID);
if (res == null)
{
// No failover attempt was detected on the server side; this might happen if the