java.lang.Object
java.rmi.server.RMISocketFactory
org.newsclub.net.unix.rmi.AFRMISocketFactory
org.newsclub.net.unix.rmi.AFUNIXRMISocketFactory
- All Implemented Interfaces:
Closeable
,Externalizable
,Serializable
,AutoCloseable
,RMIClientSocketFactory
,RMIServerSocketFactory
An
RMISocketFactory
that supports AFUNIXSocket
s.- Author:
- Christian Kohlschütter
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.newsclub.net.unix.rmi.AFRMISocketFactory
AFRMISocketFactory.PortLease
-
Constructor Summary
ConstructorDescriptionConstructor required per definition.AFUNIXRMISocketFactory
(AFNaming naming, File socketDir) Creates a new socket factory.AFUNIXRMISocketFactory
(AFNaming naming, File socketDir, RMIClientSocketFactory defaultClientFactory, RMIServerSocketFactory defaultServerFactory) Creates a new socket factory.AFUNIXRMISocketFactory
(AFNaming naming, File socketDir, RMIClientSocketFactory defaultClientFactory, RMIServerSocketFactory defaultServerFactory, String socketPrefix, String socketSuffix) Creates a new socket factory. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
The directory in which socket files are stored.int
hashCode()
protected final org.newsclub.net.unix.AFSocket
<?> newConnectedSocket
(org.newsclub.net.unix.AFSocketAddress addr) Creates a new socket that is connected to the given socket address.protected org.newsclub.net.unix.AFUNIXSocketAddress
newSocketAddress
(int port) Creates a new socket address for the given RMI port.void
protected AFNaming
Deserializes information necessary to instantiate theAFNaming
instance.toString()
void
protected void
writeNamingInstance
(ObjectOutput out, AFNaming naming) Serializes information necessary to instantiate the givenAFNaming
instance.Methods inherited from class org.newsclub.net.unix.rmi.AFRMISocketFactory
createServerSocket, createSocket, getNaming, isLocalServer, newPort, newPortLease, returnPort
Methods inherited from class java.rmi.server.RMISocketFactory
getDefaultSocketFactory, getFailureHandler, getSocketFactory, setFailureHandler, setSocketFactory
-
Constructor Details
-
AFUNIXRMISocketFactory
public AFUNIXRMISocketFactory()Constructor required per definition.- See Also:
-
AFUNIXRMISocketFactory
public AFUNIXRMISocketFactory(AFNaming naming, File socketDir, RMIClientSocketFactory defaultClientFactory, RMIServerSocketFactory defaultServerFactory, String socketPrefix, String socketSuffix) Creates a new socket factory.- Parameters:
naming
- TheAFNaming
instance to use.socketDir
- The directory to store the sockets in.defaultClientFactory
- The defaultRMIClientSocketFactory
.defaultServerFactory
- The defaultRMIServerSocketFactory
.socketPrefix
- A string that will be inserted at the beginning of each socket filename, ornull
.socketSuffix
- A string that will be added to the end of each socket filename, ornull
.
-
AFUNIXRMISocketFactory
public AFUNIXRMISocketFactory(AFNaming naming, File socketDir, RMIClientSocketFactory defaultClientFactory, RMIServerSocketFactory defaultServerFactory) Creates a new socket factory.- Parameters:
naming
- TheAFNaming
instance to use.socketDir
- The directory to store the sockets in.defaultClientFactory
- The defaultRMIClientSocketFactory
.defaultServerFactory
- The defaultRMIServerSocketFactory
.
-
AFUNIXRMISocketFactory
-
-
Method Details
-
readNamingInstance
Description copied from class:AFRMISocketFactory
Deserializes information necessary to instantiate theAFNaming
instance.- Specified by:
readNamingInstance
in classAFRMISocketFactory
- Parameters:
in
- The stream.- Returns:
- The
AFNaming
instance. - Throws:
IOException
- on error.
-
writeNamingInstance
Description copied from class:AFRMISocketFactory
Serializes information necessary to instantiate the givenAFNaming
instance.- Specified by:
writeNamingInstance
in classAFRMISocketFactory
- Parameters:
out
- The stream.naming
- TheAFNaming
instance.- Throws:
IOException
- on error.
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Overrides:
readExternal
in classAFRMISocketFactory
- Throws:
IOException
ClassNotFoundException
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Overrides:
writeExternal
in classAFRMISocketFactory
- Throws:
IOException
-
hashCode
-
equals
-
getSocketDir
-
newSocketAddress
Description copied from class:AFRMISocketFactory
Creates a new socket address for the given RMI port.- Specified by:
newSocketAddress
in classAFRMISocketFactory
- Parameters:
port
- The port.- Returns:
- The socket address.
- Throws:
IOException
- on error.
-
newConnectedSocket
protected final org.newsclub.net.unix.AFSocket<?> newConnectedSocket(org.newsclub.net.unix.AFSocketAddress addr) throws IOException Description copied from class:AFRMISocketFactory
Creates a new socket that is connected to the given socket address.- Specified by:
newConnectedSocket
in classAFRMISocketFactory
- Parameters:
addr
- The socket address.- Returns:
- The connected socket.
- Throws:
IOException
- on error.
-
toString
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAFRMISocketFactory
- Throws:
IOException
-