Package com.gigaspaces.lrmi.nio.watchdog
Class RequestTimeoutObserver
java.lang.Object
com.gigaspaces.lrmi.nio.watchdog.RequestTimeoutObserver
- Direct Known Subclasses:
RequestResponseTimeoutObserver
RequestTimeoutObserver handles NIO connection timeouts on the client side. If client doesn't
receive a reply, it checks the connection with the server and if it is not valid anymore, the
connection is closed.
- Since:
- 5.1
- Version:
- 1.0
- Author:
- anna
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LogLevelprotected StringgetFailureToCloseInvalidConnectionMessage(SocketAddress serverAddress, SocketChannel watchedSocketChannel) protected StringgetInvalidConnectionMessage(SocketAddress serverAddress, SocketChannel watchedSocketChannel, Watchdog.WatchedObject watched) protected StringgetLocalAddressString(SocketChannel socketChannel) protected StringgetValidConnectionMessage(SocketAddress serverAddress) protected static Stringprotected voidhandleOpenSocket(SocketChannel socketChannel, int watchedObjectLocalPort, long absoluteTimeout, ConnectionResource connectionResource) voidbucket can never be empty
-
Field Details
-
_INSPECT_TIMEOUT
protected static final int _INSPECT_TIMEOUT -
_logger
protected static final org.slf4j.Logger _logger
-
-
Constructor Details
-
RequestTimeoutObserver
public RequestTimeoutObserver(long requestTimeout)
-
-
Method Details
-
timeoutOccured
bucket can never be empty- Throws:
Exception- See Also:
-
nio.watchdog.Watchdog#add(Map<WatchedObject, Collection<WatchedObject>>, WatchedObject)nio.watchdog.TimeoutObserver#timeoutOccured(nio.watchdog.Watchdog.WatchedObject)
-
handleOpenSocket
protected void handleOpenSocket(SocketChannel socketChannel, int watchedObjectLocalPort, long absoluteTimeout, ConnectionResource connectionResource) throws IOException - Parameters:
connectionResource- the monitored cpeer- Throws:
IOException
-
getValidConnectionMessage
-
getInvalidConnectionMessage
protected String getInvalidConnectionMessage(SocketAddress serverAddress, SocketChannel watchedSocketChannel, Watchdog.WatchedObject watched) -
getFailureToCloseInvalidConnectionMessage
protected String getFailureToCloseInvalidConnectionMessage(SocketAddress serverAddress, SocketChannel watchedSocketChannel) -
getLocalAddressString
-
getCloseConnectionLoggingLevel
-
getWatchedObjectInvocationMessage
-