1. /*
  2. * @(#)ZeroPortPolicy.java 1.4 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.spi.extension ;
  8. import org.omg.CORBA.Policy ;
  9. import org.omg.CORBA.LocalObject ;
  10. import com.sun.corba.se.impl.orbutil.ORBConstants ;
  11. /** Policy used to implement zero IIOP port policy in the POA.
  12. */
  13. public class ZeroPortPolicy extends LocalObject implements Policy
  14. {
  15. private static ZeroPortPolicy policy = new ZeroPortPolicy( true ) ;
  16. private boolean flag = true ;
  17. private ZeroPortPolicy( boolean type )
  18. {
  19. this.flag = type ;
  20. }
  21. public String toString()
  22. {
  23. return "ZeroPortPolicy[" + flag + "]" ;
  24. }
  25. public boolean forceZeroPort()
  26. {
  27. return flag ;
  28. }
  29. public synchronized static ZeroPortPolicy getPolicy()
  30. {
  31. return policy ;
  32. }
  33. public int policy_type ()
  34. {
  35. return ORBConstants.ZERO_PORT_POLICY ;
  36. }
  37. public org.omg.CORBA.Policy copy ()
  38. {
  39. return this ;
  40. }
  41. public void destroy ()
  42. {
  43. // NO-OP
  44. }
  45. }