}
catch( WrongAdapter e )
{
// exit on an error condition, but need to clean up first (added to fix bug #400)
poa.removeLocalRequest();
throw new OBJ_ADAPTER( "WrongAdapter caught when converting servant to reference. " + e );
}
catch( WrongPolicy e )
{
// exit on an error condition, but need to clean up first (added to fix bug #400)
poa.removeLocalRequest();
throw new OBJ_ADAPTER("WrongPolicy caught" + e );
}
catch( ObjectNotActive e )
{
// exit on an error condition, but need to clean up first (added to fix bug #400)
poa.removeLocalRequest();
throw new org.omg.CORBA.OBJECT_NOT_EXIST();
}
}
else if ( poa.isUseServantManager() )
{
byte [] oid =
POAUtil.extractOID( getParsedIOR().get_object_key() );
org.omg.PortableServer.ServantManager sm =
poa.get_servant_manager();
if ( poa.isRetain() )
{
// ServantManager is a ServantActivator. Use the AOM to
// incarnate this or return the servant. It will correctly
// synchrnoize the requests.
so.servant = poa._incarnateServant(oid, (ServantActivator)sm);
}
else
{
// ServantManager is a ServantLocator:
// locate a servant
org.omg.PortableServer.ServantLocator sl =
( org.omg.PortableServer.ServantLocator ) sm;
// store this for postinvoke
cookie =
new org.omg.PortableServer.ServantLocatorPackage.CookieHolder();
invokedOperation = operation;
boolean ok = false;
try
{
so.servant =
sl.preinvoke( oid, poa, operation, cookie );
ok = true;
}
finally
{
if (!ok)
{
// error condition: need to clean up before
// propagating the exception (added to fix
// bug #400)
poa.removeLocalRequest();
}
}
}
}
else
{
throw new INTERNAL("Internal error: we should not have gotten to this piece of code!");
}
}
catch( WrongPolicy e )
{
// exit on an error condition, but need to clean up first (added to fix bug #400)
poa.removeLocalRequest();
throw new OBJ_ADAPTER( "WrongPolicy caught" + e );
}
catch( org.omg.PortableServer.ForwardRequest e )
{
if( logger.isDebugEnabled() )
{