public Object handleCreateConnectionDelegate(Invocation inv) throws Throwable
{
CreateConnectionResult res = (CreateConnectionResult)inv.invokeNext();
ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)res.getDelegate();
if (connectionDelegate != null && connectionDelegate.getState() == null)
{
// no state set yet, initialize and configure it
if(trace) { log.trace(connectionDelegate + " not configured, configuring ..."); }
int serverID = connectionDelegate.getServerID();
Version versionToUse = connectionDelegate.getVersionToUse();
JMSRemotingConnection remotingConnection = connectionDelegate.getRemotingConnection();
if (versionToUse == null)
{
throw new IllegalStateException("Connection version is null");
}
ConnectionState connectionState =
new ConnectionState(serverID, connectionDelegate,
remotingConnection, versionToUse,
connectionDelegate.isEnableOrderingGroup(), connectionDelegate.getDefaultOrderingGroupName(),
connectionDelegate.getMaxRetryChangeRate(), connectionDelegate.getRetryChangeRateInterval(),
connectionDelegate.getMinTimeoutProcessTime());
remotingConnection.getConnectionListener().setConnectionState(connectionState);
remotingConnection.getConnectionListener().start();
connectionDelegate.setState(connectionState);
}
return res;
}