1 23 24 28 29 package com.sun.jts.pi; 30 31 import org.omg.CORBA.Policy ; 32 import org.omg.CORBA.LocalObject ; 33 34 import org.omg.CosTransactions.ADAPTS; 35 import org.omg.CosTransactions.FORBIDS; 36 import org.omg.CosTransactions.REQUIRES; 37 import org.omg.CosTransactions.OTSPolicy; 38 import org.omg.CosTransactions.OTS_POLICY_TYPE; 39 40 46 public class OTSPolicyImpl extends LocalObject implements OTSPolicy { 47 48 50 public static OTSPolicy _ADAPTS = new OTSPolicyImpl(ADAPTS.value); 51 public static OTSPolicy _FORBIDS = new OTSPolicyImpl(FORBIDS.value); 52 public static OTSPolicy _REQUIRES = new OTSPolicyImpl(REQUIRES.value); 53 54 56 private short value = FORBIDS.value; 57 58 60 public OTSPolicyImpl() { 61 this.value = FORBIDS.value; 62 } 63 64 public OTSPolicyImpl(short value) { 65 this.value = value; 66 } 67 68 70 public short value() { 71 return this.value; 72 } 73 74 76 public int policy_type() { 77 return OTS_POLICY_TYPE.value; 78 } 79 80 public Policy copy() { 81 return new OTSPolicyImpl(this.value); 82 } 83 84 public void destroy() { 85 value = FORBIDS.value; 86 } 87 88 public String toString() { 89 return "OTSPolicy[" + this.value + "]"; 90 } 91 } 92 | Popular Tags |