| Modifier and Type | Class and Description |
|---|---|
| private static class | TCPEndpoint.
The class FQDN encapsulates a routine that makes a best effort attempt to retrieve the fully qualified domain name of the local host. |
| Modifier and Type | Field and Description |
|---|---|
| private final RMIClientSocketFactory | csf
custom client socket factory (null if not custom factory) |
| private static final int | |
| private static final int | |
| private String | host
IP address or host name |
| private int | listenPort
if local, the port number to listen on |
| private static final Map | localEndpoints
maps an endpoint key containing custom socket factories to their own unique endpoint |
| private static String | localHost
the local host name |
| private static boolean | localHostKnown
true if real local host name is known yet |
| private int | port
port number |
| private final RMIServerSocketFactory | ssf
custom server socket factory (null if not custom factory) |
| private TCPTransport | transport
if local, the transport object associated with this endpoint |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TCPEndpoint(String host, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
Create a custom socket factory endpoint for a specified host and port. |
| Modifier and Type | Method and Description |
|---|---|
| private static Collection | |
| private static RMISocketFactory | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public void | exportObject(Target target)
Implements sun. Export the object to accept incoming calls. |
| private static boolean | |
| public Channel | getChannel()
Implements sun. Returns a channel for this (remote) endpoint. |
| public RMIClientSocketFactory | |
| public String | |
| private static String | |
| public Transport | getInboundTransport()
Implements sun. Returns the transport for incoming connections to this endpoint, if this endpoint was created as a server endpoint (using getLocalEndpoint). |
| private static int | |
| public int | getListenPort()
Returns the port that this endpoint's inbound transport listens on, if this endpoint was created as a server endpoint (using getLocalEndpoint). |
| public static TCPEndpoint | |
| public static TCPEndpoint | |
| public Transport | getOutboundTransport()
Implements sun. Returns transport for making connections to remote endpoints; (here, the default transport at port 0 is used). |
| public int | |
| public RMIServerSocketFactory | |
| public int | |
| pack-priv ServerSocket | |
| pack-priv Socket | |
| public static TCPEndpoint | |
| public static TCPEndpoint | |
| private static String | |
| pack-priv static void | setDefaultPort(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
Set the port of the (shared) default endpoint object. |
| pack-priv static void | |
| public static void | |
| public String | |
| public void | |
| public void | writeHostPortFormat(DataOutput out)
Write endpoint to output stream in older format used by UnicastRef for JDK1.1 compatibility. |
| csf | back to summary |
|---|---|
| private final RMIClientSocketFactory csf custom client socket factory (null if not custom factory) | |
| FORMAT_HOST_PORT | back to summary |
|---|---|
| private static final int FORMAT_HOST_PORT | |
| FORMAT_HOST_PORT_FACTORY | back to summary |
|---|---|
| private static final int FORMAT_HOST_PORT_FACTORY | |
| host | back to summary |
|---|---|
| private String host IP address or host name | |
| listenPort | back to summary |
|---|---|
| private int listenPort if local, the port number to listen on | |
| localEndpoints | back to summary |
|---|---|
| private static final Map<TCPEndpoint, LinkedList<TCPEndpoint>> localEndpoints maps an endpoint key containing custom socket factories to their own unique endpoint | |
| localHost | back to summary |
|---|---|
| private static String localHost the local host name | |
| localHostKnown | back to summary |
|---|---|
| private static boolean localHostKnown true if real local host name is known yet | |
| port | back to summary |
|---|---|
| private int port port number | |
| ssf | back to summary |
|---|---|
| private final RMIServerSocketFactory ssf custom server socket factory (null if not custom factory) | |
| transport | back to summary |
|---|---|
| private TCPTransport transport if local, the transport object associated with this endpoint | |
| TCPEndpoint | back to summary |
|---|---|
| public TCPEndpoint(String host, int port) Create an endpoint for a specified host and port. This should not be used by external classes to create endpoints for servers in this VM; use getLocalEndpoint instead. | |
| TCPEndpoint | back to summary |
|---|---|
| public TCPEndpoint(String host, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) Create a custom socket factory endpoint for a specified host and port. This should not be used by external classes to create endpoints for servers in this VM; use getLocalEndpoint instead. | |
| allKnownTransports | back to summary |
|---|---|
| private static Collection Returns the current list of known transports. The returned list is an unshared collection of Transports, including all transports which may have channels to remote endpoints. | |
| chooseFactory | back to summary |
|---|---|
| private static RMISocketFactory chooseFactory() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| exportObject | back to summary |
|---|---|
| public void exportObject(Target target) throws RemoteException Implements sun. Export the object to accept incoming calls. | |
| getBoolean | back to summary |
|---|---|
| private static boolean getBoolean(String name) | |
| getChannel | back to summary |
|---|---|
| public Channel getChannel() Implements sun. Returns a channel for this (remote) endpoint. | |
| getClientSocketFactory | back to summary |
|---|---|
| public RMIClientSocketFactory getClientSocketFactory() Get the client socket factory associated with this endpoint. | |
| getHost | back to summary |
|---|---|
| public String getHost() Returns address for endpoint | |
| getHostnameProperty | back to summary |
|---|---|
| private static String getHostnameProperty() Returns the value of the java.rmi.server.hostname property. | |
| getInboundTransport | back to summary |
|---|---|
| public Transport getInboundTransport() Implements sun. Returns the transport for incoming connections to this endpoint, if this endpoint was created as a server endpoint (using getLocalEndpoint). | |
| getInt | back to summary |
|---|---|
| private static int getInt(String name, int def) | |
| getListenPort | back to summary |
|---|---|
| public int getListenPort() Returns the port that this endpoint's inbound transport listens on, if this endpoint was created as a server endpoint (using getLocalEndpoint). If this endpoint was created for the default/anonymous port, then this method returns zero even if the transport has started listening. | |
| getLocalEndpoint | back to summary |
|---|---|
| public static TCPEndpoint getLocalEndpoint(int port) Get an endpoint for the local address space on specified port. If port number is 0, it returns shared default endpoint object whose host name and port may or may not have been determined. | |
| getLocalEndpoint | back to summary |
|---|---|
| public static TCPEndpoint getLocalEndpoint(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) | |
| getOutboundTransport | back to summary |
|---|---|
| public Transport getOutboundTransport() Implements sun. Returns transport for making connections to remote endpoints; (here, the default transport at port 0 is used). | |
| getPort | back to summary |
|---|---|
| public int getPort() Returns the port for this endpoint. If this endpoint was created as a server endpoint (using getLocalEndpoint) for a default/anonymous port and its inbound transport has started listening, this method returns (instead of zero) the actual bound port suitable for passing to clients. | |
| getServerSocketFactory | back to summary |
|---|---|
| public RMIServerSocketFactory getServerSocketFactory() Get the server socket factory associated with this endpoint. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| newServerSocket | back to summary |
|---|---|
| pack-priv ServerSocket newServerSocket() throws IOException Return new server socket to listen for connections on this endpoint. | |
| newSocket | back to summary |
|---|---|
| pack-priv Socket newSocket() throws RemoteException Open and return new client socket connection to endpoint. | |
| read | back to summary |
|---|---|
| public static TCPEndpoint read(ObjectInput in) throws IOException, ClassNotFoundException Get the endpoint from the input stream.
| |
| readHostPortFormat | back to summary |
|---|---|
| public static TCPEndpoint readHostPortFormat(DataInput in) throws IOException Create a new endpoint from input stream data.
| |
| resampleLocalHost | back to summary |
|---|---|
| private static String resampleLocalHost() Resamples the local hostname and returns the possibly-updated local hostname. | |
| setDefaultPort | back to summary |
|---|---|
| pack-priv static void setDefaultPort(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) Set the port of the (shared) default endpoint object. When first created, it contains port 0 because the transport hasn't tried to listen to get assigned a port, or if listening failed, a port hasn't been assigned from the server. | |
| setLocalHost | back to summary |
|---|---|
| pack-priv static void setLocalHost(String host) Set the local host name, if currently unknown. | |
| shedConnectionCaches | back to summary |
|---|---|
| public static void shedConnectionCaches() Release idle outbound connections to reduce demand on I/O resources. All transports are asked to release excess connections. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return string representation for endpoint. | |
| write | back to summary |
|---|---|
| public void write(ObjectOutput out) throws IOException Write endpoint to output stream. | |
| writeHostPortFormat | back to summary |
|---|---|
| public void writeHostPortFormat(DataOutput out) throws IOException Write endpoint to output stream in older format used by UnicastRef for JDK1.1 compatibility. | |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private String | reverseLookup
strings in which we can store discovered fqdn |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static String | attemptFQDN(InetAddress localAddr)
Do our best to obtain a fully qualified hostname for the local host. |
| private void | getFQDN()
Method that that will start a thread to wait to retrieve a fully qualified domain name from a name service. |
| private synchronized String | |
| public void |
| hostAddress | back to summary |
|---|---|
| private String hostAddress | |
| reverseLookup | back to summary |
|---|---|
| private String reverseLookup strings in which we can store discovered fqdn | |
| FQDN | back to summary |
|---|---|
| private FQDN(String hostAddress) | |
| attemptFQDN | back to summary |
|---|---|
| pack-priv static String attemptFQDN(InetAddress localAddr) throws UnknownHostException Do our best to obtain a fully qualified hostname for the local host. Perform the following steps to get a localhostname: 1. InetAddress.getLocalHost().getHostName() - if contains '.' use as FQDN 2. if no '.' query name service for FQDN in a thread Note We query the name service for an FQDN by creating an InetAddress via a stringified copy of the local ip address; this creates an InetAddress with a null hostname. Asking for the hostname of this InetAddress causes a name service lookup. 3. if name service takes too long to return, use ip address 4. if name service returns but response contains no '.' default to ipaddress. | |
| getFQDN | back to summary |
|---|---|
| private void getFQDN() Method that that will start a thread to wait to retrieve a fully qualified domain name from a name service. The spawned thread may never return but we have marked it as a daemon so the vm will terminate appropriately. | |
| getHost | back to summary |
|---|---|
| private synchronized String getHost() | |
| run | back to summary |
|---|---|
| public void run() Implements java. thread to query a name service for the fqdn of this host. | |