* the ContactInfoList/Acceptor *AND* the legacy SocketFactory
* transport architecture.
*/
private void initializeTransport(final ORB orb)
{
ORBData od = orb.getORBData();
CorbaContactInfoListFactory contactInfoListFactory =
od.getCorbaContactInfoListFactory();
Acceptor[] acceptors = od.getAcceptors();
// BEGIN Legacy
ORBSocketFactory legacySocketFactory = od.getLegacySocketFactory();
USLPort[] uslPorts = od.getUserSpecifiedListenPorts() ;
setLegacySocketFactoryORB(orb, legacySocketFactory);
// END Legacy
//
// Check for incorrect configuration.
//
if (legacySocketFactory != null && contactInfoListFactory != null) {
throw wrapper.socketFactoryAndContactInfoListAtSameTime();
}
if (acceptors.length != 0 && legacySocketFactory != null) {
throw wrapper.acceptorsAndLegacySocketFactoryAtSameTime();
}
//
// Client and Server side setup.
//
od.getSocketFactory().setORB(orb);
//
// Set up client side.
//
if (legacySocketFactory != null) {
// BEGIN Legacy
// Since the user specified a legacy socket factory we need to
// use a ContactInfoList that will use the legacy socket factory.
contactInfoListFactory =
new CorbaContactInfoListFactory() {
public void setORB(ORB orb) { }
public CorbaContactInfoList create( IOR ior ) {
return new SocketFactoryContactInfoListImpl(
orb, ior);
}
};
// END Legacy
} else if (contactInfoListFactory != null) {
// The user specified an explicit ContactInfoListFactory.
contactInfoListFactory.setORB(orb);
} else {
// Use the default.
contactInfoListFactory =
TransportDefault.makeCorbaContactInfoListFactory(orb);
}
orb.setCorbaContactInfoListFactory(contactInfoListFactory);
//
// Set up server side.
//
//
// Maybe allocate the Legacy default listener.
//
// If old legacy properties set, or there are no explicit
// acceptors then register a default listener. Type of
// default listener depends on presence of legacy socket factory.
//
// Note: this must happen *BEFORE* registering explicit acceptors.
//
// BEGIN Legacy
int port = -1;
if (od.getORBServerPort() != 0) {
port = od.getORBServerPort();
} else if (od.getPersistentPortInitialized()) {
port = od.getPersistentServerPort();
} else if (acceptors.length == 0) {
port = 0;
}
if (port != -1) {
createAndRegisterAcceptor(orb, legacySocketFactory, port,
LegacyServerSocketEndPointInfo.DEFAULT_ENDPOINT,
SocketInfo.IIOP_CLEAR_TEXT);
}
// END Legacy
for (int i = 0; i < acceptors.length; i++) {
orb.getCorbaTransportManager().registerAcceptor(acceptors[i]);
}
// BEGIN Legacy
// Allocate user listeners.
USLPort[] ports = od.getUserSpecifiedListenPorts() ;
if (ports != null) {
for (int i = 0; i < ports.length; i++) {
createAndRegisterAcceptor(
orb, legacySocketFactory, ports[i].getPort(),
LegacyServerSocketEndPointInfo.NO_NAME,