FileDocCategorySizeDatePackage
RequestDispatcherRegistryImpl.javaAPI DocJava SE 5 API5638Fri Aug 26 14:54:30 BST 2005com.sun.corba.se.impl.protocol

RequestDispatcherRegistryImpl

public class RequestDispatcherRegistryImpl extends Object implements com.sun.corba.se.spi.protocol.RequestDispatcherRegistry
This is a registry of all subcontract ID dependent objects. This includes: LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerSubcontract, and ObjectAdapterFactory.

Fields Summary
private com.sun.corba.se.spi.orb.ORB
orb
protected int
defaultId
private com.sun.corba.se.impl.orbutil.DenseIntMapImpl
SDRegistry
private com.sun.corba.se.impl.orbutil.DenseIntMapImpl
CSRegistry
private com.sun.corba.se.impl.orbutil.DenseIntMapImpl
OAFRegistry
private com.sun.corba.se.impl.orbutil.DenseIntMapImpl
LCSFRegistry
private Set
objectAdapterFactories
private Set
objectAdapterFactoriesView
private Map
stringToServerSubcontract
Constructors Summary
public RequestDispatcherRegistryImpl(com.sun.corba.se.spi.orb.ORB orb, int defaultId)

	this.orb = orb;
        this.defaultId = defaultId;
        SDRegistry = new DenseIntMapImpl() ;
        CSRegistry = new DenseIntMapImpl() ;
	OAFRegistry = new DenseIntMapImpl() ;
	LCSFRegistry = new DenseIntMapImpl() ;
	objectAdapterFactories = new HashSet() ;
	objectAdapterFactoriesView = Collections.unmodifiableSet( objectAdapterFactories ) ;
	stringToServerSubcontract = new HashMap() ;
    
Methods Summary
public com.sun.corba.se.pept.protocol.ClientRequestDispatchergetClientRequestDispatcher(int scid)

	ClientRequestDispatcher subcontract = 
	    (ClientRequestDispatcher)(CSRegistry.get(scid)) ;
	if (subcontract == null) {
	    subcontract = (ClientRequestDispatcher)(CSRegistry.get(defaultId)) ;
	}

	return subcontract ;
    
public com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactorygetLocalClientRequestDispatcherFactory(int scid)

	LocalClientRequestDispatcherFactory factory = 
	    (LocalClientRequestDispatcherFactory)(LCSFRegistry.get(scid)) ;
	if (factory == null) {
	    factory = (LocalClientRequestDispatcherFactory)(LCSFRegistry.get(defaultId)) ;
	}

	return factory ;
    
public java.util.SetgetObjectAdapterFactories()

	return objectAdapterFactoriesView ;
    
public com.sun.corba.se.spi.oa.ObjectAdapterFactorygetObjectAdapterFactory(int scid)

	ObjectAdapterFactory oaf =
            (ObjectAdapterFactory)(OAFRegistry.get(scid)) ;
	if ( oaf == null )
            oaf = (ObjectAdapterFactory)(OAFRegistry.get(defaultId)) ;

	return oaf;
    
public com.sun.corba.se.spi.protocol.CorbaServerRequestDispatchergetServerRequestDispatcher(int scid)

	CorbaServerRequestDispatcher sdel =
	    (CorbaServerRequestDispatcher)(SDRegistry.get(scid)) ;
	if ( sdel == null )
            sdel = (CorbaServerRequestDispatcher)(SDRegistry.get(defaultId)) ;

	return sdel;
    
public com.sun.corba.se.spi.protocol.CorbaServerRequestDispatchergetServerRequestDispatcher(java.lang.String name)

	CorbaServerRequestDispatcher sdel =
	    (CorbaServerRequestDispatcher)stringToServerSubcontract.get( name ) ;

	if ( sdel == null )
            sdel = (CorbaServerRequestDispatcher)(SDRegistry.get(defaultId)) ;

	return sdel;
    
public synchronized voidregisterClientRequestDispatcher(com.sun.corba.se.pept.protocol.ClientRequestDispatcher csc, int scid)

	CSRegistry.set( scid, csc ) ;
    
public synchronized voidregisterLocalClientRequestDispatcherFactory(com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory csc, int scid)

	LCSFRegistry.set( scid, csc ) ;
    
public synchronized voidregisterObjectAdapterFactory(com.sun.corba.se.spi.oa.ObjectAdapterFactory oaf, int scid)

	objectAdapterFactories.add( oaf ) ;
	OAFRegistry.set( scid, oaf ) ;
    
public synchronized voidregisterServerRequestDispatcher(com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher ssc, int scid)

	SDRegistry.set( scid, ssc ) ;
    
public synchronized voidregisterServerRequestDispatcher(com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher scc, java.lang.String name)

	stringToServerSubcontract.put( name, scc ) ;