FileDocCategorySizeDatePackage
LegacyServerSocketManagerImpl.javaAPI DocJava SE 5 API5118Fri Aug 26 14:54:24 BST 2005com.sun.corba.se.impl.legacy.connection

LegacyServerSocketManagerImpl

public class LegacyServerSocketManagerImpl extends Object implements com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager

Fields Summary
protected com.sun.corba.se.spi.orb.ORB
orb
private com.sun.corba.se.impl.logging.ORBUtilSystemException
wrapper
Constructors Summary
public LegacyServerSocketManagerImpl(com.sun.corba.se.spi.orb.ORB orb)

	this.orb = orb;
	wrapper = ORBUtilSystemException.get( orb,
	    CORBALogDomains.RPC_TRANSPORT ) ;
    
Methods Summary
private com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfocast(java.lang.Object o)

	if (o instanceof LegacyServerSocketEndPointInfo) {
	    return (LegacyServerSocketEndPointInfo) o;
	}
	return null;
    
protected voiddprint(java.lang.String msg)

	ORBUtility.dprint("LegacyServerSocketManagerImpl", msg);
    
private java.util.IteratorgetAcceptorIterator()

        Collection acceptors = 
	    orb.getCorbaTransportManager().getAcceptors(null, null);
        if (acceptors != null) {
            return acceptors.iterator();
	}

	throw wrapper.getServerPortCalledBeforeEndpointsInitialized() ;
    
public synchronized com.sun.corba.se.spi.legacy.connection.LegacyServerSocketEndPointInfolegacyGetEndpoint(java.lang.String name)

	Iterator iterator = getAcceptorIterator();
	while (iterator.hasNext()) {
	    LegacyServerSocketEndPointInfo endPoint = cast(iterator.next());
	    if (endPoint != null && name.equals(endPoint.getName())) {
		return endPoint;
	    }
	}
	throw new INTERNAL("No acceptor for: " + name);
    
public synchronized intlegacyGetPersistentServerPort(java.lang.String socketType)

	if (orb.getORBData().getServerIsORBActivated()) {
	    // this server is activated by orbd
	    return legacyGetServerPort(socketType, true);
	} else if (orb.getORBData().getPersistentPortInitialized()) {
	    // this is a user-activated server
	    return orb.getORBData().getPersistentServerPort();
	} else {
	    throw wrapper.persistentServerportNotSet( 
		CompletionStatus.COMPLETED_MAYBE);
	}
    
private intlegacyGetServerPort(java.lang.String socketType, boolean isPersistent)

	Iterator endpoints = getAcceptorIterator();
	while (endpoints.hasNext()) {
	    LegacyServerSocketEndPointInfo ep = cast(endpoints.next());
	    if (ep != null && ep.getType().equals(socketType)) {
		if (isPersistent) {
		    return ep.getLocatorPort();
		} else {
		    return ep.getPort();
		}
	    }
	}
	return -1;
    
public synchronized intlegacyGetTransientOrPersistentServerPort(java.lang.String socketType)

	    return legacyGetServerPort(socketType, 
				       orb.getORBData()
				       .getServerIsORBActivated());
    
public intlegacyGetTransientServerPort(java.lang.String type)

	return legacyGetServerPort(type, false);
    
public booleanlegacyIsLocalServerPort(int port)

	Iterator iterator = getAcceptorIterator();
	while (iterator.hasNext()) { 
	    LegacyServerSocketEndPointInfo endPoint = cast(iterator.next());
	    if (endPoint != null && endPoint.getPort() == port) {
		return true;
	    }
	}
        return false;