KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > extension > ZeroPortPolicy


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
8 package com.sun.corba.se.spi.extension ;
9
10 import org.omg.CORBA.Policy JavaDoc ;
11 import org.omg.CORBA.LocalObject JavaDoc ;
12 import com.sun.corba.se.impl.orbutil.ORBConstants ;
13
14 /** Policy used to implement zero IIOP port policy in the POA.
15 */

16 public class ZeroPortPolicy extends LocalObject JavaDoc implements Policy JavaDoc
17 {
18     private static ZeroPortPolicy policy = new ZeroPortPolicy( true ) ;
19
20     private boolean flag = true ;
21
22     private ZeroPortPolicy( boolean type )
23     {
24     this.flag = type ;
25     }
26
27     public String JavaDoc toString()
28     {
29     return "ZeroPortPolicy[" + flag + "]" ;
30     }
31
32     public boolean forceZeroPort()
33     {
34     return flag ;
35     }
36
37     public synchronized static ZeroPortPolicy getPolicy()
38     {
39     return policy ;
40     }
41
42     public int policy_type ()
43     {
44     return ORBConstants.ZERO_PORT_POLICY ;
45     }
46
47     public org.omg.CORBA.Policy JavaDoc copy ()
48     {
49     return this ;
50     }
51
52     public void destroy ()
53     {
54     // NO-OP
55
}
56 }
57
Popular Tags