Added getResponseTimeout() to RemoteObject

This commit is contained in:
nathan 2018-01-18 20:03:01 +01:00
parent d7b7f94c1e
commit add5b96263
2 changed files with 10 additions and 0 deletions

View File

@ -48,6 +48,13 @@ interface RemoteObject {
*/
void setResponseTimeout(int timeoutMillis);
/**
* Returns the ResponseTimeout, which is the the milliseconds to wait for a method to return a value. Default is 3000, 0 disables (waits forever)
*
* @return the number of milliseconds a method will wait for a response
*/
int getResponseTimeout();
/**
* Sets the blocking behavior when invoking a remote method. Default is false (blocking)
*

View File

@ -171,6 +171,9 @@ class RmiProxyHandler implements InvocationHandler {
this.timeoutMillis = (Integer) args[0];
return null;
}
else if (name.equals("getResponseTimeout")) {
return this.timeoutMillis;
}
else if (name.equals("setAsync")) {
this.isAsync = (Boolean) args[0];
return null;