01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.net.core;
06:
07: import java.nio.channels.SelectionKey;
08:
09: /**
10: * Constants common to the com.tc.net.core package
11: *
12: * @author teck
13: */
14: public final class Constants {
15: public static final int DEFAULT_ACCEPT_QUEUE_DEPTH = 512;
16:
17: public static String interestOpsToString(final int interestOps) {
18: StringBuffer buf = new StringBuffer();
19: if ((interestOps & SelectionKey.OP_ACCEPT) != 0) {
20: buf.append(" ACCEPT");
21: }
22:
23: if ((interestOps & SelectionKey.OP_CONNECT) != 0) {
24: buf.append(" CONNECT");
25: }
26:
27: if ((interestOps & SelectionKey.OP_READ) != 0) {
28: buf.append(" READ");
29: }
30:
31: if ((interestOps & SelectionKey.OP_WRITE) != 0) {
32: buf.append(" WRITE");
33: }
34: return buf.toString();
35: }
36:
37: }
|