KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > channel > SocketState


1 /**
2  * Dream Copyright (C) 2003-2004 INRIA Rhone-Alpes This library is free
3  * software; you can redistribute it and/or modify it under the terms of the GNU
4  * Lesser General Public License as published by the Free Software Foundation;
5  * either version 2 of the License, or (at your option) any later version. This
6  * library is distributed in the hope that it will be useful, but WITHOUT ANY
7  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
8  * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
9  * details. You should have received a copy of the GNU Lesser General Public
10  * License along with this library; if not, write to the Free Software
11  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
12  * Contact: dream@objectweb.org Initial developer(s): Matthieu Leclercq
13  * Contributor(s):
14  */

15
16 package org.objectweb.dream.channel;
17
18 import java.net.Socket JavaDoc;
19
20 import org.objectweb.dream.message.codec.CodecInputOutput;
21 import org.objectweb.dream.pool.Recyclable;
22
23 /**
24  * Interface used by ChannelOut to identify a ChannelIn and to send it message.
25  */

26 public interface SocketState extends CodecInputOutput, Recyclable
27 {
28
29   /**
30    * Sets the socket to be used as input and output.
31    *
32    * @param socket a socket.
33    */

34   void setSocket(Socket JavaDoc socket);
35
36   /**
37    * Returns <code>true</code> if the socket is closed or is deconnected.
38    *
39    * @return <code>true</code> if the socket is closed or is deconnected.
40    */

41   boolean isClosed();
42
43   /**
44    * Closes the connection.
45    */

46   void close();
47 }
Popular Tags