[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: starksm Date: 02/04/09 11:06:01 Modified:src/main/org/jboss/mq Tag: Branch_2_4 Connection.java Log: Integrate connection ping patch Revision ChangesPath No revision No revision 1.3.2.3 +168 -14 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -u -r1.3.2.2 -r1.3.2.3 --- Connection.java 28 Nov 2001 06:15:27 - 1.3.2.2 +++ Connection.java 9 Apr 2002 18:06:00 - 1.3.2.3 @@ -11,21 +11,22 @@ import java.io.IOException; import java.io.Serializable; import java.util.Collection; - import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; - import java.util.LinkedList; import java.util.Properties; import javax.jms.ConnectionMetaData; - import javax.jms.Destination; import javax.jms.ExceptionListener; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.Topic; +import EDU.oswego.cs.dl.util.concurrent.Semaphore; +import EDU.oswego.cs.dl.util.concurrent.ClockDaemon; +import EDU.oswego.cs.dl.util.concurrent.ThreadFactory; + import org.jboss.logging.Logger; import org.jboss.mq.il.ClientIL; import org.jboss.mq.il.ClientILService; @@ -38,7 +39,7 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Hiram Chirino ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.3.2.2 $ + * @version$Revision: 1.3.2.3 $ */ public class Connection implements java.io.Serializable, javax.jms.Connection { @@ -64,20 +65,49 @@ // The object that sets up the client IL protected ClientILService clientILService; - + /** +* Manages the thread that pings the connection to see if it is 'alive' +*/ + static protected ClockDaemon clockDaemon = new ClockDaemon(); + + /** +* How often to ping the connection +*/ + protected long pingPeriod = 1000 * 60; + + /** +* This feild is reset when a ping is sent, set when ponged. +*/ + protected boolean ponged=true; + + /** +* This is used to know when the PingTask is running +*/ + Semaphore pingTaskSemaphore = new Semaphore(1); + + /** +* Identifies the PinkTask in the ClockDaemon +*/ + Object pingTaskId; + + /** +* Set a soon as close() is called on the connection. +*/ + protected volatile boolean closing = false; + //LinkedList of all created sessions by this connection - HashSet createdSessions; + HashSet createdSessions; // Numbers subscriptions - int subscriptionCounter = Integer.MIN_VALUE; + int subscriptionCounter = Integer.MIN_VALUE; //Is the connection closed ? - boolean closed; + boolean closed; // Used to control tranactions SpyXAResourceManager spyXAResourceManager; //The class that created this connection GenericConnectionFactory genericConnectionFactory; //Last message ID returned - private int lastMessageID; + private int lastMessageID; //the exceptionListener private ExceptionListener exceptionListener; @@ -86,7 +116,26 @@ private StringBuffer sb = new StringBuffer(); private char[] charStack = new char[22]; public static ThreadGroup threadGroup = new ThreadGroup( JBossMQ Client Threads ); - + + /** +* Static class initializer.. +*/ + static + { + log.debug(Setting the clockDaemon's thread factory); + clockDaemon.setThreadFactory( + new ThreadFactory() + { +public Thread newThread(Runnable r) +{ + Thread t = new Thread(threadGroup, r, Connection Monitor Thread); + t.setDaemon(true); + return t; +} + } + ); + } + // // Constructors // @@ -130,7 +179,7 @@ // Setup the XA Resource manager, spyXAResourceManager = new SpyXAResourceManager( this ); - + startPingThread(); if( trace ) log.trace( Connection establishment successful ); } @@ -285,16 +334,15 @@ boolean trace = log.isTraceEnabled(); if( trace ) log.trace( Closing sessions, ClientID= + connectionToken.getClientID() ); + closing = true; //notify his sessions synchronized ( createdSessions ) { - Object[] vect =
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java ConnectionToken.java SpyConnection.java SpySession.java SpyXAConnection.java
User: pra Date: 02/03/06 09:27:48 Modified:src/main/org/jboss/mq Connection.java ConnectionToken.java SpyConnection.java SpySession.java SpyXAConnection.java Log: Commit of JBossMQ new JAAS based security architecture Revision ChangesPath 1.17 +300 -161 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Connection.java 2 Feb 2002 04:02:22 - 1.16 +++ Connection.java 6 Mar 2002 17:27:48 - 1.17 @@ -1,5 +1,5 @@ /* - * JBoss, the OpenSource J2EE webOS + * JBos, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. @@ -23,6 +23,7 @@ import javax.jms.Destination; import javax.jms.ExceptionListener; import javax.jms.JMSException; +import javax.jms.JMSSecurityException; import javax.jms.Queue; import javax.jms.Topic; @@ -32,11 +33,48 @@ import org.jboss.mq.il.ServerIL; /** - * This class implements javax.jms.Connection + * pThis class implements javax.jms.Connection. + * /p + * + * pIt is also the gateway through wich all calls to the JMS server is done. To + * do its work it needs a ServerIL to invoke (@see org.jboss.mq.server.ServerIL). + */p + * + * pThe (new from february 2002) logic for clientID is the following: + * if logging in with a user and passwork a preconfigured clientID may be automatically delivered from the server. + * /p + * + * pIf the client wants to set it's own clientID it must do so on a connection + * wich does not have a prefonfigured clientID and it must do so before it + * calls any other methods on the connection (even getClientID()). It is not + * allowable to use a clientID that either looks like JBossMQ internal one + * (beginning with ID) or a clientID that is allready in use by someone, or + * a clientID that is already preconfigured in the server. + */p + * + * pIf a preconfigured ID is not get, or a valid one is not set, the server will + * set an internal ID. This ID is NEVER possible to use for durable subscriptions. + * If a prefconfigured ID or one manually set is possible to use to create a + * durable subscriptions is governed by the security configuration of JBossMQ. + * In the default setup, only preconfigured clientID's are possible to use. + * If using a SecurityManager, permissions to create a surable subscriptions is * the resiult of a combination of the following: + */p + * p- The clientID is not one of JBossMQ's internal. + */p + * p- The user is authenticated and has a role that has create set to true in + * the security config of the destination. + */p + * + * pNotes for JBossMQ developers: + * All calls, except close(), that is possible to do on a connection must call + * checkClientID() + * /p + * * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.16 $ + * @author a href=[EMAIL PROTECTED]Peter Antman/a + * @version $Revision: 1.17 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -113,6 +151,11 @@ * Set a soon as close() is called on the connection. */ protected volatile boolean closing = false; + + /** +* +*/ + private volatile boolean setClientIdAllowed = true; //LinkedList of all created sessions by this connection HashSet createdSessions; @@ -134,6 +177,8 @@ //Get a new messageID (creation of a new message) private StringBuffer sb = new StringBuffer(); private char[] charStack = new char[22]; + + String sessionId; /** * Static class initializer.. @@ -184,14 +229,12 @@ } // Authenticate with the server + authenticate(userName, password); + if (userName != null) { askForAnID(userName, password); } - if (clientID == null) - { - askForAnID(); - } // Setup the ClientIL service so that the Server can // push messages to us @@ -203,9 +246,11 @@ spyXAResourceManager = new SpyXAResourceManager(this); // Used to monitor the connection. + startPingThread(); if( trace ) log.trace(Connection establishment successful); + } // @@ -217,12 +262,18 @@ { this(null, null, genericConnectionFactory); } + +
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java SpyConnectionConsumer.java
User: ejort Date: 02/01/04 22:38:13 Modified:src/main/org/jboss/mq Connection.java SpyConnectionConsumer.java Log: Guarded debug logging Revision ChangesPath 1.15 +5 -4 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Connection.java 2001/12/09 05:56:36 1.14 +++ Connection.java 2002/01/05 06:38:13 1.15 @@ -36,7 +36,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.14 $ + * @version $Revision: 1.15 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -509,8 +509,9 @@ { throw new IllegalStateException(The connection is closed); } - - log.debug(SpyConnection: deleteDestination(dest= + dest.toString() + )); + + if (log.isDebugEnabled()) + log.debug(SpyConnection: deleteDestination(dest= + dest.toString() + )); try { @@ -934,7 +935,7 @@ } Subscription req = consumer.getSubscription(); - if( log.isTraceEnabled() ) + if( log.isDebugEnabled() ) log.debug(Connection: removeSession(dest= + req.destination + )); try 1.8 +3 -2 jbossmq/src/main/org/jboss/mq/SpyConnectionConsumer.java Index: SpyConnectionConsumer.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyConnectionConsumer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- SpyConnectionConsumer.java2001/12/13 15:23:19 1.7 +++ SpyConnectionConsumer.java2002/01/05 06:38:13 1.8 @@ -20,7 +20,7 @@ * * @author Hiram Chirino ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.7 $ + * @version$Revision: 1.8 $ */ public class SpyConnectionConsumer implements javax.jms.ConnectionConsumer, SpyConsumer, Runnable @@ -222,7 +222,8 @@ if ( spySession.sessionConsumer == null ) { - log.debug( + this + Session did not have a set MessageListner ); + if (log.isDebugEnabled()) + log.debug( + this + Session did not have a set MessageListner ); } else { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java Subscription.java
User: chirino Date: 01/12/08 21:56:36 Modified:src/main/org/jboss/mq Connection.java Subscription.java Log: updated the dc variable to connectionToken. more readable. fixed the NoLocal bug that was reported on the user forums. testcase in the suite shows now that it is working. Revision ChangesPath 1.14 +2 -2 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Connection.java 2001/11/26 06:33:11 1.13 +++ Connection.java 2001/12/09 05:56:36 1.14 @@ -36,7 +36,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -816,7 +816,7 @@ Subscription req = consumer.getSubscription(); req.subscriptionId = subscriptionCounter++; - req.dc = connectionToken; + req.connectionToken = connectionToken; if( log.isTraceEnabled() ) log.trace(Connection: addConsumer(dest= + req.destination.toString() + )); 1.5 +9 -6 jbossmq/src/main/org/jboss/mq/Subscription.java Index: Subscription.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Subscription.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Subscription.java 2001/10/28 04:07:34 1.4 +++ Subscription.java 2001/12/09 05:56:36 1.5 @@ -11,6 +11,7 @@ import javax.jms.JMSException; import org.jboss.mq.selectors.Selector; +import org.jboss.logging.Logger; /** * This class contains all the data needed to for a the provider to to @@ -19,12 +20,12 @@ * @author Hiram Chirino ([EMAIL PROTECTED]) * @author David Maplesden ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.4 $ + * @version$Revision: 1.5 $ */ public class Subscription implements Serializable -{ - /** This gets set to a unique value at the SpyConnection. */ +{ + /** This gets set to a unique value at the SpyConnection. */ public int subscriptionId; /** The queue we want to subscribe to. */ @@ -41,7 +42,7 @@ // Transient Values public transient Selector selector; - public transient ConnectionToken dc; + public transient ConnectionToken connectionToken; public transient Object clientConsumer; // = null; /** @@ -64,9 +65,11 @@ */ public boolean accepts(SpyMessage.Header header) throws JMSException { if (header.jmsDestination instanceof SpyTopic) { + // In the Topic case we allways deliver unless we have a noLocal - if (noLocal header.producerClientId.equals(dc.getClientID())) { -return false; + if (noLocal ) { + if( header.producerClientId.equals(connectionToken.getClientID())) + return false; } } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: starksm Date: 01/11/25 22:33:11 Modified:src/main/org/jboss/mq Connection.java Log: Clean up the execessive logging by introducing trace level messages Revision ChangesPath 1.13 +206 -187 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Connection.java 2001/11/12 05:27:35 1.12 +++ Connection.java 2001/11/26 06:33:11 1.13 @@ -14,23 +14,21 @@ import java.io.IOException; import java.io.Serializable; import java.util.Collection; - import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; - import java.util.LinkedList; import java.util.Properties; import javax.jms.ConnectionMetaData; - import javax.jms.Destination; import javax.jms.ExceptionListener; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.Topic; + +import org.jboss.logging.Logger; import org.jboss.mq.il.ClientIL; import org.jboss.mq.il.ClientILService; - import org.jboss.mq.il.ServerIL; /** @@ -38,7 +36,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -47,8 +45,8 @@ * Description of the Field */ public static ThreadGroup threadGroup = new ThreadGroup(JBossMQ Client Threads); - - static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(Connection.class); + + static Logger log = Logger.getLogger(Connection.class); /** * Maps a destination to a LinkedList of Subscriptions @@ -66,7 +64,7 @@ // // Attributes // - + /** * This is our connection to the JMS server */ @@ -80,12 +78,12 @@ * The connection token is used to identify our connection to the server. */ protected ConnectionToken connectionToken; - + /** * The object that sets up the client IL */ protected ClientILService clientILService; - + /** * Manages the thread that pings the connection to see if it is 'alive' */ @@ -115,7 +113,7 @@ * Set a soon as close() is called on the connection. */ protected volatile boolean closing = false; - + //LinkedList of all created sessions by this connection HashSet createdSessions; // Numbers subscriptions @@ -124,60 +122,67 @@ boolean closed; // Used to control tranactions SpyXAResourceManager spyXAResourceManager; - + //The class that created this connection GenericConnectionFactory genericConnectionFactory; //Last message ID returned private int lastMessageID; - + //the exceptionListener private ExceptionListener exceptionListener; - + //Get a new messageID (creation of a new message) private StringBuffer sb = new StringBuffer(); private char[] charStack = new char[22]; - + /** * Static class initializer.. */ - static { - cat.debug(Setting the clockDaemon's thread factory); + static + { + log.debug(Setting the clockDaemon's thread factory); clockDaemon.setThreadFactory( - new ThreadFactory () { -public Thread newThread(Runnable r) { + new ThreadFactory() + { +public Thread newThread(Runnable r) +{ Thread t = new Thread(threadGroup, r, Connection Monitor Thread); t.setDaemon(true); return t; } - } - + } ); } - + // // Constructors // - + Connection(String userName, String password, GenericConnectionFactory genericConnectionFactory) - throws JMSException + throws JMSException { - - cat.debug(Connection Initializing); - + boolean trace = log.isTraceEnabled(); + if( trace ) + log.trace(Connection Initializing); + //Set the attributes createdSessions = new HashSet(); connectionToken = null; closed = false; lastMessageID = 0; modeStop = true; - + // Connect to the server -
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java GenericConnectionFactory.java
User: chirino Date: 01/11/11 21:27:35 Modified:src/main/org/jboss/mq Connection.java GenericConnectionFactory.java Log: More debug statments to help out with clustering work. Changed the IL JNDI bind code so that it does a rebind a creates all the required sub contexts Revision ChangesPath 1.12 +3 -2 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- Connection.java 2001/11/10 21:13:22 1.11 +++ Connection.java 2001/11/12 05:27:35 1.12 @@ -38,7 +38,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -175,6 +175,7 @@ cat.debug(Getting the serverIL); this.genericConnectionFactory = genericConnectionFactory; serverIL = genericConnectionFactory.createServerIL(); + cat.debug(serverIL=+serverIL); cat.debug(Authenticating); // Authenticate with the server @@ -426,7 +427,7 @@ public void asynchPong(long serverTime) { cat.debug(PONG); - cat.debug(serverIL:+serverIL); + cat.debug(serverIL=+serverIL); ponged = true; } 1.5 +5 -1 jbossmq/src/main/org/jboss/mq/GenericConnectionFactory.java Index: GenericConnectionFactory.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/GenericConnectionFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- GenericConnectionFactory.java 2001/10/21 05:38:12 1.4 +++ GenericConnectionFactory.java 2001/11/12 05:27:35 1.5 @@ -19,7 +19,7 @@ * * @author Hiram Chirino ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.4 $ + * @version$Revision: 1.5 $ */ public class GenericConnectionFactory implements java.io.Serializable { static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance( GenericConnectionFactory.class ); @@ -99,5 +99,9 @@ cat.debug( Could not connect to the server, e ); throw new SpyJMSException( Could not connect to the server, e ); } + } + + public String toString() { + return GenericConnectionFactory:[server=+server+,connectionProperties=+connectionProperties+]; } } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: chirino Date: 01/11/10 13:13:22 Modified:src/main/org/jboss/mq Connection.java Log: more debug.. Revision ChangesPath 1.11 +2 -1 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Connection.java 2001/10/04 02:54:19 1.10 +++ Connection.java 2001/11/10 21:13:22 1.11 @@ -38,7 +38,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.10 $ + * @version $Revision: 1.11 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -426,6 +426,7 @@ public void asynchPong(long serverTime) { cat.debug(PONG); + cat.debug(serverIL:+serverIL); ponged = true; } ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: chirino Date: 01/10/03 19:54:19 Modified:src/main/org/jboss/mq Connection.java Log: Finnaly got the initialization of the clockDaemon right. The thread was not being created as a deamon thread and therefor would not let VMs exit correctly when the connection was shutdown. Revision ChangesPath 1.10 +19 -14jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Connection.java 2001/10/02 03:52:55 1.9 +++ Connection.java 2001/10/04 02:54:19 1.10 @@ -38,7 +38,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -137,6 +137,23 @@ private StringBuffer sb = new StringBuffer(); private char[] charStack = new char[22]; + /** +* Static class initializer.. +*/ + static { + cat.debug(Setting the clockDaemon's thread factory); + clockDaemon.setThreadFactory( + new ThreadFactory () { +public Thread newThread(Runnable r) { + Thread t = new Thread(threadGroup, r, Connection Monitor Thread); + t.setDaemon(true); + return t; +} + } + + ); + } + // // Constructors // @@ -1020,20 +1037,8 @@ // ping period is 0. if( pingPeriod == 0 ) return; - if( clockDaemon.getThreadFactory() == null ) { - cat.debug(Setting the clockDaemon's thread factory); - clockDaemon.setThreadFactory( -new ThreadFactory () { - public Thread newThread(Runnable r) { - Thread t = new Thread(threadGroup, r, Connection Monitor Thread); - t.setDaemon(true); - return t; - } -} - - ); - } pingTaskId = clockDaemon.executePeriodically(pingPeriod,new PingTask(), true); + } private void stopPingThread() { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: chirino Date: 01/10/01 20:52:55 Modified:src/main/org/jboss/mq Connection.java Log: Reordered the way that I was setting up the ClockDeamon Revision ChangesPath 1.9 +14 -12jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Connection.java 2001/10/01 23:53:33 1.8 +++ Connection.java 2001/10/02 03:52:55 1.9 @@ -38,7 +38,7 @@ * * @authorNorbert Lataille ([EMAIL PROTECTED]) * @authorHiram Chirino ([EMAIL PROTECTED]) - * @version $Revision: 1.8 $ + * @version $Revision: 1.9 $ * @created August 16, 2001 */ public class Connection implements java.io.Serializable, javax.jms.Connection @@ -1020,18 +1020,20 @@ // ping period is 0. if( pingPeriod == 0 ) return; - - pingTaskId = clockDaemon.executePeriodically(pingPeriod,new PingTask(), true); - clockDaemon.setThreadFactory( - new ThreadFactory () { -public Thread newThread(Runnable r) { - Thread t = new Thread(threadGroup, r, Connection Monitor Thread); - t.setDaemon(true); - return t; + if( clockDaemon.getThreadFactory() == null ) { + cat.debug(Setting the clockDaemon's thread factory); + clockDaemon.setThreadFactory( +new ThreadFactory () { + public Thread newThread(Runnable r) { + Thread t = new Thread(threadGroup, r, Connection Monitor Thread); + t.setDaemon(true); + return t; + } } - } - - ); + + ); + } + pingTaskId = clockDaemon.executePeriodically(pingPeriod,new PingTask(), true); } private void stopPingThread() { ___ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: chirino Date: 01/09/25 22:02:27 Modified:src/main/org/jboss/mq Connection.java Log: Several modification to support the client connection sending ping messages to the server and the server sending back pong messages. These messages are used to determine if the connection has gone down. This fixes the bug with the ExceptionListner not being notified of the server failing when the client is only receiving messages. Revision ChangesPath 1.6 +717 -311 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Connection.java 2001/09/20 03:54:41 1.5 +++ Connection.java 2001/09/26 05:02:27 1.6 @@ -1,10 +1,11 @@ /* - * JBossMQ, the OpenSource JMS implementation + * JBoss, the OpenSource J2EE webOS * * Distributable under LGPL license. * See terms of license at gnu.org. */ package org.jboss.mq; +import EDU.oswego.cs.dl.util.concurrent.Semaphore; import java.io.File; import java.io.FileInputStream; @@ -31,66 +32,114 @@ import org.jboss.mq.il.ServerIL; /** - * This class implements javax.jms.Connection + * This class implements javax.jms.Connection * - * @author Norbert Lataille ([EMAIL PROTECTED]) - * @author Hiram Chirino ([EMAIL PROTECTED]) - * @createdAugust 16, 2001 - * @version$Revision: 1.5 $ + * @authorNorbert Lataille ([EMAIL PROTECTED]) + * @authorHiram Chirino ([EMAIL PROTECTED]) + * @version $Revision: 1.6 $ + * @created August 16, 2001 */ -public class Connection implements java.io.Serializable, javax.jms.Connection { +public class Connection implements java.io.Serializable, javax.jms.Connection +{ + /** +* Description of the Field +*/ + public static ThreadGroup threadGroup = new ThreadGroup(JBossMQ Client Threads); + /** +* Description of the Field +*/ + protected final static long PING_INTERVAL = 1000 * 60; + static org.apache.log4j.Category cat = org.apache.log4j.Category.getInstance(Connection.class); //Maps a destination to a LinkedList of Subscriptions - public HashMap destinationSubscriptions = new HashMap(); + /** +* Description of the Field +*/ + public HashMap destinationSubscriptions = new HashMap(); //Maps a a subsction id to a Subscription - public HashMap subscriptions = new HashMap(); + /** +* Description of the Field +*/ + public HashMap subscriptions = new HashMap(); //Is the connection stopped ? - public boolean modeStop; + /** +* Description of the Field +*/ + public boolean modeStop; // // Attributes // // This is our connection to the JMS server + /** +* Description of the Field +*/ protected ServerIL serverIL; //This is the clientID + /** +* Description of the Field +*/ protected String clientID; // The connection token is used to identify our connection // to the server. + /** +* Description of the Field +*/ protected ConnectionToken connectionToken; // The object that sets up the client IL + /** +* Description of the Field +*/ protected ClientILService clientILService; + // The thread that pings the connection to see if it is 'alive' + /** +* Description of the Field +*/ + protected Thread pingThread; + /** +* Description of the Field +*/ + protected boolean ponged; + /** +* Description of the Field +*/ + protected Semaphore pingTaskSemaphore = new Semaphore(0); + /** +* Description of the Field +*/ + protected volatile boolean closing = false; + //LinkedList of all created sessions by this connection - HashSet createdSessions; + HashSet createdSessions; // Numbers subscriptions - int subscriptionCounter = Integer.MIN_VALUE; + int subscriptionCounter = Integer.MIN_VALUE; //Is the connection closed ? - boolean closed; + boolean closed; // Used to control tranactions SpyXAResourceManager spyXAResourceManager; //The class that created this connection GenericConnectionFactory genericConnectionFactory; //Last message ID returned - private int lastMessageID; + private int lastMessageID; //the exceptionListener private ExceptionListener exceptionListener; //Get a new messageID (creation of a new message) private StringBuffer sb = new
[JBoss-dev] CVS update: jbossmq/src/main/org/jboss/mq Connection.java
User: chirino Date: 01/08/17 15:57:43 Modified:src/main/org/jboss/mq Connection.java Log: The concurrent classes are not being used anymore.. Revision ChangesPath 1.3 +1 -2 jbossmq/src/main/org/jboss/mq/Connection.java Index: Connection.java === RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/Connection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- Connection.java 2001/08/17 03:04:01 1.2 +++ Connection.java 2001/08/17 22:57:42 1.3 @@ -6,7 +6,6 @@ */ package org.jboss.mq; -import EDU.oswego.cs.dl.util.concurrent.*; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -37,7 +36,7 @@ * @author Norbert Lataille ([EMAIL PROTECTED]) * @author Hiram Chirino ([EMAIL PROTECTED]) * @createdAugust 16, 2001 - * @version$Revision: 1.2 $ + * @version$Revision: 1.3 $ */ public class Connection implements java.io.Serializable, javax.jms.Connection { //Maps a destination to a LinkedList of Subscriptions ___ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development