KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > rmi > server > RMIServerSocketFactory


1 /*
2  * @(#)RMIServerSocketFactory.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.rmi.server;
9
10 import java.io.*;
11 import java.net.*;
12
13 /**
14  * An <code>RMIServerSocketFactory</code> instance is used by the RMI runtime
15  * in order to obtain server sockets for RMI calls. A remote object can be
16  * associated with an <code>RMIServerSocketFactory</code> when it is
17  * created/exported via the constructors or <code>exportObject</code> methods
18  * of <code>java.rmi.server.UnicastRemoteObject</code> and
19  * <code>java.rmi.activation.Activatable</code> .
20  *
21  * <p>An <code>RMIServerSocketFactory</code> instance associated with a remote
22  * object is used to obtain the <code>ServerSocket</code> used to accept
23  * incoming calls from clients.
24  *
25  * <p>An <code>RMIServerSocketFactory</code> instance can also be associated
26  * with a remote object registry so that clients can use custom socket
27  * communication with a remote object registry.
28  *
29  * <p>An implementation of this interface
30  * should implement {@link Object#equals} to return <code>true</code> when
31  * passed an instance that represents the same (functionally equivalent)
32  * server socket factory, and <code>false</code> otherwise (and it should also
33  * implement {@link Object#hashCode} consistently with its
34  * <code>Object.equals</code> implementation).
35  *
36  * @version 1.11, 12/19/03
37  * @author Ann Wollrath
38  * @author Peter Jones
39  * @since 1.2
40  * @see java.rmi.server.UnicastRemoteObject
41  * @see java.rmi.activation.Activatable
42  * @see java.rmi.registry.LocateRegistry
43  */

44 public interface RMIServerSocketFactory {
45
46     /**
47      * Create a server socket on the specified port (port 0 indicates
48      * an anonymous port).
49      * @param port the port number
50      * @return the server socket on the specified port
51      * @exception IOException if an I/O error occurs during server socket
52      * creation
53      * @since 1.2
54      */

55     public ServerSocket createServerSocket(int port)
56     throws IOException;
57 }
58
Free Books   Free Magazines  
Popular Tags