Class InterruptibleRMIServerSocket
java.lang.Object
java.net.ServerSocket
ecmwf.common.rmi.interruptible.InterruptibleRMIServerSocket
- All Implemented Interfaces:
Closeable, AutoCloseable
The Class InterruptibleRMIServerSocket.
-
Constructor Summary
ConstructorsConstructorDescriptionInterruptibleRMIServerSocket(ServerSocket serverSocket) Instantiates a new interruptible RMI server socket. -
Method Summary
Modifier and TypeMethodDescriptionaccept()Accept.voidbind(SocketAddress endpoint) Bind.voidbind(SocketAddress endpoint, int backlog) Bind.voidclose()Close.booleanEquals.Gets the channel.static SocketReturn the socket associated with the RMI server thread (the current thread).Gets the inet address.intGets the local port.Gets the local socket address.intGets the receive buffer size.booleanGets the reuse address.intGets the so timeout.inthashCode()Hash code.booleanisBound()Checks if is bound.booleanisClosed()Checks if is closed.static booleanReturn 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 booleanReturn true if the socket provided has not been closed or marked for shutdown by the client of the RMI thread.voidsetPerformancePreferences(int ct, int lat, int bw) Sets the performance preferences.voidsetReceiveBufferSize(int size) Sets the receive buffer size.voidsetReuseAddress(boolean on) Sets the reuse address.voidsetSoTimeout(int timeout) Sets the so timeout.toString()To string.Methods inherited from class ServerSocket
getOption, implAccept, setOption, setSocketFactory, supportedOptions
-
Constructor Details
-
InterruptibleRMIServerSocket
Instantiates a new interruptible RMI server 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:
- the current RMI server thread 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:
acceptin classServerSocket- Returns:
- the socket
- Throws:
IOException- Signals that an I/O exception has occurred.
-
bind
Bind.- Overrides:
bindin classServerSocket- Parameters:
endpoint- the endpointbacklog- the backlog- Throws:
IOException- Signals that an I/O exception has occurred.
-
bind
Bind.- Overrides:
bindin classServerSocket- Parameters:
endpoint- the endpoint- Throws:
IOException- Signals that an I/O exception has occurred.
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classServerSocket- Throws:
IOException- Signals that an I/O exception has occurred.
-
equals
-
getChannel
Gets the channel.- Overrides:
getChannelin classServerSocket- Returns:
- the channel
-
getInetAddress
Gets the inet address.- Overrides:
getInetAddressin classServerSocket- Returns:
- the inet address
-
getLocalPort
public int getLocalPort()Gets the local port.- Overrides:
getLocalPortin classServerSocket- Returns:
- the local port
-
getLocalSocketAddress
Gets the local socket address.- Overrides:
getLocalSocketAddressin classServerSocket- Returns:
- the local socket address
-
getReceiveBufferSize
Gets the receive buffer size.- Overrides:
getReceiveBufferSizein classServerSocket- Returns:
- the receive buffer size
- Throws:
SocketException- the socket exception
-
getReuseAddress
Gets the reuse address.- Overrides:
getReuseAddressin classServerSocket- Returns:
- the reuse address
- Throws:
SocketException- the socket exception
-
getSoTimeout
Gets the so timeout.- Overrides:
getSoTimeoutin classServerSocket- Returns:
- the so timeout
- Throws:
IOException- Signals that an I/O exception has occurred.
-
hashCode
-
isBound
public boolean isBound()Checks if is bound.- Overrides:
isBoundin classServerSocket- Returns:
- true, if is bound
-
isClosed
public boolean isClosed()Checks if is closed.- Overrides:
isClosedin classServerSocket- Returns:
- true, if is closed
-
setPerformancePreferences
public void setPerformancePreferences(int ct, int lat, int bw) Sets the performance preferences.- Overrides:
setPerformancePreferencesin classServerSocket- Parameters:
ct- the ctlat- the latbw- the bw
-
setReceiveBufferSize
Sets the receive buffer size.- Overrides:
setReceiveBufferSizein classServerSocket- Parameters:
size- the new receive buffer size- Throws:
SocketException- the socket exception
-
setReuseAddress
Sets the reuse address.- Overrides:
setReuseAddressin classServerSocket- Parameters:
on- the new reuse address- Throws:
SocketException- the socket exception
-
setSoTimeout
Sets the so timeout.- Overrides:
setSoTimeoutin classServerSocket- Parameters:
timeout- the new so timeout- Throws:
SocketException- the socket exception
-
toString
-