1. /*
  2. * @(#)JIDLLocalCRDImpl.java 1.15 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 javax.rmi.CORBA.Tie;
  9. import org.omg.CORBA.portable.ServantObject;
  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. import com.sun.corba.se.impl.protocol.LocalClientRequestDispatcherBase ;
  15. import com.sun.corba.se.pept.broker.Broker;
  16. public class JIDLLocalCRDImpl extends LocalClientRequestDispatcherBase
  17. {
  18. public JIDLLocalCRDImpl( ORB orb, int scid, IOR ior )
  19. {
  20. super( (com.sun.corba.se.spi.orb.ORB)orb, scid, ior ) ;
  21. }
  22. protected ServantObject servant;
  23. public ServantObject servant_preinvoke(org.omg.CORBA.Object self,
  24. String operation,
  25. Class expectedType)
  26. {
  27. if (!checkForCompatibleServant( servant, expectedType ))
  28. return null ;
  29. return servant;
  30. }
  31. public void servant_postinvoke( org.omg.CORBA.Object self,
  32. ServantObject servant )
  33. {
  34. // NO-OP
  35. }
  36. // REVISIT - This is called from TOAImpl.
  37. public void setServant( java.lang.Object servant )
  38. {
  39. if (servant != null && servant instanceof Tie) {
  40. this.servant = new ServantObject();
  41. this.servant.servant = ((Tie)servant).getTarget();
  42. } else {
  43. this.servant = null;
  44. }
  45. }
  46. public void unexport() {
  47. // DO NOT set the IOR to null. (Un)exporting is only concerns
  48. // the servant not the IOR. If the ior is set to null then
  49. // null pointer exceptions happen during an colocated invocation.
  50. // It is better to let the invocation proceed and get OBJECT_NOT_EXIST
  51. // from the server side.
  52. //ior = null;
  53. servant = null;
  54. }
  55. }
  56. // End of file.