01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.net.protocol.transport;
05:
06: /**
07: * A place to keep the various TC Wire protocol type-of-service (TOS) definitions
08: *
09: * @author teck
10: */
11: public class TypeOfService {
12: public static final byte TOS_UNSPECIFIED = 0;
13: public static final TypeOfService DEFAULT_TOS = TypeOfService
14: .getInstance(TOS_UNSPECIFIED);
15:
16: private final byte value;
17:
18: // TODO: provide methods for testing / setting specific TOS bits
19:
20: public boolean isUnspecified() {
21: return (0 == value);
22: }
23:
24: private TypeOfService(byte b) {
25: value = b;
26: }
27:
28: public static TypeOfService getInstance(byte b) {
29: // could cache instances here if need be
30: return new TypeOfService(b);
31: }
32:
33: byte getByteValue() {
34: return value;
35: }
36: }
|