KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > net > server > ClientWriteHandler


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.net.server;
16
17 import java.io.*;
18 import java.net.SocketTimeoutException JavaDoc;
19 /**
20  * This interface defines the methods that should be implemented by any
21  * class that needs to be notified when its ready to accept more data.
22  *
23  * <p>
24  * Recommendations to be followed when implementing ClientWriteHandler
25  * <ul>
26  * <li>Should have a default constructor.
27  * <li>Should be thread safe.
28  * <li>It should not store any data that may is associated with a particular client.
29  * <li>If any client data is need to be saved from the client session,
30  * it should be saved to a {@link ClientData} class, which can be retrieved
31  * using handler.getClientData() method.
32  * </ul>
33  * </p>
34  * @since 1.4.5
35  * @author Akshathkumar Shetty
36  */

37 public interface ClientWriteHandler {
38     /**
39      * Method called every time client is ready to receive for more data.
40      * Should be used to handle the write any requested data.
41      * @exception java.io.IOException if io error in socket/Channel.
42      */

43     public void handleWrite(ClientHandler handler)
44         throws IOException;
45 }
46
Popular Tags