FileDocCategorySizeDatePackage
POAPolicyMediatorBase.javaAPI DocJava SE 5 API3635Fri Aug 26 14:54:26 BST 2005com.sun.corba.se.impl.oa.poa

POAPolicyMediatorBase

public abstract class POAPolicyMediatorBase extends Object implements POAPolicyMediator
Implementation of POARequesHandler that provides policy specific operations on the POA.

Fields Summary
protected POAImpl
poa
protected ORB
orb
private int
sysIdCounter
private Policies
policies
private DelegateImpl
delegateImpl
private int
serverid
private int
scid
protected boolean
isImplicit
protected boolean
isUnique
protected boolean
isSystemId
Constructors Summary
POAPolicyMediatorBase(Policies policies, POAImpl poa)

	if (policies.isSingleThreaded())
	    throw poa.invocationWrapper().singleThreadNotSupported() ;

	POAManagerImpl poam = (POAManagerImpl)(poa.the_POAManager()) ;
	POAFactory poaf = poam.getFactory() ;
	delegateImpl = (DelegateImpl)(poaf.getDelegateImpl()) ;
	this.policies = policies ;
	this.poa = poa ;
	orb = (ORB)poa.getORB() ;

	switch (policies.servantCachingLevel()) {
	    case ServantCachingPolicy.NO_SERVANT_CACHING :
		scid = ORBConstants.TRANSIENT_SCID ;
		break ;
	    case ServantCachingPolicy.FULL_SEMANTICS :
		scid = ORBConstants.SC_TRANSIENT_SCID ;
		break ;
	    case ServantCachingPolicy.INFO_ONLY_SEMANTICS :
		scid = ORBConstants.IISC_TRANSIENT_SCID ;
		break ;
	    case ServantCachingPolicy.MINIMAL_SEMANTICS :
		scid = ORBConstants.MINSC_TRANSIENT_SCID ;
		break ;
	}

	if ( policies.isTransient() ) {
	    serverid = orb.getTransientServerId();
	} else {
	    serverid = orb.getORBData().getPersistentServerId();
	    scid = ORBConstants.makePersistent( scid ) ;
	}

	isImplicit = policies.isImplicitlyActivated() ;
	isUnique = policies.isUniqueIds() ;
	isSystemId = policies.isSystemAssignedIds() ;

	sysIdCounter = 0 ; 
    
Methods Summary
public final java.lang.ObjectgetInvocationServant(byte[] id, java.lang.String operation)

	java.lang.Object result = internalGetServant( id, operation ) ;

	return result ;
    
public final com.sun.corba.se.impl.oa.poa.PoliciesgetPolicies()

	return policies ;
    
public final intgetScid()

	return scid ;
    
public final intgetServerId()

	return serverid ;
    
protected abstract java.lang.ObjectinternalGetServant(byte[] id, java.lang.String operation)

public synchronized byte[]newSystemId()

	if (!isSystemId)
	    throw new WrongPolicy() ;

	byte[] array = new byte[8];
	ORBUtility.intToBytes(++sysIdCounter, array, 0);
	ORBUtility.intToBytes( poa.getPOAId(), array, 4);
	return array;
    
protected final voidsetDelegate(org.omg.PortableServer.Servant servant, byte[] id)

        //This new servant delegate no longer needs the id for 
	// its initialization.
        servant._set_delegate(delegateImpl);