01: package org.jgroups.jmx.protocols;
02:
03: import java.net.UnknownHostException;
04:
05: /**
06: * @author Bela Ban
07: * @version $Id: TCP.java,v 1.4 2006/10/30 20:07:10 bstansberry Exp $
08: */
09: public class TCP extends TP implements TCPMBean {
10: org.jgroups.protocols.TCP p;
11:
12: public TCP() {
13: }
14:
15: public TCP(org.jgroups.stack.Protocol p) {
16: super (p);
17: this .p = (org.jgroups.protocols.TCP) p;
18: }
19:
20: public void attachProtocol(org.jgroups.stack.Protocol p) {
21: super .attachProtocol(p);
22: this .p = (org.jgroups.protocols.TCP) p;
23: }
24:
25: public int getOpenConnections() {
26: return p.getOpenConnections();
27: }
28:
29: public String getBindAddr() {
30: return p.getBindAddress();
31: }
32:
33: public void setBindAddr(String bind_addr) {
34: try {
35: p.setBindAddress(bind_addr);
36: } catch (UnknownHostException e) {
37: IllegalArgumentException iae = new IllegalArgumentException(
38: "Unknown host " + bind_addr);
39: iae.initCause(e);
40: throw iae;
41: }
42: }
43:
44: public int getStartPort() {
45: return p.getStartPort();
46: }
47:
48: public void setStartPort(int start_port) {
49: p.setStartPort(start_port);
50: }
51:
52: public int getEndPort() {
53: return p.getEndPort();
54: }
55:
56: public void setEndPort(int end_port) {
57: p.setEndPort(end_port);
58: }
59:
60: public long getReaperInterval() {
61: return p.getReaperInterval();
62: }
63:
64: public void setReaperInterval(long reaper_interval) {
65: p.setReaperInterval(reaper_interval);
66: }
67:
68: public long getConnExpireTime() {
69: return p.getConnExpireTime();
70: }
71:
72: public void setConnExpireTime(long conn_expire_time) {
73: p.setConnExpireTime(conn_expire_time);
74: }
75:
76: public String printConnections() {
77: return p.printConnections();
78: }
79: }
|