// The remoting connection was replaced by a new one..
// we have to set the connection state on the ConnectionListener to avoid leaks
remotingConnection.getConnectionListener().setConnectionState(this);
ConnectionDelegate newDelegate = (ConnectionDelegate)newState.getDelegate();
for(Iterator i = getChildren().iterator(); i.hasNext(); )
{
SessionState sessionState = (SessionState)i.next();
ClientSessionDelegate sessionDelegate = (ClientSessionDelegate)sessionState.getDelegate();
// create a new session on the new connection for each session on the old connection
ClientSessionDelegate newSessionDelegate = (ClientSessionDelegate)newDelegate.
createSessionDelegate(sessionState.isTransacted(),
sessionState.getAcknowledgeMode(),
sessionState.isXA(), sessionState.isCC());
sessionDelegate.synchronizeWith(newSessionDelegate);