[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport/socket ...
Tom Elrod
tom.elrod at jboss.com
Wed Aug 16 10:20:17 EDT 2006
User: telrod
Date: 06/08/16 10:20:17
Modified: src/main/org/jboss/remoting/transport/socket
ServerThread.java
Log:
JBREM-562 - pulling out some logging for performance boost.
Revision Changes Path
1.27 +19 -13 JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerThread.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/socket/ServerThread.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- ServerThread.java 5 Jul 2006 16:51:54 -0000 1.26
+++ ServerThread.java 16 Aug 2006 14:20:17 -0000 1.27
@@ -54,7 +54,7 @@
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
*/
public class ServerThread extends Thread
{
@@ -73,6 +73,9 @@
protected Class serverSocketClass = null;
private Constructor serverSocketConstructor = null;
+ private static final boolean isTrace = log.isTraceEnabled();
+ private static final boolean isDebug = log.isDebugEnabled();
+
/**
* Indicates if will check the socket connection when
* getting from pool by sending byte over the connection
@@ -242,7 +245,7 @@
running = true;
handlingResponse = true;
this.notify();
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("Have woken up " + getName());
}
@@ -285,7 +288,7 @@
}
else
{
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("removing from clientpool and adding to threadpool " + this);
}
@@ -299,12 +302,12 @@
try
{
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("begin thread wait");
}
this.wait();
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("WAKEUP in SERVER THREAD");
}
@@ -324,9 +327,12 @@
}
catch (Exception ignored)
{
+ if(isDebug)
+ {
log.debug("Exiting run on exception", ignored);
}
}
+ }
protected void acknowledge() throws Exception
@@ -391,7 +397,7 @@
protected void processInvocation() throws Exception
{
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("processing invocation in server thread.");
}
@@ -507,7 +513,7 @@
*/
protected void dorun()
{
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace("beginning dorun");
}
@@ -535,7 +541,7 @@
}
catch (AcknowledgeFailure e)
{
- if (!shutdown)
+ if (!shutdown && isTrace)
{
log.trace("Keep alive acknowledge failed.");
}
@@ -553,7 +559,7 @@
}
catch (InterruptedException e)
{
- if(log.isTraceEnabled())
+ if(isTrace)
{
log.trace(e);
}
@@ -564,7 +570,7 @@
}
catch (EOFException eof)
{
- if (!shutdown)
+ if (!shutdown && isTrace)
{
log.trace("EOF received. This is likely due to client finishing comminication.");
}
@@ -573,7 +579,7 @@
}
catch (SocketException sex)
{
- if (!shutdown)
+ if (!shutdown && isTrace)
{
log.trace("SocketException received. This is likely due to client disconnecting and resetting connection.");
}
More information about the jboss-cvs-commits
mailing list