if (data.getServerIsORBActivated()) {
try {
Locator locator = LocatorHelper.narrow(
orb.resolve_initial_references(
ORBConstants.SERVER_LOCATOR_NAME )) ;
Activator activator = ActivatorHelper.narrow(
orb.resolve_initial_references(
ORBConstants.SERVER_ACTIVATOR_NAME )) ;
Collection serverEndpoints =
orb.getCorbaTransportManager().getAcceptors(null, null);
EndPointInfo[] endpointList =
new EndPointInfo[serverEndpoints.size()];
Iterator iterator = serverEndpoints.iterator();
int i = 0 ;
while (iterator.hasNext()) {
Object n = iterator.next();
if (! (n instanceof LegacyServerSocketEndPointInfo)) {
continue;
}
LegacyServerSocketEndPointInfo ep =
(LegacyServerSocketEndPointInfo) n;
// REVISIT - use exception instead of -1.
int port = locator.getEndpoint(ep.getType());
if (port == -1) {
port = locator.getEndpoint(SocketInfo.IIOP_CLEAR_TEXT);
if (port == -1) {
throw new Exception(
"ORBD must support IIOP_CLEAR_TEXT");
}
}
ep.setLocatorPort(port);
endpointList[i++] =
new EndPointInfo(ep.getType(), ep.getPort());
}
activator.registerEndpoints(
data.getPersistentServerId(), data.getORBId(),
endpointList);
} catch (Exception ex) {
throw wrapper.persistentServerInitError(
CompletionStatus.COMPLETED_MAYBE, ex ) ;