KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > cluster > tcp > SocketSender


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.catalina.cluster.tcp;
18
19 import java.net.InetAddress JavaDoc;
20
21 /**
22  * Send cluster messages sync to request with only one socket.
23  *
24  * @author Filip Hanik
25  * @author Peter Rossbach
26  * @version 1.2
27  */

28
29 public class SocketSender extends DataSender {
30     // ----------------------------------------------------- Instance Variables
31

32     /**
33      * The descriptive information about this implementation.
34      */

35     private static final String JavaDoc info = "SocketSender/1.2";
36
37     // ------------------------------------------------------------- Constructor
38

39     public SocketSender(InetAddress JavaDoc host, int port) {
40         super(host, port);
41     }
42
43     // ------------------------------------------------------------- Properties
44

45     /**
46      * Return descriptive information about this implementation and the
47      * corresponding version number, in the format
48      * <code>&lt;description&gt;/&lt;version&gt;</code>.
49      */

50     public String JavaDoc getInfo() {
51
52         return (info);
53
54     }
55
56     public String JavaDoc toString() {
57         StringBuffer JavaDoc buf = new StringBuffer JavaDoc("SocketSender[");
58         buf.append(getAddress()).append(":").append(getPort()).append("]");
59         return buf.toString();
60     }
61
62 }
Popular Tags