1. /*
  2. * @(#)FullServantCacheLocalCRDImpl.java 1.20 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.protocol;
  8. import org.omg.CORBA.portable.ServantObject ;
  9. import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
  10. import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ;
  11. import com.sun.corba.se.spi.orb.ORB ;
  12. import com.sun.corba.se.spi.oa.OAInvocationInfo ;
  13. import com.sun.corba.se.spi.oa.OADestroyed ;
  14. import com.sun.corba.se.spi.ior.IOR;
  15. import com.sun.corba.se.spi.logging.CORBALogDomains;
  16. import com.sun.corba.se.impl.logging.POASystemException ;
  17. public class FullServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase
  18. {
  19. public FullServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior )
  20. {
  21. super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
  22. }
  23. public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
  24. String operation, Class expectedType )
  25. {
  26. OAInvocationInfo cachedInfo = getCachedInfo() ;
  27. if (!checkForCompatibleServant( cachedInfo, expectedType ))
  28. return null ;
  29. // Note that info is shared across multiple threads
  30. // using the same subcontract, each of which may
  31. // have its own operation. Therefore we need to clone it.
  32. OAInvocationInfo info = new OAInvocationInfo( cachedInfo, operation ) ;
  33. orb.pushInvocationInfo( info ) ;
  34. try {
  35. info.oa().enter() ;
  36. } catch (OADestroyed pdes) {
  37. throw wrapper.preinvokePoaDestroyed( pdes ) ;
  38. }
  39. return info ;
  40. }
  41. public void servant_postinvoke(org.omg.CORBA.Object self,
  42. ServantObject servantobj)
  43. {
  44. OAInvocationInfo cachedInfo = getCachedInfo() ;
  45. cachedInfo.oa().exit() ;
  46. orb.popInvocationInfo() ;
  47. }
  48. }