1 22 package org.jboss.invocation; 23 24 import java.io.Serializable ; 25 import java.io.ObjectStreamException ; 26 27 32 public final class PayloadKey implements Serializable 33 { 34 35 private static final long serialVersionUID = 5436722659170811314L; 36 37 41 private static final int MAX_KEY_ID = 3; 42 43 44 private static final PayloadKey[] values = new PayloadKey[MAX_KEY_ID+1]; 45 46 47 public final static PayloadKey TRANSIENT = new PayloadKey("TRANSIENT", 0); 48 49 50 public final static PayloadKey AS_IS = new PayloadKey("AS_IS", 1); 51 52 53 public final static PayloadKey PAYLOAD = new PayloadKey("PAYLOAD", 2); 54 55 private final transient String name; 56 57 private final int ordinal; 59 60 private PayloadKey(String name, int ordinal) 61 { 62 this.name = name; 63 this.ordinal = ordinal; 64 values[ordinal] = this; 65 } 66 67 public String toString() 68 { 69 return name; 70 } 71 72 Object readResolve() throws ObjectStreamException 73 { 74 return values[ordinal]; 75 } 76 } 77 | Popular Tags |