Interface ExceptionHandler
public interface ExceptionHandler
Interface to be implemented in order to provide a Remote Server instance with
a custom handler for error conditions occurring on the Remote Server.
Note that multiple redundant invocations on the same Remote Server instance are possible.
Note that multiple redundant invocations on the same Remote Server instance are possible.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
handleException
(RemotingException exception) Called by the Remote Server upon an unexpected error.boolean
handleIOException
(IOException exception) Called by the Remote Server upon a read or write operation failure.
-
Method Details
-
handleIOException
Called by the Remote Server upon a read or write operation failure. This may mean that the connection to Lightstreamer Server is lost; in any way, after this error, the correct operation of this Remote Server instance is compromised. This may be the signal of a normal termination of Lightstreamer Server. If this is not the case, then this Remote Server instance should be closed and a new one should be created and initialized. This may mean closing and restarting the process or just creating a new instance, depending on the implementation choice. This will be detected by the Proxy Adapter, which will react accordingly.
The default handling just terminates the process.- Parameters:
exception
- An Exception showing the cause of the problem.- Returns:
- true to enable the default handling, false to suppress it.
-
handleException
Called by the Remote Server upon an unexpected error. After this error, the correct operation of this Remote Server instance is compromised. If this is the case, then this Remote Server instance should be closed and a new one should be created and initialized. This may mean closing and restarting the process or just creating a new instance, depending on the implementation choice. This will be detected by the Proxy Adapter, which will react accordingly.
The default handling, in case of a Remote Data Adapter, issues an asynchronous failure notification to the Proxy Adapter. In case of a Remote Metadata Adapter, the default handling ignores the notification; however, as a consequence of the Remote Protocol being broken, the Proxy Adapter may return exceptions against one or more specific requests by Lightstreamer Kernel.- Parameters:
exception
- An Exception showing the cause of the problem.- Returns:
- true to enable the default handling, false to suppress it.
-