From: Tom E. <tom...@jb...> - 2006-03-30 07:50:24
|
User: telrod Date: 06/03/30 02:50:20 Modified: src/main/org/jboss/remoting ConnectionValidator.java Log: JBREM-378 - fixed client connection ping so will properly indicate if server is dead and also not activate a new lease on the server side. Revision Changes Path 1.6 +15 -4 JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ConnectionValidator.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ConnectionValidator.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- ConnectionValidator.java 17 Jan 2006 18:53:40 -0000 1.5 +++ ConnectionValidator.java 30 Mar 2006 07:50:20 -0000 1.6 @@ -141,13 +141,24 @@ } } + /** + * Will make $PING$ invocation on server. If sucessful, will return true. Otherwise, + * will throw an exception. + * @param clientInvoker + * @return + * @throws Throwable + */ public static boolean checkConnection(ClientInvoker clientInvoker) throws Throwable { - Object o = clientInvoker.invoke(new InvocationRequest(ConnectionValidator.class.getName(), + + /** + * Sending null client id as don't want to trigger lease on server side. + * This also means that client connection validator will NOT impact client + * lease, so can not depend on it to maintain client lease with the server. + */ + Object o = clientInvoker.invoke(new InvocationRequest(null, Subsystem.SELF, "$PING$", null, null, null)); - InvocationResponse resp = (InvocationResponse) o; - Boolean b = (Boolean) resp.getResult(); - return b.booleanValue(); + return true; } |