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

POAPolicyMediatorImpl_NR_USM

public class POAPolicyMediatorImpl_NR_USM extends POAPolicyMediatorBase
Implementation of POARequesHandler that provides policy specific operations on the POA.

Fields Summary
private ServantLocator
locator
Constructors Summary
POAPolicyMediatorImpl_NR_USM(Policies policies, POAImpl poa)

	super( policies, poa ) ;

	// assert !policies.retainServants() && policies.useServantManager()
	if (policies.retainServants())
	    throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ;

	if (!policies.useServantManager())
	    throw poa.invocationWrapper().policyMediatorBadPolicyInFactory() ;

	locator = null ;
    
Methods Summary
public final voidactivateObject(byte[] id, org.omg.PortableServer.Servant servant)

	throw new WrongPolicy();
    
public voidclearAOM()

	// NO-OP
    
public org.omg.PortableServer.ServantdeactivateObject(byte[] id)

	throw new WrongPolicy();
    
public voidetherealizeAll()

	
	// NO-OP
    
public org.omg.PortableServer.ServantgetDefaultServant()

	throw new WrongPolicy();
    
public org.omg.PortableServer.ServantManagergetServantManager()

	return locator ;
    
public org.omg.PortableServer.ServantidToServant(byte[] id)

	throw new WrongPolicy();
    
protected java.lang.ObjectinternalGetServant(byte[] id, java.lang.String operation)

 
	if (locator == null)
	    throw poa.invocationWrapper().poaNoServantManager() ;
    
	CookieHolder cookieHolder = orb.peekInvocationInfo().getCookieHolder() ;

	// Try - finally is J2EE requirement.
	java.lang.Object servant;
	try{
	    poa.unlock() ;

	    servant = locator.preinvoke(id, poa, operation, cookieHolder);
	    if (servant == null)
		servant = new NullServantImpl( poa.omgInvocationWrapper().nullServantReturned() ) ;
	    else
		setDelegate( (Servant)servant, id);
	} finally {
	    poa.lock() ;
	}

	return servant;
    
public voidreturnServant()

	OAInvocationInfo info = orb.peekInvocationInfo();
	if (locator == null)
	    return;

	try {
	    poa.unlock() ;
	    locator.postinvoke(info.id(), (POA)(info.oa()),
		info.getOperation(), info.getCookieHolder().value,
		(Servant)(info.getServantContainer()) );
	} finally {
	    poa.lock() ;
	}
    
public byte[]servantToId(org.omg.PortableServer.Servant servant)

	
	throw new WrongPolicy();
    
public voidsetDefaultServant(org.omg.PortableServer.Servant servant)

	throw new WrongPolicy();
    
public voidsetServantManager(org.omg.PortableServer.ServantManager servantManager)

	if (locator != null)
	    throw poa.invocationWrapper().servantManagerAlreadySet() ;

	if (servantManager instanceof ServantLocator)
	    locator = (ServantLocator)servantManager;
	else
	    throw poa.invocationWrapper().servantManagerBadType() ;