User: chirino
Date: 01/06/24 14:15:31
Modified: src/main/org/jbossmq/server BasicQueue.java
ClientConsumer.java ExclusiveQueue.java
InvocationLayerFactory.java
JBossMQServiceMBean.java JMSDestination.java
JMSServer.java JMSServerMBean.java
PersistenceManager.java SharedQueue.java
StartServer.java UserManager.java
Log:
Updateing the JBossMQ libs to the latest JBoss base libs
and Adding log4j logging to the JBossMQ sever
Revision Changes Path
1.5 +5 -6 jbossmq/src/main/org/jbossmq/server/BasicQueue.java
Index: BasicQueue.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/BasicQueue.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BasicQueue.java 2001/06/24 04:07:17 1.4
+++ BasicQueue.java 2001/06/24 21:15:30 1.5
@@ -32,10 +32,9 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
-abstract public class BasicQueue implements Runnable, AbstractQueue {
-
+abstract public class BasicQueue implements Runnable {
//List of messages waiting to be dispatched
TreeSet messages = new TreeSet();
//The JMSServer object
@@ -64,7 +63,7 @@
public void addMessage(SpyMessage mes, Long txId) throws JMSException
{
- Log.log(""+this+"->addMessage(mes="+mes+",txId="+txId+")");
+ cat.debug(""+this+"->addMessage(mes="+mes+",txId="+txId+")");
// This task gets run to make the message visible in the queue.
class AddMessagePostCommitTask implements Runnable {
@@ -135,11 +134,10 @@
}
public void notifyMessageAvailable() {
-
- Log.log(""+this+"->notifyMessageAvailable()");
-
try {
+ cat.debug(""+this+"->notifyMessageAvailable()");
server.executor.execute(this);
+ cat.debug(""+this+"->notifyMessageAvailable(), done");
} catch ( InterruptedException ignore ) {
}
@@ -186,4 +184,5 @@
}
}
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(BasicQueue.class);
}
1.6 +20 -18 jbossmq/src/main/org/jbossmq/server/ClientConsumer.java
Index: ClientConsumer.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/ClientConsumer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ClientConsumer.java 2001/06/24 04:07:17 1.5
+++ ClientConsumer.java 2001/06/24 21:15:30 1.6
@@ -31,10 +31,9 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class ClientConsumer implements Runnable {
-
//List of messages waiting to be transmitted to the client
private LinkedList messages = new LinkedList();
//The JMSServer object
@@ -62,7 +61,7 @@
void acknowledge(AcknowledgementRequest item, Long txId) throws
javax.jms.JMSException {
- Log.log(""+this+"->acknowledge(item="+item+",txId="+txId+")");
+ cat.debug(""+this+"->acknowledge(item="+item+",txId="+txId+")");
// This task gets run to place the neg ack a messge (place it back on
the queue)
class RestoreMessageTask implements Runnable {
@@ -70,7 +69,7 @@
int subscriptionId;
RestoreMessageTask(SpyMessage m,int subscriptionId) { message
= m; this.subscriptionId=subscriptionId; }
public void run() {
- Log.log("Restoring message: " +
message.getJMSMessageID());
+ cat.debug("Restoring message: " +
message.getJMSMessageID());
String queueId=JMSDestination.DEFAULT_QUEUE_ID;;
if( message.getJMSDestination() instanceof SpyTopic ) {
Subscription req =
(Subscription)subscriptions.get(new Integer(subscriptionId));
@@ -108,14 +107,14 @@
Runnable task = new RestoreMessageTask(m,item.subscriberId);
server.persistenceManager.addPostRollbackTask(txId, task);
- Log.log("Message Ack: " + m.messageId);
+ cat.debug("Message Ack: " + m.messageId);
}
}
public void addMessage(SpyMessage message) throws JMSException
{
- Log.log(""+this+"->addMessage(message="+message+")");
+ cat.debug(""+this+"->addMessage(message="+message+")");
LinkedList l = (LinkedList)destinationSubscriptions.get(
message.getJMSDestination() );
if( l == null )
@@ -143,7 +142,7 @@
public void addSubscription(Subscription req) throws JMSException
{
- Log.log(""+this+"->addSubscription(req="+req+")");
+ cat.debug(""+this+"->addSubscription(req="+req+")");
req.dc = dc;
@@ -194,7 +193,7 @@
//
public void close() {
- Log.log(""+this+"->close()");
+ cat.debug(""+this+"->close()");
synchronized (subscriptions) {
Iterator i = subscriptions.keySet().iterator();
@@ -226,7 +225,7 @@
public void listenerChange(int subscriberId, boolean state) throws
JMSException {
- Log.log(""+this+"->listenerChange(subscriberId="+subscriberId+",
state="+state+")");
+ cat.debug(""+this+"->listenerChange(subscriberId="+subscriberId+",
state="+state+")");
Subscription req = (Subscription)subscriptions.get(new
Integer(subscriberId));
if( req == null )
@@ -243,7 +242,7 @@
public void notifyMessageAvailable() {
- Log.log(""+this+"->notifyMessageAvailable()");
+ cat.debug(""+this+"->notifyMessageAvailable()");
synchronized (messages) {
if( messages.size() == 0 )
@@ -258,7 +257,7 @@
public SpyMessage receive(int subscriberId, long wait) throws JMSException {
- Log.log(""+this+"->receive(subscriberId="+subscriberId+",
wait="+wait+")");
+ cat.debug(""+this+"->receive(subscriberId="+subscriberId+",
wait="+wait+")");
Subscription req = (Subscription)subscriptions.get(new
Integer(subscriberId));
if( req == null )
@@ -289,7 +288,7 @@
public void removeSubscription(int subscriptionId) throws JMSException
{
-
Log.log(""+this+"->removeSubscription(subscriberId="+subscriptionId+")");
+
cat.debug(""+this+"->removeSubscription(subscriberId="+subscriptionId+")");
Subscription req;
synchronized (subscriptions ) {
@@ -341,7 +340,7 @@
// consuming.
synchronized public void run() {
- Log.log(""+this+"->run()");
+ cat.debug(""+this+"->run()");
ReceiveRequest[] job;
synchronized (messages) {
@@ -356,12 +355,11 @@
try {
dc.cr.receive(job);
} catch ( Exception e ) {
- Log.notice("Could not send messages to a receiver.");
- Log.notice(e);
+ cat.warn("Could not send messages to a receiver.", e);
try {
server.connectionFailure(dc);
} catch ( Throwable ignore ) {
- Log.notice("Could not close the client connection..");
+ cat.warn("Could not close the client connection..",
ignore);
}
}
@@ -370,7 +368,7 @@
// Get the first message off the queue that I can. return false if none taken.
public boolean scanExclusiveQueue( ExclusiveQueue queue ) throws JMSException {
- Log.log(""+this+"->scanExclusiveQueue(queue="+queue+")");
+ cat.debug(""+this+"->scanExclusiveQueue(queue="+queue+")");
Iterator i = queue.messages.iterator();
while( i.hasNext() ) {
@@ -419,15 +417,19 @@
}
public void setEnabled(boolean enabled) {
- Log.log(""+this+"->setEnabled(enabled="+enabled+")");
+ cat.debug(""+this+"->setEnabled(enabled="+enabled+")");
this.enabled = enabled;
}
public String toString() {
return "ClientConsumer:"+dc.getClientID();
}
+
+
+
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(ClientConsumer.class);
- public org.jbossmq.server.AbstractQueue getSubscribedQueue( Subscription req )
throws javax.jms.JMSException {
+ public BasicQueue getSubscribedQueue( Subscription req ) throws
javax.jms.JMSException {
JMSDestination
queue=(JMSDestination)server.getJMSDestination(req.destination);
if (queue==null) throw new JMSException("This destination does not
exist !");
1.4 +5 -6 jbossmq/src/main/org/jbossmq/server/ExclusiveQueue.java
Index: ExclusiveQueue.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/ExclusiveQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ExclusiveQueue.java 2001/06/24 04:07:17 1.3
+++ ExclusiveQueue.java 2001/06/24 21:15:30 1.4
@@ -17,7 +17,7 @@
import java.util.Iterator;
import java.util.LinkedList;
-import org.jbossmq.Log;
+
import org.jbossmq.selectors.Selector;
import org.jbossmq.SpyMessage;
@@ -28,16 +28,14 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class ExclusiveQueue extends BasicQueue {
-
-
// Iterate over the consumers asking them to take messages until they stop
// consuming.
public void run() {
- Log.log("" + this +"->run()");
+ cat.debug("" + this +"->run()");
synchronized (messages) {
synchronized (consumers) {
@@ -61,8 +59,7 @@
}
} catch (JMSException e) {
- Log.error("Client consumer failed");
- Log.error(e);
+ cat.warn("Client consumer failed", e);
}
}
@@ -86,4 +83,6 @@
{
super(server);
}
+
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(ExclusiveQueue.class);
}
1.4 +3 -5 jbossmq/src/main/org/jbossmq/server/InvocationLayerFactory.java
Index: InvocationLayerFactory.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/InvocationLayerFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InvocationLayerFactory.java 2001/05/22 04:54:36 1.3
+++ InvocationLayerFactory.java 2001/06/24 21:15:30 1.4
@@ -25,7 +25,7 @@
import java.rmi.Remote;
-import org.jbossmq.Log;
+
import org.jbossmq.server.JMSServer;
import org.jbossmq.SpyXATopicConnectionFactory;
import org.jbossmq.SpyQueueConnectionFactory;
@@ -44,10 +44,6 @@
public class InvocationLayerFactory
{
-
-
-
-
// These will be set after the createObjects() call
DistributedJMSServerSetup distributedJMSServerSetup;
DistributedJMSServer distributedJMSServer;
@@ -91,4 +87,6 @@
public InvocationLayerFactory(XElement c) {
config = c;
}
+
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(InvocationLayerFactory.class);
}
1.3 +8 -1 jbossmq/src/main/org/jbossmq/server/JBossMQServiceMBean.java
Index: JBossMQServiceMBean.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/JBossMQServiceMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JBossMQServiceMBean.java 2001/03/02 01:13:01 1.2
+++ JBossMQServiceMBean.java 2001/06/24 21:15:30 1.3
@@ -35,13 +35,20 @@
* See terms of license at gnu.org.
*/
+/*
+ * jBoss, the OpenSource EJB server
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+
/**
* <description>
* MBean interface for the JBossMQ JMX service.
*
* @see <related>
* @author Vincent Sheffer ([EMAIL PROTECTED])
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public interface JBossMQServiceMBean
extends org.jboss.util.ServiceMBean
1.4 +10 -10 jbossmq/src/main/org/jbossmq/server/JMSDestination.java
Index: JMSDestination.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/JMSDestination.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JMSDestination.java 2001/05/15 07:16:48 1.3
+++ JMSDestination.java 2001/06/24 21:15:30 1.4
@@ -29,10 +29,9 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class JMSDestination {
-
public static final String DEFAULT_QUEUE_ID = "queue";
//the Destination of this queue
@@ -74,7 +73,7 @@
public void addMessage(SpyMessage mes, Long txId) throws JMSException
{
- Log.log(""+this+"->addMessage(mes="+mes+",txId="+txId+")");
+ cat.debug(""+this+"->addMessage(mes="+mes+",txId="+txId+")");
if( mes.getJMSDeliveryMode() == DeliveryMode.PERSISTENT &&
temporaryDestination!=null ) {
@@ -126,7 +125,7 @@
// Package protected ---------------------------------------------
void addExclusiveConsumer(String queue, ClientConsumer c) throws JMSException {
- Log.log(""+this+"->addExclusiveConsumer(queue="+queue+",
consumer="+c+")");
+ cat.debug(""+this+"->addExclusiveConsumer(queue="+queue+",
consumer="+c+")");
ExclusiveQueue eq = getExclusiveQueue( queue );
if( eq == null )
@@ -137,12 +136,12 @@
// Package protected ---------------------------------------------
void addSharedConsumer(ClientConsumer c) throws JMSException {
- Log.log(""+this+"->addSharedConsumer(consumer="+c+")");
+ cat.debug(""+this+"->addSharedConsumer(consumer="+c+")");
sharedQueue.addConsumer(c);
}
public SpyMessage[] browse(String selector) throws JMSException {
- Log.log(""+this+"->browse(selector="+selector+")");
+ cat.debug(""+this+"->browse(selector="+selector+")");
ExclusiveQueue eq = getExclusiveQueue( DEFAULT_QUEUE_ID );
return eq.browse( selector );
}
@@ -158,7 +157,7 @@
// Package protected ---------------------------------------------
void removeConsumerFromAll(ClientConsumer c) throws JMSException {
- Log.log(""+this+"->removeConsumerFromAll(consumer="+c+")");
+ cat.debug(""+this+"->removeConsumerFromAll(consumer="+c+")");
sharedQueue.removeConsumer(c);
@@ -175,7 +174,7 @@
// Package protected ---------------------------------------------
void removeExclusiveConsumer(String queue, ClientConsumer c) throws
JMSException {
- Log.log(""+this+"->removeExclusiveConsumer(queue="+queue+",
consumer="+c+")");
+ cat.debug(""+this+"->removeExclusiveConsumer(queue="+queue+",
consumer="+c+")");
ExclusiveQueue eq = getExclusiveQueue( queue );
if( eq == null )
@@ -186,14 +185,14 @@
// Package protected ---------------------------------------------
void removeSharedConsumer(ClientConsumer c) throws JMSException {
- Log.log(""+this+"->removeSharedConsumer(consumer="+c+")");
+ cat.debug(""+this+"->removeSharedConsumer(consumer="+c+")");
sharedQueue.removeConsumer(c);
}
//Used to put a message that was added previously to the queue, back in the
queue
public void restoreMessage(SpyMessage mes, String queueId)
{
- Log.log(""+this+"->restoreMessage(mes="+mes+",queue="+queueId+")");
+ cat.debug(""+this+"->restoreMessage(mes="+mes+",queue="+queueId+")");
synchronized(this) {
messageIdCounter = Math.max(messageIdCounter, mes.messageId+1);
}
@@ -238,4 +237,5 @@
return clientId+"-"+subscriptionName;
}
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(JMSDestination.class);
}
1.10 +18 -16 jbossmq/src/main/org/jbossmq/server/JMSServer.java
Index: JMSServer.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/JMSServer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JMSServer.java 2001/06/24 04:07:17 1.9
+++ JMSServer.java 2001/06/24 21:15:30 1.10
@@ -38,17 +38,16 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
public class JMSServer
implements JMSServerMBean
{
-
/////////////////////////////////////////////////////////////////////
// Attributes
/////////////////////////////////////////////////////////////////////
public static final String OBJECT_NAME = "JMS:service=JMSServer";
- final int NB_THREADS=1;
+
//messages pending for a Destination ( HashMap of JMSServerQueue objects )
public HashMap messageQueue;
@@ -93,14 +92,16 @@
executor = new PooledExecutor(new BoundedBuffer(10), 25);
executor.setMinimumPoolSize(0);
- executor.setKeepAliveTime(10);
+ executor.setKeepAliveTime(1000*30);
executor.waitWhenBlocked();
executor.setThreadFactory( new ThreadFactory() {
public Thread newThread(Runnable command) {
+ cat.debug("Creating new worker to process:
"+command);
return new Thread( threadGroup, command,
"Thread Pool Worker");
}
}
);
+
lastID=1;
lastTemporaryTopic=1;
}
@@ -131,7 +132,7 @@
// Administration calls
public SpyTopic newTopic(String name) throws JMSException
{
- Log.notice("new topic : "+name);
+ cat.debug("new topic : "+name);
SpyTopic newTopic=new SpyTopic(name);
if (messageQueue.containsKey(newTopic)) throw new JMSException("This
topic already exists !");
@@ -221,7 +222,7 @@
public void destroyTopic(String name) throws JMSException
{
- Log.notice("destroy topic : "+name);
+ cat.debug("destroy topic : "+name);
SpyTopic destroyTopic=new SpyTopic(name);
if (!messageQueue.containsKey(destroyTopic)) throw new
JMSException("This topic doesn't exist!");
@@ -287,7 +288,7 @@
public SpyQueue newQueue(String name) throws JMSException
{
- Log.notice("new queue : "+name);
+ cat.debug("new queue : "+name);
SpyQueue newQueue=new SpyQueue(name);
if (messageQueue.containsKey(newQueue)) throw new JMSException("This
queue already exists !");
@@ -379,7 +380,7 @@
public void destroyQueue(String name) throws JMSException
{
- Log.notice("destroy queue : "+name);
+ cat.debug("destroy queue : "+name);
SpyQueue destroyQueue=new SpyQueue(name);
if (!messageQueue.containsKey(destroyQueue)) throw new
JMSException("This queue doesn't exist!");
@@ -516,7 +517,7 @@
public void addMessage(SpyDistributedConnection dc, SpyMessage val, Long txId)
throws JMSException
{
- Log.notice("INCOMING: (TX="+txId+")"+dc.getClientID()+" =>
"+val.getJMSDestination());
+ cat.debug("INCOMING: (TX="+txId+")"+dc.getClientID()+" =>
"+val.getJMSDestination());
JMSDestination
queue=(JMSDestination)messageQueue.get(val.getJMSDestination());
if (queue==null) throw new JMSException("This destination does not
exist !");
//Add the message to the queue
@@ -614,7 +615,7 @@
//A connection is closing [error or notification]
public synchronized void connectionClosing(SpyDistributedConnection dc) throws
JMSException
{
- Log.log("JMSServer->connectionClosing(dc="+dc+")");
+ cat.debug("JMSServer->connectionClosing(dc="+dc+")");
if (dc==null) return;
// Close it's ClientConsumer
@@ -645,10 +646,10 @@
public void connectionFailure(SpyDistributedConnection dc) throws JMSException
{
- Log.log("JMSServer->connectionFailure(dc="+dc+")");
+ cat.debug("JMSServer->connectionFailure(dc="+dc+")");
//We should try again :) This behavior should under control of a
Failure-Plugin
- Log.error("The connection to client "+dc.getClientID()+" failed.");
+ cat.error("The connection to client "+dc.getClientID()+" failed.");
connectionClosing(dc);
}
@@ -673,7 +674,7 @@
//A connection object wants to subscribe to a Destination
public void subscribe(SpyDistributedConnection dc, Subscription sub) throws
JMSException
{
- Log.log("Server:
subscribe(dest="+sub.destination+",idConnection="+dc.getClientID()+")");
+ cat.debug("Server:
subscribe(dest="+sub.destination+",idConnection="+dc.getClientID()+")");
ClientConsumer ClientConsumer = getClientConsumer(dc);
@@ -683,7 +684,7 @@
public void unsubscribe(SpyDistributedConnection dc, int subscriptionId)
throws JMSException
{
- Log.log("Server: unsubscribe(idConnection="+dc.getClientID()+")");
+ cat.debug("Server: unsubscribe(idConnection="+dc.getClientID()+")");
ClientConsumer ClientConsumer = getClientConsumer(dc);
@@ -717,7 +718,7 @@
public synchronized Queue createQueue(SpyDistributedConnection dc, String
name) throws JMSException
{
- Log.log("createQueue("+name+")");
+ cat.debug("createQueue("+name+")");
SpyQueue newQueue=new SpyQueue(name);
if (!messageQueue.containsKey(newQueue)) throw new JMSException("This
destination does not exist !");
@@ -726,7 +727,7 @@
public synchronized Topic createTopic(SpyDistributedConnection dc, String
name) throws JMSException
{
- Log.log("createTopic("+name+")");
+ cat.debug("createTopic("+name+")");
SpyTopic newTopic=new SpyTopic(name);
if (!messageQueue.containsKey(newTopic)) throw new JMSException("This
destination does not exist !");
@@ -735,7 +736,7 @@
public synchronized void deleteTemporaryDestination(SpyDistributedConnection
dc, SpyDestination dest)
{
- Log.log("deleteDestination(dest="+dest.toString()+")");
+ cat.debug("deleteDestination(dest="+dest.toString()+")");
synchronized (messageQueue) {
HashMap newMap=(HashMap)messageQueue.clone();
@@ -770,6 +771,7 @@
return userManager.checkUser(userName, password);
}
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(JMSServer.class);
// This manages our thread pool.
public PooledExecutor executor;
public ThreadGroup threadGroup;
1.4 +6 -6 jbossmq/src/main/org/jbossmq/server/JMSServerMBean.java
Index: JMSServerMBean.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/JMSServerMBean.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JMSServerMBean.java 2001/03/14 21:36:54 1.3
+++ JMSServerMBean.java 2001/06/24 21:15:30 1.4
@@ -16,13 +16,13 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public interface JMSServerMBean
{
- public SpyTopic newTopic(String name) throws JMSException;
- public void destroyTopic(String name) throws JMSException;
+ public SpyTopic newTopic(String name) throws JMSException;
+ public void destroyTopic(String name) throws JMSException;
- public SpyQueue newQueue(String name) throws JMSException;
- public void destroyQueue(String name) throws JMSException;
-}
+ public SpyQueue newQueue(String name) throws JMSException;
+ public void destroyQueue(String name) throws JMSException;
+}
\ No newline at end of file
1.5 +31 -31 jbossmq/src/main/org/jbossmq/server/PersistenceManager.java
Index: PersistenceManager.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/PersistenceManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PersistenceManager.java 2001/05/15 07:16:48 1.4
+++ PersistenceManager.java 2001/06/24 21:15:30 1.5
@@ -23,7 +23,7 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Paul Kendall ([EMAIL PROTECTED])
*
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public abstract class PersistenceManager {
@@ -84,22 +84,22 @@
public final Long createTx(SpyDistributedConnection dc, Object xid) throws
javax.jms.JMSException {
GlobalXID gxid = new GlobalXID(dc, xid);
- synchronized(globalToLocal){
- if( globalToLocal.containsKey(gxid) )
- throw new JMSException("Duplicate transaction from: "+dc.getClientID()+"
xid="+xid);
- }
+ synchronized(globalToLocal){
+ if( globalToLocal.containsKey(gxid) )
+ throw new JMSException("Duplicate transaction from:
"+dc.getClientID()+" xid="+xid);
+ }
Long txId = createTx();
- synchronized(globalToLocal){
+ synchronized(globalToLocal){
globalToLocal.put(gxid, txId);
- }
+ }
//Tasks to remove the global to local mappings on commit/rollback
addPostCommitTask(txId, gxid);
addPostRollbackTask(txId, gxid);
return txId;
- }
+ }
/**
* Commit the transaction to the persistent store.
@@ -114,16 +114,16 @@
if( tasks == null )
throw new javax.jms.JMSException("Transaction is not active
for commit.");
- commitPersistentTx(txId);
+ commitPersistentTx(txId);
- synchronized(tasks){
- Iterator iter = tasks.iterator();
- while( iter.hasNext() ) {
- Runnable task = (Runnable)iter.next();
- task.run();
- }
- }
- }
+ synchronized(tasks){
+ Iterator iter = tasks.iterator();
+ while( iter.hasNext() ) {
+ Runnable task = (Runnable)iter.next();
+ task.run();
+ }
+ }
+ }
public final void addPostCommitTask(Long txId, Runnable task) throws
javax.jms.JMSException {
@@ -153,21 +153,21 @@
synchronized( postCommitTasks ) {
tasks = (LinkedList)postRollbackTasks.remove(txId);
postCommitTasks.remove(txId);
- }
+ }
if( tasks == null )
throw new javax.jms.JMSException("Transaction is not active
3.");
- rollbackPersistentTx(txId);
+ rollbackPersistentTx(txId);
- synchronized(tasks){
- Iterator iter = tasks.iterator();
- while( iter.hasNext() ) {
- Runnable task = (Runnable)iter.next();
- task.run();
- }
- }
+ synchronized(tasks){
+ Iterator iter = tasks.iterator();
+ while( iter.hasNext() ) {
+ Runnable task = (Runnable)iter.next();
+ task.run();
+ }
+ }
- }
+ }
public final void addPostRollbackTask(Long txId, Runnable task) throws
javax.jms.JMSException {
@@ -193,15 +193,15 @@
public final Long getPrepared(SpyDistributedConnection dc, Object xid) throws
javax.jms.JMSException {
GlobalXID gxid = new GlobalXID(dc, xid);
- Long txid;
- synchronized(globalToLocal){
+ Long txid;
+ synchronized(globalToLocal){
txid = (Long)globalToLocal.get(gxid);
- }
+ }
if( txid == null )
throw new JMSException("Transaction does not exist from:
"+dc.getClientID()+" xid="+xid);
return txid;
- }
+ }
/**
* Restore messages from the persistent queues.
1.4 +7 -7 jbossmq/src/main/org/jbossmq/server/SharedQueue.java
Index: SharedQueue.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/SharedQueue.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SharedQueue.java 2001/06/24 04:07:17 1.3
+++ SharedQueue.java 2001/06/24 21:15:30 1.4
@@ -16,7 +16,7 @@
import java.util.Iterator;
-import org.jbossmq.Log;
+
import org.jbossmq.SpyMessage;
/**
@@ -26,10 +26,9 @@
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class SharedQueue extends BasicQueue {
-
// Constructor ---------------------------------------------------
SharedQueue(JMSServer server) throws JMSException
{
@@ -40,12 +39,12 @@
// This will dispatch messages in the queue the the ClientConsumers
public void run()
{
- Log.log(""+this+"->run()");
+ cat.debug(""+this+"->run()");
SpyMessage[] job;
synchronized (messages) {
if( messages.size() == 0 ) {
- Log.log(""+this+"->run() : No Messages");
+ cat.debug(""+this+"->run() : No Messages");
return;
}
@@ -55,7 +54,7 @@
}
if( consumers.size() == 0 ) {
- Log.log(""+this+"->run() : No consumers");
+ cat.debug(""+this+"->run() : No consumers");
return;
}
@@ -70,8 +69,7 @@
consumer.notifyMessageAvailable();
} catch ( JMSException e ) {
- Log.error("Client consumer failed");
- Log.error(e);
+ cat.debug("Client consumer failed",e);
}
}
@@ -81,4 +79,6 @@
public String toString() {
return "SharedQueue";
}
+
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(SharedQueue.class);
}
1.8 +0 -0 jbossmq/src/main/org/jbossmq/server/StartServer.java
Index: StartServer.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/StartServer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StartServer.java 2001/06/24 02:15:12 1.7
+++ StartServer.java 2001/06/24 21:15:30 1.8
@@ -50,7 +50,7 @@
* @author Vincent Sheffer ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
*/
public class StartServer implements Runnable
{
1.5 +7 -8 jbossmq/src/main/org/jbossmq/server/UserManager.java
Index: UserManager.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jbossmq/server/UserManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- UserManager.java 2001/05/17 23:34:37 1.4
+++ UserManager.java 2001/06/24 21:15:30 1.5
@@ -16,7 +16,7 @@
import javax.jms.JMSSecurityException;
import javax.jms.InvalidClientIDException;
-import org.jbossmq.Log;
+
import org.jbossmq.SpyTopic;
import org.jbossmq.server.JMSServer;
import org.jbossmq.xml.XElement;
@@ -27,11 +27,9 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class UserManager {
-
-
//registered loggedOnClientIds
private HashSet loggedOnClientIds;
JMSServer server;
@@ -75,7 +73,7 @@
}
} catch (org.jbossmq.xml.XElementException e ) {
- Log.error( e );
+ cat.error( e );
throw new JMSException("Invalid server user configuration.");
}
}
@@ -121,15 +119,14 @@
try {
- Log.log("Restarting Durable Subscription:
"+clientId+","+name+","+topicName);
+ cat.debug("Restarting Durable Subscription:
"+clientId+","+name+","+topicName);
SpyTopic topic=new SpyTopic(topicName);
JMSDestination dest = server.getJMSDestination(topic);
dest.createDurableSubscription(clientId, name);
} catch (JMSException e ) {
- Log.error("Could not initialize a durable subscription
for : Client Id="+clientId+", Name="+name+", Topic Name="+topicName);
- Log.error(e);
+ cat.error("Could not initialize a durable subscription
for : Client Id="+clientId+", Name="+name+", Topic Name="+topicName,e);
}
}
@@ -249,4 +246,6 @@
loggedOnClientIds.remove(ID);
}
}
+
+ org.apache.log4j.Category cat =
org.apache.log4j.Category.getInstance(UserManager.class);
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development