|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.remoting.transport.rmi.RemotingRMIClientSocketFactory
public class RemotingRMIClientSocketFactory
RemotingRMIClientSocketFactory provides two services to RMIServerInvoker.
RMIServerInvoker to supply RMI
with a factory which creates sockets connected to a specified host name.
SocketFactory allowing RMIServerInvoker
to supply RMI with a factory facility which creates specialized sockets.
SocketFactory parameter is specified, then the RemotingRMIClientSocketFactory
should be used with a matching instance of RemotingRMIServerSocketFactory with a compatible
ServerSocketFactory.
If the SocketFactory parameter is not specified, an instance of java.net.Socket
will be created by default.
Although there is no apparent need for the host name parameter, since the createSocket()
method receives a host name, it seems that for a server object bound to localhost, the RMI runtime will
pass to createSocket() one of the IP addresses for which the host is configured (other than
127.0.0.1), resulting in a failure to retrieve the object from the Registry. If a host name is passed to
a RemotingRMIClientFactory constructor, it will override the host name passed to
createSocket() In particular, parameterizing RemotingRMIClientSocketFactory
with localhost will allow the retrieval of objects bound to localhost.
| Constructor Summary | |
|---|---|
RemotingRMIClientSocketFactory()
|
|
RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory)
|
|
RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory,
java.lang.String hostName)
|
|
RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory,
java.lang.String hostName,
int timeout)
|
|
RemotingRMIClientSocketFactory(java.lang.String hostName,
int timeout)
|
|
| Method Summary | |
|---|---|
java.net.Socket |
createSocket(java.lang.String host,
int port)
Creates a new socket. |
boolean |
equals(java.lang.Object o)
Overrides equals() method provided by Object class. |
int |
hashCode()
Overrides hashCode() method provided by the Object class. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemotingRMIClientSocketFactory()
public RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory)
socketFactory - the SocketFactory to be used to generate sockets
public RemotingRMIClientSocketFactory(java.lang.String hostName,
int timeout)
hostName - name of host to which all generated sockets should be connected
public RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory,
java.lang.String hostName,
int timeout)
public RemotingRMIClientSocketFactory(javax.net.SocketFactory socketFactory,
java.lang.String hostName)
socketFactory - the SocketFactory to be used to generate socketshostName - name of host to which all generated sockets should be connected| Method Detail |
|---|
public java.net.Socket createSocket(java.lang.String host,
int port)
throws java.io.IOException
SocketFactory was passed to the constructor, it will be used.
Otherwise, a java.net.Socket will be created by default.
createSocket in interface java.rmi.server.RMIClientSocketFactoryhost - host to which socket should be connectedport - port to which socket should be connected
java.io.IOException - if there is a problem creating a socketpublic boolean equals(java.lang.Object o)
equals() method provided by Object class. It looks for
equality of host name and socket factory parameters.
equals in class java.lang.Objecto - Object to which this is to be compared
o and this are equalpublic int hashCode()
hashCode() method provided by the Object class.
hashCode in class java.lang.Objectthis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||