if (o instanceof SocketCreationListener)
{
SocketCreationListener listener = (SocketCreationListener) o;
if (secondaryServerSocket instanceof CreationListenerServerSocket)
{
CreationListenerServerSocket clss = (CreationListenerServerSocket) secondaryServerSocket;
clss.setListener(listener);
}
else
{
secondaryServerSocket = new CreationListenerServerSocket(secondaryServerSocket, listener);
}
}
else
{
log.error("socket creation listener of invalid type: " + o);
}
}
else
{
if (secondaryServerSocket instanceof CreationListenerServerSocket)
{
CreationListenerServerSocket clss = (CreationListenerServerSocket) secondaryServerSocket;
secondaryServerSocket = clss.getServerSocket();
}
}
return secondaryServerSocket;
}