From: Tom E. <tom...@jb...> - 2005-06-16 15:17:35
|
User: telrod Date: 05/06/16 11:17:01 Modified: src/main/org/jboss/remoting ServerInvoker.java Log: JBREM-134 - updated to handle the adding and removing of multiple callback servers via locator urls. Also added code so will throw exception if callback listener removed and is not registered. Revision Changes Path 1.12 +15 -6 JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ServerInvoker.java =================================================================== RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/ServerInvoker.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -b -r1.11 -r1.12 --- ServerInvoker.java 15 Jun 2005 03:06:42 -0000 1.11 +++ ServerInvoker.java 16 Jun 2005 15:17:01 -0000 1.12 @@ -34,7 +34,7 @@ * * @author <a href="mailto:jh...@vo...">Jeff Haynie</a> * @author <a href="mailto:tom...@jb...">Tom Elrod</a> - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ */ public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean { @@ -506,7 +506,7 @@ else // no point in delaying return to client if oneway { String subsystem = invocation.getSubsystem(); - InvokerLocator client = invocation.getLocator(); + String clientId = invocation.getSessionId(); // too bad we can't optimize this a little better, since we take a lookup hit for // each invocation -JGH @@ -532,7 +532,7 @@ { if(log.isTraceEnabled()) { - log.trace("dispatching invocation: " + invocation + " to subsystem: " + subsystem + " from client: " + client); + log.trace("dispatching invocation: " + invocation + " to subsystem: " + subsystem + " from client: " + clientId); } if(handler == null) @@ -546,7 +546,7 @@ if(log.isTraceEnabled()) { log.trace("dispatch invocation, returning back: " + result + " from subsystem: " + subsystem + - " to client: " + client); + " to client: " + clientId); } } @@ -642,6 +642,11 @@ callbackHandler.destroy(); } + else + { + String sessionId = ServerInvokerCallbackHandler.getId(invocation); + throw new RuntimeException("Can not remove callback listener from target server with id of " + sessionId + " as it does not exist as a registered callback listener."); + } } else if(InternalInvocation.GETCALLBACKS.equals(methodName)) { @@ -678,9 +683,13 @@ else if(InternalInvocation.REMOVECLIENTLISTENER.equals(methodName)) { String sessionId = ServerInvokerCallbackHandler.getId(invocation); - clientCallbackListener.remove(sessionId); - log.debug("ServerInvoker (" + this + ") removing client callback handler with session id of " + sessionId + "."); + Object cbo = clientCallbackListener.remove(sessionId); + if(cbo == null) + { + throw new RuntimeException("Can not remove callback listener from callback server with id of " + sessionId + " as it does not exist as a registered callback listener."); + } + } else if(InternalInvocation.HANDLECALLBACK.equals(methodName)) { |