KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)RMIClientSocketFactory.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>RMIClientSocketFactory</code> instance is used by the RMI runtime
15  * in order to obtain client sockets for RMI calls. A remote object can be
16  * associated with an <code>RMIClientSocketFactory</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>RMIClientSocketFactory</code> instance associated with a remote
22  * object will be downloaded to clients when the remote object's reference is
23  * transmitted in an RMI call. This <code>RMIClientSocketFactory</code> will
24  * be used to create connections to the remote object for remote method calls.
25  *
26  * <p>An <code>RMIClientSocketFactory</code> instance can also be associated
27  * with a remote object registry so that clients can use custom socket
28  * communication with a remote object registry.
29  *
30  * <p>An implementation of this interface should be serializable and
31  * should implement {@link Object#equals} to return <code>true</code> when
32  * passed an instance that represents the same (functionally equivalent)
33  * client socket factory, and <code>false</code> otherwise (and it should also
34  * implement {@link Object#hashCode} consistently with its
35  * <code>Object.equals</code> implementation).
36  *
37  * @version 1.11, 12/19/03
38  * @author Ann Wollrath
39  * @author Peter Jones
40  * @since 1.2
41  * @see java.rmi.server.UnicastRemoteObject
42  * @see java.rmi.activation.Activatable
43  * @see java.rmi.registry.LocateRegistry
44  */

45 public interface RMIClientSocketFactory {
46
47     /**
48      * Create a client socket connected to the specified host and port.
49      * @param host the host name
50      * @param port the port number
51      * @return a socket connected to the specified host and port.
52      * @exception IOException if an I/O error occurs during socket creation
53      * @since 1.2
54      */

55     public Socket createSocket(String JavaDoc host, int port)
56     throws IOException;
57 }
58
Popular Tags