User: chirino
Date: 01/07/15 19:51:45
Modified: src/main/org/jbossmq/cluster/jms ClusterTopicConnection.java
ClusterTopicConnectionFactory.java
ClusterTopicSession.java
Log:
Moved the rest of JBossMQ over to log4j logging.
- The jbossmq-client.jar now includes a log4j.properties which sets up the logging
subsystems on the client side. To chanage the logging levels, just place your
log4j.properties in the classpath betfore the jbossmq-client.jar
Revision Changes Path
1.2 +12 -10
jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicConnection.java
Index: ClusterTopicConnection.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClusterTopicConnection.java 2001/03/02 07:04:50 1.1
+++ ClusterTopicConnection.java 2001/07/16 02:51:45 1.2
@@ -30,7 +30,7 @@
import java.util.Iterator;
import java.util.Enumeration;
-import org.jbossmq.Log;
+
import org.jbossmq.SpyMessage;
import org.jbossmq.xml.XElement;
import org.jbossmq.cluster.transport.TransportListener;
@@ -43,7 +43,7 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ClusterTopicConnection implements Serializable, TopicConnection,
TransportListener {
@@ -154,7 +154,7 @@
//A new Consumer has been created for the Destination dest
void addConsumer(ClusterTopicSubscriber consumer) throws JMSException {
- Log.log("[" + this +"]: addConsumer(dest=" + consumer.topic + ")");
+ cat.debug("[" + this +"]: addConsumer(dest=" + consumer.topic + ")");
if (closed)
throw new IllegalStateException("The connection is closed");
@@ -185,7 +185,7 @@
if (closed)
return;
- Log.log("Closing sessions, ClientID=" + getClientID());
+ cat.debug("Closing sessions, ClientID=" + getClientID());
//notify his sessions
synchronized (createdSessions) {
Object[] vect = createdSessions.toArray();
@@ -193,9 +193,9 @@
((ClusterTopicSession) vect[i]).close();
}
}
- Log.log("Closed sessions");
+ cat.debug("Closed sessions");
- Log.log("Disconnecting from the transport");
+ cat.debug("Disconnecting from the transport");
//Notify the JMSServer that I am closing
try {
transport.stop();
@@ -204,7 +204,7 @@
failureHandler(e, "Cannot properly close the transport");
}
- Log.log("Disconnected from the transport");
+ cat.debug("Disconnected from the transport");
// Only set the closed flag after all the objects that depend
// on this connection have been closed.
@@ -222,7 +222,7 @@
exceptionListener.onException(excep);
}
} else {
- Log.error(e);
+ cat.error(e);
}
throw excep;
@@ -314,11 +314,11 @@
LinkedList ll = (LinkedList)
topicSubscribers.get(message.getJMSDestination());
if (ll == null) {
// No listeners...
- Log.log("No subscriptions for message: " + message);
+ cat.debug("No subscriptions for message: " + message);
return;
}
- Log.log("Dispatching message: " + message);
+ cat.debug("Dispatching message: " + message);
Iterator i = ll.iterator();
while (i.hasNext()) {
ClusterTopicSubscriber c = (ClusterTopicSubscriber) i.next();
@@ -419,4 +419,6 @@
return;
modeStop = true;
}
+
+ static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(ClusterTopicConnection.class);
}
1.2 +5 -8
jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicConnectionFactory.java
Index: ClusterTopicConnectionFactory.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicConnectionFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClusterTopicConnectionFactory.java 2001/03/02 07:04:50 1.1
+++ ClusterTopicConnectionFactory.java 2001/07/16 02:51:45 1.2
@@ -13,7 +13,7 @@
import java.io.Serializable;
import java.util.Properties;
-import org.jbossmq.Log;
+
import org.jbossmq.xml.XElement;
/**
@@ -21,7 +21,7 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ClusterTopicConnectionFactory implements java.io.Serializable,
javax.jms.TopicConnectionFactory {
@@ -47,8 +47,7 @@
} catch (JMSException e) {
throw e;
} catch (Exception e) {
- failureHandler(e, "ClusterTopicConnection creation has failed
!");
- return null;
+ throw new org.jbossmq.SpyJMSException("ClusterTopicConnection
creation has failed !",e);
}
}
@@ -56,9 +55,7 @@
return createTopicConnection();
}
- private void failureHandler(Exception e, String reason) throws JMSException {
- Log.error(e);
- throw new JMSException(reason);
- }
+
+ static org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(ClusterTopicConnection.class);
}
1.2 +2 -2
jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicSession.java
Index: ClusterTopicSession.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/cluster/jms/ClusterTopicSession.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClusterTopicSession.java 2001/03/02 07:04:50 1.1
+++ ClusterTopicSession.java 2001/07/16 02:51:45 1.2
@@ -30,7 +30,7 @@
import java.io.ObjectOutputStream;
import java.io.IOException;
-import org.jbossmq.Log;
+
import org.jbossmq.selectors.Selector;
import org.jbossmq.SpyObjectMessage;
import org.jbossmq.SpyStreamMessage;
@@ -45,7 +45,7 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ClusterTopicSession implements TopicSession
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development