[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting ...
Ovidiu Feodorov
ovidiu.feodorov at jboss.com
Sat Jan 20 01:35:15 EST 2007
User: ovidiu
Date: 07/01/20 01:35:15
Modified: src/main/org/jboss/remoting Tag: remoting_2_x
ServerInvoker.java
Log:
Extra logging, minor reformatting.
Revision Changes Path
No revision
No revision
1.52.2.19 +37 -34 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.52.2.18
retrieving revision 1.52.2.19
diff -u -b -r1.52.2.18 -r1.52.2.19
--- ServerInvoker.java 20 Jan 2007 02:13:49 -0000 1.52.2.18
+++ ServerInvoker.java 20 Jan 2007 06:35:15 -0000 1.52.2.19
@@ -32,7 +32,6 @@
import org.jboss.remoting.security.ServerSocketFactoryMBean;
import org.jboss.remoting.security.ServerSocketFactoryWrapper;
import org.jboss.remoting.socketfactory.CreationListenerServerSocketFactory;
-import org.jboss.remoting.socketfactory.CreationListenerSocketFactory;
import org.jboss.remoting.socketfactory.SocketCreationListener;
import org.jboss.remoting.stream.StreamHandler;
import org.jboss.remoting.stream.StreamInvocationHandler;
@@ -49,7 +48,6 @@
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.net.ServerSocketFactory;
-import javax.net.SocketFactory;
import java.io.IOException;
import java.lang.reflect.Constructor;
@@ -65,7 +63,9 @@
*
* @author <a href="mailto:jhaynie at vocalocity.net">Jeff Haynie</a>
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @version $Revision: 1.52.2.18 $
+ * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
+ *
+ * @version $Revision: 1.52.2.19 $
*/
public abstract class ServerInvoker extends AbstractInvoker implements ServerInvokerMBean
{
@@ -825,9 +825,7 @@
}
/**
- * return array of keys for each subsystem this invoker can handle
- *
- * @return
+ * Return array of keys for each subsystem this invoker can handle.
*/
public synchronized String[] getSupportedSubsystems()
{
@@ -836,9 +834,7 @@
}
/**
- * return an array of the server invocation handlers
- *
- * @return
+ * Return an array of the server invocation handlers.
*/
public synchronized ServerInvocationHandler[] getInvocationHandlers()
{
@@ -847,35 +843,42 @@
}
/**
- * add a server invocation handler for a particular subsystem. Typically, subsystems are defined
+ * Add a server invocation handler for a particular subsystem. Typically, subsystems are defined
* in org.jboss.remoting.Subsystem, however, this can be any string that the caller knows about.
*
- * @param subsystem
- * @param handler
- * @return previous ServerInvocationHandler with the same sybsystem value (case insensitive) or null
- * if a previous one did not exist.
+ * @return previous ServerInvocationHandler with the same sybsystem value (case insensitive) or
+ * null if a previous one did not exist.
*/
- public synchronized ServerInvocationHandler addInvocationHandler(String subsystem, ServerInvocationHandler handler)
+ public synchronized ServerInvocationHandler addInvocationHandler(String subsystem,
+ ServerInvocationHandler handler)
{
handler.setInvoker(this);
- return (ServerInvocationHandler) handlers.put(subsystem.toUpperCase(), handler);
+ ServerInvocationHandler oldHandler =
+ (ServerInvocationHandler)handlers.put(subsystem.toUpperCase(), handler);
+
+ log.debug(this + " added " + handler + " for subsystem '" + subsystem + "'" +
+ (oldHandler == null ? "" : ", replacing old handler " + oldHandler));
+
+ return oldHandler;
}
/**
- * remove a subsystem invocation handler
- *
- * @param subsystem
+ * Remove a subsystem invocation handler.
*/
public synchronized ServerInvocationHandler removeInvocationHandler(String subsystem)
{
- return (ServerInvocationHandler) handlers.remove(subsystem.toUpperCase());
+ ServerInvocationHandler handler =
+ (ServerInvocationHandler)handlers.remove(subsystem.toUpperCase());
+
+ log.debug(this + (handler == null ?
+ " tried to remove handler for " + subsystem + " but no handler found" :
+ " removed handler " + handler + " for subsystem '" + subsystem + "'"));
+
+ return handler;
}
/**
- * get a ServerInvocationHandler for a given subsystem type
- *
- * @param subsystem
- * @return
+ * Get a ServerInvocationHandler for a given subsystem type.
*/
public synchronized ServerInvocationHandler getInvocationHandler(String subsystem)
{
@@ -1031,7 +1034,7 @@
}
else
{
- if (trace) { log.trace(this + " dispatching invocation " + invocation + " from client " + clientId + " to subsystem " + subsystem); }
+ if (trace) { log.trace(this + " dispatching " + invocation + " from client " + clientId + " to subsystem '" + subsystem + "'"); }
if (handler == null)
{
@@ -1042,7 +1045,7 @@
result = handler.invoke(invocation);
}
- if (trace) { log.trace(this + " successfully dispatched invocation, returning " + result + " from subsystem " + subsystem + " to client " + clientId); }
+ if (trace) { log.trace(this + " successfully dispatched invocation, returning " + result + " from subsystem '" + subsystem + "' to client " + clientId); }
}
return result;
@@ -1430,7 +1433,7 @@
public void start() throws IOException
{
started = true;
- log.debug(this + " started for locator: " + getLocator());
+ log.debug(this + " started for locator " + getLocator());
}
/**
More information about the jboss-cvs-commits
mailing list