1 17 18 package org.apache.geronimo.security.remoting.jmx; 19 import java.io.ObjectStreamException ; 20 import java.io.Serializable ; 21 24 public final class InvocationType implements Serializable { 25 26 27 private static final long serialVersionUID = 4049360807479227955L; 28 29 private static int MAX_ORDINAL = 2; 31 private static final InvocationType[] values = new InvocationType[MAX_ORDINAL + 1]; 32 public static final InvocationType REQUEST = new InvocationType("REQUEST", 0); 33 public static final InvocationType DATAGRAM = new InvocationType("DATAGRAM", 1); 34 35 private final transient String name; 36 private final int ordinal; 37 38 private InvocationType(String name, int ordinal) { 39 assert ordinal < MAX_ORDINAL; 40 assert values[ordinal] == null; 41 this.name = name; 42 this.ordinal = ordinal; 43 values[ordinal] = this; 44 } 45 46 public String toString() { 47 return name; 48 } 49 50 Object readResolve() throws ObjectStreamException { 51 return values[ordinal]; 52 } 53 } 54 | Popular Tags |