User: hiram
Date: 00/12/28 21:39:51
Modified: src/java/org/spydermq SpyConnectionConsumer.java
SpyMessageProducer.java SpyQueueConnection.java
SpySession.java SpyTopicConnection.java
Log:
Upgraded the jms.jar file to the latest 1.0.2a version
Revision Changes Path
1.6 +23 -21 spyderMQ/src/java/org/spydermq/SpyConnectionConsumer.java
Index: SpyConnectionConsumer.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpyConnectionConsumer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SpyConnectionConsumer.java 2000/12/26 04:15:50 1.5
+++ SpyConnectionConsumer.java 2000/12/29 05:39:50 1.6
@@ -19,7 +19,7 @@
*
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class SpyConnectionConsumer implements javax.jms.ConnectionConsumer,
SpyConsumer {
@@ -38,28 +38,7 @@
// The subscription info the consumer
Subscription subscription = new Subscription();
- /**
- * SpyConnectionConsumer constructor comment.
- */
- public SpyConnectionConsumer(SpyConnection connection, Destination
destination, String messageSelector, ServerSessionPool serverSessionPool, int
maxMessages)
- throws JMSException {
-
- this.connection = connection;
- this.destination = destination;
- this.serverSessionPool = serverSessionPool;
- this.maxMessages = maxMessages;
-
- subscription.destination = (SpyDestination)destination;
- subscription.messageSelector = messageSelector;
- subscription.durableSubscriptionName = null;
- subscription.noLocal = false;
- subscription.listening = true;
- subscription.receiving = false;
- connection.addConsumer(this);
- connection.listenerChange(subscription.subscriptionId,true);
-
- }
public void addMessage(SpyMessage mes) throws JMSException {
Log.log(""+this+"->addMessage(mes="+mes+")");
@@ -120,5 +99,28 @@
public String toString() {
return "SpyConnectionConsumer:"+destination;
+ }
+
+ /**
+ * SpyConnectionConsumer constructor comment.
+ */
+ public SpyConnectionConsumer(SpyConnection connection, Destination
destination, String subscriptionName, String messageSelector, ServerSessionPool
serverSessionPool, int maxMessages)
+ throws JMSException {
+
+ this.connection = connection;
+ this.destination = destination;
+ this.serverSessionPool = serverSessionPool;
+ this.maxMessages = maxMessages;
+
+ subscription.destination = (SpyDestination)destination;
+ subscription.messageSelector = messageSelector;
+ subscription.durableSubscriptionName = subscriptionName;
+ subscription.noLocal = false;
+ subscription.listening = true;
+ subscription.receiving = false;
+
+ connection.addConsumer(this);
+ connection.listenerChange(subscription.subscriptionId,true);
+
}
}
1.3 +14 -6 spyderMQ/src/java/org/spydermq/SpyMessageProducer.java
Index: SpyMessageProducer.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpyMessageProducer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SpyMessageProducer.java 2000/12/12 05:58:57 1.2
+++ SpyMessageProducer.java 2000/12/29 05:39:50 1.3
@@ -16,7 +16,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class SpyMessageProducer
implements MessageProducer
@@ -27,7 +27,7 @@
private boolean disableTS = false;
protected int defaultDeliveryMode = DeliveryMode.NON_PERSISTENT;
protected int defaultPriority=4;
- protected int defaultTTL=0;
+ protected long defaultTTL=0;
// Public --------------------------------------------------------
@@ -82,10 +82,7 @@
else defaultTTL=timeToLive;
}
- public int getTimeToLive() throws JMSException
- {
- return defaultTTL;
- }
+
public void close() throws JMSException
{
@@ -93,4 +90,15 @@
//Let the GC do its work !
}
+ public long getTimeToLive() throws JMSException
+ {
+ return defaultTTL;
+ }
+
+ public void setTimeToLive(long timeToLive) throws JMSException
+ {
+ if (timeToLive==Message.DEFAULT_TIME_TO_LIVE) timeToLive=0;
+ else if (timeToLive<0) throw new JMSException("Bad TimeToLive value");
+ else defaultTTL=timeToLive;
+ }
}
1.6 +1 -1 spyderMQ/src/java/org/spydermq/SpyQueueConnection.java
Index: SpyQueueConnection.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpyQueueConnection.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SpyQueueConnection.java 2000/12/26 04:15:50 1.5
+++ SpyQueueConnection.java 2000/12/29 05:39:50 1.6
@@ -24,7 +24,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class SpyQueueConnection
extends SpyConnection
@@ -62,7 +62,7 @@
if (closed) throw new IllegalStateException("The connection is
closed");
if (distributedConnection==null) createReceiver();
- return new SpyConnectionConsumer(this, queue, messageSelector,
sessionPool, maxMessages);
+ return new SpyConnectionConsumer(this, queue, null, messageSelector,
sessionPool, maxMessages);
}
1.23 +11 -9 spyderMQ/src/java/org/spydermq/SpySession.java
Index: SpySession.java
===================================================================
RCS file: /products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpySession.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- SpySession.java 2000/12/27 17:02:25 1.22
+++ SpySession.java 2000/12/29 05:39:50 1.23
@@ -34,7 +34,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.22 $
+ * @version $Revision: 1.23 $
*/
abstract public class SpySession
implements Runnable, Session, XASession
@@ -173,15 +173,7 @@
return message;
}
- public TextMessage createTextMessage(StringBuffer stringBuffer) throws
JMSException
- {
- if (closed) throw new IllegalStateException("The session is closed");
-
- SpyTextMessage message=new SpyTextMessage();
- message.setText(stringBuffer.toString());
- message.producerClientId = connection.getClientID();
- return message;
- }
+
public boolean getTransacted() throws JMSException
{
@@ -430,5 +422,15 @@
}
consumers.remove( who );
+ }
+
+ public TextMessage createTextMessage(String string) throws JMSException
+ {
+ if (closed) throw new IllegalStateException("The session is closed");
+
+ SpyTextMessage message=new SpyTextMessage();
+ message.setText(string);
+ message.producerClientId = connection.getClientID();
+ return message;
}
}
1.5 +13 -12 spyderMQ/src/java/org/spydermq/SpyTopicConnection.java
Index: SpyTopicConnection.java
===================================================================
RCS file:
/products/cvs/ejboss/spyderMQ/src/java/org/spydermq/SpyTopicConnection.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SpyTopicConnection.java 2000/12/26 19:54:31 1.4
+++ SpyTopicConnection.java 2000/12/29 05:39:50 1.5
@@ -24,7 +24,7 @@
* @author Norbert Lataille ([EMAIL PROTECTED])
* @author Hiram Chirino ([EMAIL PROTECTED])
*
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
*/
public class SpyTopicConnection
extends SpyConnection
@@ -67,20 +67,10 @@
if (closed) throw new IllegalStateException("The connection is
closed");
if (distributedConnection==null) createReceiver();
- return new SpyConnectionConsumer(this, topic, messageSelector,
sessionPool, maxMessages);
+ return new SpyConnectionConsumer(this, topic, null, messageSelector,
sessionPool, maxMessages);
}
- public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
- String messageSelector,
- ServerSessionPool sessionPool,
- int maxMessages) throws
JMSException
- {
- if (closed) throw new IllegalStateException("The connection is
closed");
- if (distributedConnection==null) createReceiver();
-
- //Not impelemted yet
- return null;
- }
+
TemporaryTopic getTemporaryTopic() throws JMSException
{
@@ -107,4 +97,15 @@
}
}
+ public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
+ String subscriptionName,
+ String messageSelector,
+ ServerSessionPool sessionPool,
+ int maxMessages) throws
JMSException
+ {
+ if (closed) throw new IllegalStateException("The connection is
closed");
+ if (distributedConnection==null) createReceiver();
+
+ return new SpyConnectionConsumer(this, topic, subscriptionName,
messageSelector, sessionPool, maxMessages);
+ }
}