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 AFUNIXSockets.- 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
ConstructorsConstructorDescriptionConstructor 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 TypeMethodDescriptionvoidclose()booleanThe directory in which socket files are stored.inthashCode()protected final AFSocket<?> Creates a new socket that is connected to the given socket address.protected AFUNIXSocketAddressnewSocketAddress(int port) Creates a new socket address for the given RMI port.voidprotected AFNamingDeserializes information necessary to instantiate theAFNaminginstance.toString()voidprotected voidwriteNamingInstance(ObjectOutput out, AFNaming naming) Serializes information necessary to instantiate the givenAFNaminginstance.Methods inherited from class org.newsclub.net.unix.rmi.AFRMISocketFactory
createServerSocket, createSocket, getNaming, isLocalServer, newPort, newPortLease, returnPortMethods 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- TheAFNaminginstance 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- TheAFNaminginstance to use.socketDir- The directory to store the sockets in.defaultClientFactory- The defaultRMIClientSocketFactory.defaultServerFactory- The defaultRMIServerSocketFactory.
-
AFUNIXRMISocketFactory
-
-
Method Details
-
readNamingInstance
Description copied from class:AFRMISocketFactoryDeserializes information necessary to instantiate theAFNaminginstance.- Specified by:
readNamingInstancein classAFRMISocketFactory- Parameters:
in- The stream.- Returns:
- The
AFNaminginstance. - Throws:
IOException- on error.
-
writeNamingInstance
Description copied from class:AFRMISocketFactorySerializes information necessary to instantiate the givenAFNaminginstance.- Specified by:
writeNamingInstancein classAFRMISocketFactory- Parameters:
out- The stream.naming- TheAFNaminginstance.- Throws:
IOException- on error.
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classAFRMISocketFactory- Throws:
IOExceptionClassNotFoundException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classAFRMISocketFactory- Throws:
IOException
-
hashCode
-
equals
-
getSocketDir
-
newSocketAddress
Description copied from class:AFRMISocketFactoryCreates a new socket address for the given RMI port.- Specified by:
newSocketAddressin classAFRMISocketFactory- Parameters:
port- The port.- Returns:
- The socket address.
- Throws:
IOException- on error.
-
newConnectedSocket
Description copied from class:AFRMISocketFactoryCreates a new socket that is connected to the given socket address.- Specified by:
newConnectedSocketin classAFRMISocketFactory- Parameters:
addr- The socket address.- Returns:
- The connected socket.
- Throws:
IOException- on error.
-
toString
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classAFRMISocketFactory- Throws:
IOException
-