KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xsocket > stream > io > spi > IAcceptor


1 // $Id: IMutlithreadedServerListener.java 1280 2007-05-28 17:59:08Z grro $
2
/*
3  * Copyright (c) xsocket.org, 2006 - 2007. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Please refer to the LGPL license at: http://www.gnu.org/copyleft/lesser.txt
20  * The latest copy of this software may be found on http://www.xsocket.org/
21  */

22 package org.xsocket.stream.io.spi;
23
24 import java.io.Closeable JavaDoc;
25 import java.io.IOException JavaDoc;
26 import java.net.InetSocketAddress JavaDoc;
27 import java.util.Map JavaDoc;
28
29 import org.xsocket.stream.IMultithreadedServer;
30
31
32
33 /**
34  * Acceptor specification <br><br>
35  *
36  * <b>This class is experimental and is subject to change</b>
37  *
38  * @author grro@xsocket.org
39  */

40 public interface IAcceptor extends Closeable JavaDoc {
41
42     public static final String JavaDoc ACCEPTOR_CLASSNAME_KEY = "org.xsocket.stream.spi.AcceptorClassname";
43
44     public static final String JavaDoc SO_RCVBUF = IMultithreadedServer.SO_RCVBUF;
45     public static final String JavaDoc SO_REUSEADDR = IMultithreadedServer.SO_REUSEADDR;
46
47     
48     /**
49      * returns the value of a option
50      *
51      * @param name the name of the option
52      * @return the value of the option
53      * @throws IOException In an I/O error occurs
54      */

55     public Object JavaDoc getOption(String JavaDoc name) throws IOException JavaDoc;
56     
57     
58     
59     /**
60      * Returns an unmodifiable map of the options supported by this endpont.
61      *
62      * The key in the returned map is the name of a option, and its value
63      * is the type of the option value. The returned map will never contain null keys or values.
64      *
65      * @return An unmodifiable map of the options supported by this channel
66      */

67     public Map JavaDoc<String JavaDoc,Class JavaDoc> getOptions();
68
69     
70
71     /**
72      * executes the acceptor by listening incoming connections. This method blocks
73      *
74      * @throws IOException If some other I/O error occurs
75      */

76     public void listen() throws IOException JavaDoc;
77         
78     
79     /**
80      * return the number of open connections
81      *
82      */

83     public int getNumberOfOpenConnections();
84     
85     
86     /**
87      * returns the local socket address
88      *
89      * @return the local socket address
90      */

91     public InetSocketAddress JavaDoc getLocalAddress();
92 }
93
Popular Tags