1. /*
  2. * @(#)ShutdownUtilDelegate.java 1.3 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.internal.POA;
  8. import java.util.*;
  9. import java.rmi.Remote;
  10. import javax.rmi.CORBA.Tie;
  11. import org.omg.PortableServer.*;
  12. import org.omg.PortableServer.POAPackage.*;
  13. public class ShutdownUtilDelegate extends com.sun.corba.se.internal.iiop.ShutdownUtilDelegate
  14. {
  15. static ShutdownUtilDelegate instance = null;
  16. public ShutdownUtilDelegate() {
  17. instance = this;
  18. }
  19. // Maps servants to POAs for deactivating servants when unexportObject is called.
  20. // Maintained by POAs activate_object and deactivate_object.
  21. private static Map exportedServantsToPOA = new WeakHashMap();
  22. synchronized POA lookupPOA (Servant servant) {
  23. return (POA)exportedServantsToPOA.get(servant);
  24. }
  25. synchronized void registerPOAForServant(POA poa, Servant servant) {
  26. exportedServantsToPOA.put(servant, poa);
  27. }
  28. synchronized void unregisterPOAForServant(POA poa, Servant servant) {
  29. exportedServantsToPOA.remove(servant);
  30. }
  31. }