1 22 package org.jboss.ejb.plugins.cmp.jdbc.bridge; 23 24 import java.io.Serializable ; 25 import java.io.ObjectStreamException ; 26 27 35 public final class CMPMessage 36 implements Serializable 37 { 38 private static int nextOrdinal = 0; 40 private static final CMPMessage[] VALUES = new CMPMessage[5]; 41 42 public static final CMPMessage CHANGED = new CMPMessage("CHANGED"); 43 public static final CMPMessage ACCESSED = new CMPMessage("ACCESSED"); 44 45 private final transient String name; 46 private final int ordinal; 47 48 private CMPMessage(String name) 50 { 51 this.name = name; 52 this.ordinal = nextOrdinal++; 53 VALUES[ordinal] = this; 54 } 55 56 public String toString() 58 { 59 return name; 60 } 61 62 Object readResolve() 64 throws ObjectStreamException 65 { 66 return VALUES[ordinal]; 67 } 68 } 69 | Popular Tags |