~ubuntu-branches/ubuntu/vivid/tomcat6/vivid

« back to all changes in this revision

Viewing changes to java/org/apache/catalina/tribes/transport/bio/BioSender.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-02-17 00:02:00 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20140217000200-qs6ki7bhqnfhkas7
Tags: 6.0.39-1
* Team upload.
* New upstream release.
  - Refreshed the patches
* Standards-Version updated to 3.9.5 (no changes)
* Switch to debhelper level 9
* Use XZ compression for the upstream tarball
* Use canonical URL for the Vcs-Git field

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 * 
39
39
 * @author Peter Rossbach
40
40
 * @author Filip Hanik
41
 
 * @version $Id: BioSender.java 939515 2010-04-29 23:59:49Z kkolinko $
 
41
 * @version $Id: BioSender.java 1561778 2014-01-27 18:37:12Z markt $
42
42
 * @since 5.5.16
43
43
 */
44
44
public class BioSender extends AbstractSender implements DataSender {
89
89
 
90
90
    /**
91
91
     * Connect other cluster member receiver 
92
 
     * @see org.apache.catalina.tribes.transport.IDataSender#connect()
 
92
     * @see org.apache.catalina.tribes.transport.DataSender#connect()
93
93
     */
94
94
    public  void connect() throws IOException {
95
95
        openSocket();
99
99
    /**
100
100
     * disconnect and close socket
101
101
     * 
102
 
     * @see IDataSender#disconnect()
 
102
     * @see DataSender#disconnect()
103
103
     */
104
104
    public  void disconnect() {
105
105
        boolean connect = isConnected();
113
113
 
114
114
    /**
115
115
     * Send message
116
 
     * 
117
 
     * @see org.apache.catalina.tribes.transport.IDataSender#sendMessage(,
118
 
     *      ChannelMessage)
119
116
     */
120
117
    public  void sendMessage(byte[] data, boolean waitForAck) throws IOException {
121
118
        IOException exception = null;
197
194
     * close socket
198
195
     * 
199
196
     * @see DataSender#disconnect()
200
 
     * @see DataSender#closeSocket()
201
197
     */
202
198
    protected void closeSocket() {
203
199
        if(isConnected()) {
223
219
     * Wait for ack is needed and make auto retry when write message is failed.
224
220
     * After sending error close and reopen socket again.
225
221
     * 
226
 
     * After successfull sending update stats
 
222
     * After successful sending update statistics
227
223
     * 
228
 
     * WARNING: Subclasses must be very carefull that only one thread call this pushMessage at once!!!
 
224
     * WARNING: Subclasses must be very careful that only one thread call this pushMessage at once!!!
229
225
     * 
230
226
     * @see #closeSocket()
231
227
     * @see #openSocket()
232
 
     * @see #writeData(ChannelMessage)
233
228
     * 
234
229
     * @param data
235
230
     *            data to send
249
244
    
250
245
    /**
251
246
     * Wait for Acknowledgement from other server
252
 
     * FIXME Please, not wait only for three charcters, better control that the wait ack message is correct.
253
 
     * @param timeout
 
247
     * FIXME Please, not wait only for three characters, better control that the wait ack message is correct.
254
248
     * @throws java.io.IOException
255
249
     * @throws java.net.SocketTimeoutException
256
250
     */