KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > net > ServerSocketFactory


1
2
3 /*
4  * The contents of this file are subject to the terms
5  * of the Common Development and Distribution License
6  * (the "License"). You may not use this file except
7  * in compliance with the License.
8  *
9  * You can obtain a copy of the license at
10  * glassfish/bootstrap/legal/CDDLv1.0.txt or
11  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
12  * See the License for the specific language governing
13  * permissions and limitations under the License.
14  *
15  * When distributing Covered Code, include this CDDL
16  * HEADER in each file and include the License file at
17  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
18  * add the following below this CDDL HEADER, with the
19  * fields enclosed by brackets "[]" replaced with your
20  * own identifying information: Portions Copyright [yyyy]
21  * [name of copyright owner]
22  *
23  * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24  *
25  * Portions Copyright Apache Software Foundation.
26  */

27
28
29 package org.apache.catalina.net;
30
31
32 import java.io.IOException JavaDoc;
33 import java.net.InetAddress JavaDoc;
34 import java.net.ServerSocket JavaDoc;
35 import java.security.KeyStoreException JavaDoc;
36 import java.security.NoSuchAlgorithmException JavaDoc;
37 import java.security.cert.CertificateException JavaDoc;
38 import java.security.UnrecoverableKeyException JavaDoc;
39 import java.security.KeyManagementException JavaDoc;
40
41
42 /**
43  * Interface that describes the common characteristics of factory classes
44  * that create server sockets which may be required by a Connector. A concrete
45  * implementation of this interface will be assigned to a Connector
46  * via the <code>setFactory()</code> method.
47  *
48  * @author db@eng.sun.com
49  * @author Harish Prabandham
50  * @author Craig R. McClanahan
51  */

52 public interface ServerSocketFactory {
53
54
55     // --------------------------------------------------------- Public Methods
56

57
58     /**
59      * Returns a server socket which uses all network interfaces on
60      * the host, and is bound to a the specified port. The socket is
61      * configured with the socket options (such as accept timeout)
62      * given to this factory.
63      *
64      * @param port the port to listen to
65      *
66      * @exception IOException input/output or network error
67      * @exception KeyStoreException error instantiating the
68      * KeyStore from file (SSL only)
69      * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
70      * by current provider (SSL only)
71      * @exception CertificateException general certificate error (SSL only)
72      * @exception UnrecoverableKeyException internal KeyStore problem with
73      * the certificate (SSL only)
74      * @exception KeyManagementException problem in the key management
75      * layer (SSL only)
76      */

77     public ServerSocket JavaDoc createSocket (int port)
78     throws IOException JavaDoc, KeyStoreException JavaDoc, NoSuchAlgorithmException JavaDoc,
79            CertificateException JavaDoc, UnrecoverableKeyException JavaDoc,
80            KeyManagementException JavaDoc;
81
82
83     /**
84      * Returns a server socket which uses all network interfaces on
85      * the host, is bound to a the specified port, and uses the
86      * specified connection backlog. The socket is configured with
87      * the socket options (such as accept timeout) given to this factory.
88      *
89      * @param port the port to listen to
90      * @param backlog how many connections are queued
91      *
92      * @exception IOException input/output or network error
93      * @exception KeyStoreException error instantiating the
94      * KeyStore from file (SSL only)
95      * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
96      * by current provider (SSL only)
97      * @exception CertificateException general certificate error (SSL only)
98      * @exception UnrecoverableKeyException internal KeyStore problem with
99      * the certificate (SSL only)
100      * @exception KeyManagementException problem in the key management
101      * layer (SSL only)
102      */

103     public ServerSocket JavaDoc createSocket (int port, int backlog)
104     throws IOException JavaDoc, KeyStoreException JavaDoc, NoSuchAlgorithmException JavaDoc,
105            CertificateException JavaDoc, UnrecoverableKeyException JavaDoc,
106            KeyManagementException JavaDoc;
107
108
109     /**
110      * Returns a server socket which uses only the specified network
111      * interface on the local host, is bound to a the specified port,
112      * and uses the specified connection backlog. The socket is configured
113      * with the socket options (such as accept timeout) given to this factory.
114      *
115      * @param port the port to listen to
116      * @param backlog how many connections are queued
117      * @param ifAddress the network interface address to use
118      *
119      * @exception IOException input/output or network error
120      * @exception KeyStoreException error instantiating the
121      * KeyStore from file (SSL only)
122      * @exception NoSuchAlgorithmException KeyStore algorithm unsupported
123      * by current provider (SSL only)
124      * @exception CertificateException general certificate error (SSL only)
125      * @exception UnrecoverableKeyException internal KeyStore problem with
126      * the certificate (SSL only)
127      * @exception KeyManagementException problem in the key management
128      * layer (SSL only)
129      */

130     public ServerSocket JavaDoc createSocket (int port, int backlog,
131                                       InetAddress JavaDoc ifAddress)
132     throws IOException JavaDoc, KeyStoreException JavaDoc, NoSuchAlgorithmException JavaDoc,
133            CertificateException JavaDoc, UnrecoverableKeyException JavaDoc,
134            KeyManagementException JavaDoc;
135
136
137 }
138
Popular Tags