1. /*
  2. * @(#)InfoOnlyServantCacheLocalCRDImpl.java 1.14 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.oa.OAInvocationInfo ;
  10. import com.sun.corba.se.spi.orb.ORB ;
  11. import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcherFactory ;
  12. import com.sun.corba.se.spi.protocol.LocalClientRequestDispatcher ;
  13. import com.sun.corba.se.spi.ior.IOR;
  14. public class InfoOnlyServantCacheLocalCRDImpl extends ServantCacheLocalCRDBase
  15. {
  16. public InfoOnlyServantCacheLocalCRDImpl( ORB orb, int scid, IOR ior )
  17. {
  18. super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
  19. }
  20. public ServantObject servant_preinvoke( org.omg.CORBA.Object self,
  21. String operation, Class expectedType )
  22. {
  23. OAInvocationInfo cachedInfo = getCachedInfo() ;
  24. if (!checkForCompatibleServant( cachedInfo, expectedType ))
  25. return null ;
  26. // Note that info is shared across multiple threads
  27. // using the same subcontract, each of which may
  28. // have its own operation. Therefore we need to copy it.
  29. OAInvocationInfo info = new OAInvocationInfo(cachedInfo, operation) ;
  30. orb.pushInvocationInfo( info ) ;
  31. return info ;
  32. }
  33. public void servant_postinvoke(org.omg.CORBA.Object self,
  34. ServantObject servantobj)
  35. {
  36. orb.popInvocationInfo() ;
  37. }
  38. }