1 7 8 package com.sun.corba.se.impl.protocol; 9 10 import org.omg.CORBA.BAD_OPERATION ; 11 import org.omg.CORBA.INTERNAL ; 12 import org.omg.CORBA.SystemException ; 13 import org.omg.CORBA.CompletionStatus ; 14 15 import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher; 16 import com.sun.corba.se.spi.protocol.ForwardException; 17 18 import com.sun.corba.se.impl.protocol.LocalClientRequestDispatcherBase; 20 21 import com.sun.corba.se.spi.oa.OAInvocationInfo; 22 import com.sun.corba.se.spi.oa.ObjectAdapter; 23 import com.sun.corba.se.spi.oa.OADestroyed; 24 25 import com.sun.corba.se.spi.orb.ORB; 26 27 import com.sun.corba.se.spi.ior.IOR ; 28 29 import com.sun.corba.se.spi.logging.CORBALogDomains ; 30 31 import com.sun.corba.se.impl.logging.POASystemException; 32 33 public abstract class ServantCacheLocalCRDBase extends LocalClientRequestDispatcherBase 34 { 35 36 private OAInvocationInfo cachedInfo ; 37 protected POASystemException wrapper ; 38 39 protected ServantCacheLocalCRDBase( ORB orb, int scid, IOR ior ) 40 { 41 super( orb, scid, ior ) ; 42 wrapper = POASystemException.get( orb, 43 CORBALogDomains.RPC_PROTOCOL ) ; 44 } 45 46 protected synchronized OAInvocationInfo getCachedInfo() 47 { 48 if (!servantIsLocal) 49 throw wrapper.servantMustBeLocal() ; 50 51 if (cachedInfo == null) { 52 ObjectAdapter oa = oaf.find( oaid ) ; 53 cachedInfo = oa.makeInvocationInfo( objectId ) ; 54 55 orb.pushInvocationInfo( cachedInfo ) ; 57 58 try { 59 oa.enter( ); 60 oa.getInvocationServant( cachedInfo ) ; 61 } catch (ForwardException freq) { 62 throw wrapper.illegalForwardRequest( freq ) ; 63 } catch( OADestroyed oades ) { 64 throw wrapper.adapterDestroyed( oades ) ; 67 } finally { 68 oa.returnServant( ); 69 oa.exit( ); 70 orb.popInvocationInfo() ; 71 } 72 } 73 74 return cachedInfo ; 75 } 76 } 77 78 | Popular Tags |