KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > jmx > protocols > TCP


1 package org.jgroups.jmx.protocols;
2
3 import java.net.UnknownHostException JavaDoc;
4
5 /**
6  * @author Bela Ban
7  * @version $Id: TCP.java,v 1.4 2006/10/30 20:07:10 bstansberry Exp $
8  */

9 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
26     public int getOpenConnections() {
27         return p.getOpenConnections();
28     }
29
30     public String JavaDoc getBindAddr() {
31         return p.getBindAddress();
32     }
33
34     public void setBindAddr(String JavaDoc bind_addr) {
35         try {
36             p.setBindAddress(bind_addr);
37         }
38         catch(UnknownHostException JavaDoc e) {
39             IllegalArgumentException JavaDoc iae = new IllegalArgumentException JavaDoc("Unknown host " + bind_addr);
40             iae.initCause(e);
41             throw iae;
42         }
43     }
44
45     public int getStartPort() {
46         return p.getStartPort();
47     }
48
49     public void setStartPort(int start_port) {
50         p.setStartPort(start_port);
51     }
52
53     public int getEndPort() {
54         return p.getEndPort();
55     }
56
57     public void setEndPort(int end_port) {
58         p.setEndPort(end_port);
59     }
60
61     public long getReaperInterval() {
62         return p.getReaperInterval();
63     }
64
65     public void setReaperInterval(long reaper_interval) {
66         p.setReaperInterval(reaper_interval);
67     }
68
69     public long getConnExpireTime() {
70         return p.getConnExpireTime();
71     }
72
73     public void setConnExpireTime(long conn_expire_time) {
74         p.setConnExpireTime(conn_expire_time);
75     }
76
77     public String JavaDoc printConnections() {
78         return p.printConnections();
79     }
80 }
81
Popular Tags