User: starksm
Date: 02/02/12 00:15:36
Modified: src/main/org/jboss/ejb/plugins/jms DLQHandler.java
JMSContainerInvoker.java
Log:
Change all use of log.debug to log.trace for method that are in the
invocation path or associated with timers. Debug is only for O(1)
messages.
Revision Changes Path
1.9 +9 -12 jboss/src/main/org/jboss/ejb/plugins/jms/DLQHandler.java
Index: DLQHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jms/DLQHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DLQHandler.java 9 Feb 2002 16:09:24 -0000 1.8
+++ DLQHandler.java 12 Feb 2002 08:15:36 -0000 1.9
@@ -52,7 +52,7 @@
* Created: Thu Aug 23 21:17:26 2001
*
* @author
- * @version $Revision: 1.8 $ $Date: 2002/02/09 16:09:24 $
+ * @version $Revision: 1.9 $ $Date: 2002/02/12 08:15:36 $
*/
public class DLQHandler
@@ -188,8 +188,7 @@
// if we can't get the id we are basically fucked
if(id != null && incrementResentCount(id) > maxResent)
{
- if (log.isInfoEnabled())
- log.info("Message resent too many time, sending it to DLQ. Id: " +
id);
+ log.info("Message resent too many time, sending it to DLQ. Id: " + id);
sendMessage(msg);
deleteFromBuffer(id);
return true;
@@ -213,11 +212,11 @@
protected int incrementResentCount(String id)
{
BufferEntry entry = null;
- boolean debug = log.isDebugEnabled();
+ boolean trace = log.isTraceEnabled();
if(!resentBuffer.containsKey(id))
{
- if (debug)
- log.debug("Making new entry for id " + id);
+ if (trace)
+ log.trace("Making new entry for id " + id);
entry = new BufferEntry();
entry.id = id;
entry.count = 1;
@@ -226,8 +225,8 @@
{
entry = (BufferEntry)resentBuffer.get(id);
entry.count++;
- if (debug)
- log.debug("Incremented old entry for id " + id + " count " + entry.count);
+ if (trace)
+ log.trace("Incremented old entry for id " + id + " count " + entry.count);
}
return entry.count;
}
@@ -258,8 +257,8 @@
ses = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
sender = ses.createSender(dlq);
- if (log.isDebugEnabled())
- log.debug("Resending DLQ message to destination" + dlq);
+ if (log.isTraceEnabled())
+ log.trace("Resending DLQ message to destination" + dlq);
sender.send(msg,deliveryMode,priority,timeToLive);
}
finally
@@ -283,7 +282,6 @@
*/
protected Message makeWritable(Message msg) throws JMSException
{
-
Hashtable tmp = new Hashtable();
// Save properties
for(Enumeration en = msg.getPropertyNames();en.hasMoreElements();)
@@ -295,7 +293,6 @@
msg.clearProperties();
Enumeration keys = tmp.keys();
-
while(keys.hasMoreElements())
{
String key = (String) keys.nextElement();
1.44 +10 -29
jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java
Index: JMSContainerInvoker.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- JMSContainerInvoker.java 9 Feb 2002 16:09:24 -0000 1.43
+++ JMSContainerInvoker.java 12 Feb 2002 08:15:36 -0000 1.44
@@ -56,7 +56,7 @@
* </a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.43 $
+ * @version $Revision: 1.44 $
*/
public class JMSContainerInvoker
implements ContainerInvoker, XmlLoadable
@@ -341,7 +341,7 @@
* @param element Description of Parameter
* @exception DeploymentException Description of Exception
*/
- public void importXml(Element element) throws DeploymentException
+ public void importXml(Element element) throws Exception
{
try
{
@@ -430,20 +430,15 @@
* @throws Exception Failed to initalize.
*/
public void innerCreate() throws Exception
-
{
- boolean debug = log.isDebugEnabled();
- if (debug)
log.debug("initializing");
- // Set up Dead Letter Queue handler
-
- if (useDLQ) {
-
+ // Set up Dead Letter Queue handler
+ if (useDLQ)
+ {
dlqHandler = new DLQHandler();
dlqHandler.importXml(dlqConfig);
dlqHandler.create();
-
}
// Store TM reference locally - should we test for CMT Required
@@ -477,12 +472,10 @@
// Get the JMS provider
JMSProviderAdapter adapter = getJMSProviderAdapter();
- if (debug)
log.debug("provider adapter: " + adapter);
// Connect to the JNDI server and get a reference to root context
Context context = adapter.getInitialContext();
- if (debug)
log.debug("context: " + context);
// if we can't get the root context then exit with an exception
@@ -493,8 +486,7 @@
// Get the JNDI suffix of the destination
String jndiSuffix = parseJndiSuffix(destinationJNDI,
- config.getEjbName());
- if (debug)
+ config.getEjbName());
log.debug("jndiSuffix: " + jndiSuffix);
// Unfortunately the destination is optional, so if we do not have one
@@ -508,7 +500,6 @@
if (destinationType.equals("javax.jms.Topic"))
{
- if (debug)
log.debug("Got destination type Topic for " + config.getEjbName());
// create a topic connection
@@ -561,13 +552,10 @@
pool,
maxMessagesNr);
}
-
- if (debug)
log.debug("Topic connectionConsumer set up");
}
else if (destinationType.equals("javax.jms.Queue"))
{
- if (debug)
log.debug("Got destination type Queue for " + config.getEjbName());
// create a queue connection
@@ -590,7 +578,6 @@
// tx
acknowledgeMode,
new MessageListenerImpl(this));
- if (debug)
log.debug("server session pool: " + pool);
// create the connection consumer
@@ -599,11 +586,9 @@
messageSelector,
pool,
maxMessagesNr);
- if (debug)
log.debug("connection consumer: " + connectionConsumer);
}
- if (debug)
log.debug("initialized with config " + toString());
}
@@ -652,9 +637,9 @@
*/
public void start() throws Exception
{
- if (log.isDebugEnabled())
log.debug("Starting JMSContainerInvoker for bean " + beanName);
- if( connection != null ) {
+ if( connection != null )
+ {
connection.setExceptionListener(exListener);
connection.start();
}
@@ -665,7 +650,6 @@
*/
public void stop()
{
- if (log.isDebugEnabled())
log.debug("Stopping JMSContainerInvoker for bean " + beanName);
// Silence the exception listener
if (exListener != null)
@@ -730,7 +714,6 @@
Context context = new InitialContext();
try
{
- if (log.isDebugEnabled())
log.debug("looking up provider adapter: " + providerAdapterJNDI);
return (JMSProviderAdapter)context.lookup(providerAdapterJNDI);
}
@@ -831,7 +814,6 @@
try
{
// first lookup the factory
- if (log.isDebugEnabled())
log.debug("looking up session pool factory: " +
serverSessionPoolFactoryJNDI);
ServerSessionPoolFactory factory = (ServerSessionPoolFactory)
@@ -959,10 +941,9 @@
public void onMessage(final Message message)
{
// assert message != null;
-
- if (log.isDebugEnabled())
+ if (log.isTraceEnabled())
{
- log.debug("processing message: " + message);
+ log.trace("processing message: " + message);
}
Object id;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development