01: /*
02: * This file is part of the QuickServer library
03: * Copyright (C) 2003-2005 QuickServer.org
04: *
05: * Use, modification, copying and distribution of this software is subject to
06: * the terms and conditions of the GNU Lesser General Public License.
07: * You should have received a copy of the GNU LGP License along with this
08: * library; if not, you can download a copy from <http://www.quickserver.org/>.
09: *
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;
19:
20: /**
21: * This interface defines the methods that should be implemented by any
22: * class that needs to be notified when its ready to accept more data.
23: *
24: * <p>
25: * Recommendations to be followed when implementing ClientWriteHandler
26: * <ul>
27: * <li>Should have a default constructor.
28: * <li>Should be thread safe.
29: * <li>It should not store any data that may is associated with a particular client.
30: * <li>If any client data is need to be saved from the client session,
31: * it should be saved to a {@link ClientData} class, which can be retrieved
32: * using handler.getClientData() method.
33: * </ul>
34: * </p>
35: * @since 1.4.5
36: * @author Akshathkumar Shetty
37: */
38: public interface ClientWriteHandler {
39: /**
40: * Method called every time client is ready to receive for more data.
41: * Should be used to handle the write any requested data.
42: * @exception java.io.IOException if io error in socket/Channel.
43: */
44: public void handleWrite(ClientHandler handler) throws IOException;
45: }
|