Class InterruptibleRMIServerSocket
java.lang.Object
java.net.ServerSocket
ecmwf.common.rmi.interruptible.InterruptibleRMIServerSocket
-
Constructor Summary
ConstructorsConstructorDescriptionInterruptibleRMIServerSocket
(ServerSocket serverSocket) Create decorator for given socket. -
Method Summary
Modifier and TypeMethodDescriptionaccept()
Accept.void
bind
(SocketAddress endpoint) Bind.void
bind
(SocketAddress endpoint, int backlog) Bind.void
close()
Close.boolean
Returns true if the decoratee's equals method returns true.Not implemented - always returns null.static Socket
Return the socket associated with the RMI server thread (the current thread).Gets the inet address.int
Gets the local port.Gets the local socket address.int
Gets the receive buffer size.boolean
Gets the reuse address.int
Gets the so timeout.int
hashCode()
Return the hashcode of the decorated socket.boolean
isBound()
Checks if is bound.boolean
isClosed()
Checks if is closed.static boolean
Return true if the socket associated with the RMI server thread (the current thread) has not been closed or marked for shutdown by the client of the RMI thread.static boolean
Return true if the socket provided has not been closed or marked for shutdown by the client of the RMI thread.void
setPerformancePreferences
(int connectionTime, int latency, int bandwidth) Sets the performance preferences.void
setReceiveBufferSize
(int size) Sets the receive buffer size.void
setReuseAddress
(boolean on) Sets the reuse address.void
setSoTimeout
(int timeout) Sets the so timeout.toString()
To string.Methods inherited from class java.net.ServerSocket
getOption, implAccept, setOption, setSocketFactory, supportedOptions
-
Constructor Details
-
InterruptibleRMIServerSocket
Create decorator for given socket.- Parameters:
serverSocket
- the server socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
getCurrentRMIServerThreadSocket
Return the socket associated with the RMI server thread (the current thread).- Returns:
- socket
-
isCurrentRMIServerThreadSocketAlive
public static boolean isCurrentRMIServerThreadSocketAlive()Return true if the socket associated with the RMI server thread (the current thread) has not been closed or marked for shutdown by the client of the RMI thread.- Returns:
- true, if is current RMI server thread socket alive
-
isCurrentRMIServerThreadSocketAlive
Return true if the socket provided has not been closed or marked for shutdown by the client of the RMI thread. The socket is provided beforehand by a call to the getCurrentRMIServerThreadSocket method.- Parameters:
socket
- the socket- Returns:
- true, if is current RMI server thread socket alive
-
accept
Accept.- Overrides:
accept
in classServerSocket
- Throws:
IOException
- See Also:
-
bind
Bind.- Overrides:
bind
in classServerSocket
- Throws:
IOException
- See Also:
-
bind
Bind.- Overrides:
bind
in classServerSocket
- Throws:
IOException
- See Also:
-
close
Close.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classServerSocket
- Throws:
IOException
- See Also:
-
equals
-
getChannel
Not implemented - always returns null.- Overrides:
getChannel
in classServerSocket
- See Also:
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddress
in classServerSocket
- See Also:
-
getLocalPort
public int getLocalPort()Gets the local port.- Overrides:
getLocalPort
in classServerSocket
- See Also:
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddress
in classServerSocket
- See Also:
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSize
in classServerSocket
- Throws:
SocketException
- See Also:
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddress
in classServerSocket
- Throws:
SocketException
- See Also:
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeout
in classServerSocket
- Throws:
IOException
- See Also:
-
hashCode
-
isBound
-
isClosed
-
setPerformancePreferences
public void setPerformancePreferences(int connectionTime, int latency, int bandwidth) Sets the performance preferences.- Overrides:
setPerformancePreferences
in classServerSocket
- See Also:
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSize
in classServerSocket
- Throws:
SocketException
- See Also:
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddress
in classServerSocket
- Throws:
SocketException
- See Also:
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeout
in classServerSocket
- Throws:
SocketException
- See Also:
-
toString
-