01: package vicazh.hyperpool.stream.net;
02:
03: import java.io.*;
04: import java.net.*;
05:
06: /**
07: * The out service
08: *
09: * @author Victor Zhigunov
10: * @version 0.4.0
11: */
12: public class OutService extends Service implements OutServiceMBean,
13: Serializable {
14: public OutService() {
15: }
16:
17: int timeout;
18:
19: /**
20: * @param timeout
21: * socket timeout
22: */
23: public OutService(int timeout) {
24: this .timeout = timeout;
25: }
26:
27: public InetAddress address;
28:
29: private String host;
30:
31: public void setHost(String host) {
32: this .host = host;
33: }
34:
35: public String getHost() {
36: return host;
37: }
38:
39: private int port;
40:
41: public void setPort(int port) {
42: this .port = port;
43: }
44:
45: public int getPort() {
46: return port;
47: }
48:
49: public Connection getConnection() {
50: return new OutConnection(this );
51: }
52:
53: public void setAttribute(String name, Object value)
54: throws Exception {
55: if (name.equals(OutServiceMBean.OPTIONS)) {
56: setPort(((OutService) value).getPort());
57: setHost(((OutService) value).getHost());
58: }
59: super.setAttribute(name, value);
60: }
61: }
|