1 22 package org.jboss.ejb.plugins.lock; 23 24 import java.io.Serializable ; 25 import java.io.ObjectStreamException ; 26 27 33 public final class Entrancy implements Serializable 34 { 35 public static final Entrancy ENTRANT = new Entrancy(true); 36 public static final Entrancy NON_ENTRANT = new Entrancy(false); 37 38 private final transient boolean value; 39 40 private Entrancy(boolean value) 41 { 42 this.value = value; 43 } 44 45 public String toString() 46 { 47 if(value) 48 { 49 return "ENTRANT"; 50 } else 51 { 52 return "NON_ENTRANT"; 53 } 54 } 55 56 Object readResolve() throws ObjectStreamException 57 { 58 if(value) 59 { 60 return ENTRANT; 61 } else 62 { 63 return NON_ENTRANT; 64 } 65 } 66 67 } 68 69 | Popular Tags |