You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/12/04 11:02:09 UTC
cvs commit: jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger SessionFactory.java
jstrachan 2002/12/04 02:02:09
Modified: messenger/src/conf MessengerSpiritWave.xml
MessengerJBoss.xml Messenger.xml messenger.dtd
MessengerOpenjms.xml MessengerAshna.xml
messenger/src/java/org/apache/commons/messenger
SessionFactory.java
Log:
Added a much more rigorous DTD that describes all the various flags and properties that can be set on a Messenger connection
Revision Changes Path
1.7 +1 -0 jakarta-commons-sandbox/messenger/src/conf/MessengerSpiritWave.xml
Index: MessengerSpiritWave.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/MessengerSpiritWave.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MessengerSpiritWave.xml 12 Nov 2002 12:38:06 -0000 1.6
+++ MessengerSpiritWave.xml 4 Dec 2002 10:02:09 -0000 1.7
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manager SYSTEM "messenger.dtd">
<manager>
<messenger name="topic" persistentDeliver="true">
1.6 +2 -0 jakarta-commons-sandbox/messenger/src/conf/MessengerJBoss.xml
Index: MessengerJBoss.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/MessengerJBoss.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MessengerJBoss.xml 28 Aug 2002 11:15:59 -0000 1.5
+++ MessengerJBoss.xml 4 Dec 2002 10:02:09 -0000 1.6
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manager SYSTEM "messenger.dtd">
+
<!--
|| JBoss Sample configuration.
||
1.8 +2 -1 jakarta-commons-sandbox/messenger/src/conf/Messenger.xml
Index: Messenger.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/Messenger.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Messenger.xml 12 Nov 2002 12:38:06 -0000 1.7
+++ Messenger.xml 4 Dec 2002 10:02:09 -0000 1.8
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manager SYSTEM "messenger.dtd">
<manager>
<!-- this example Messenger XML config file should work with J2EE SDK -->
<!-- when running inside of a J2EE container -->
- <messenger name="topic" jndiDestinations="false" persistentDeliver="true>
+ <messenger name="topic" jndiDestinations="false" persistentDelivery="true">
<jndi lookupName="TopicConnectionFactory" topic="true" acknowledge="auto">
<!--
for some reason these don't work too well with J2EE SDK
1.2 +66 -10 jakarta-commons-sandbox/messenger/src/conf/messenger.dtd
Index: messenger.dtd
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/messenger.dtd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- messenger.dtd 10 Jul 2002 10:01:23 -0000 1.1
+++ messenger.dtd 4 Dec 2002 10:02:09 -0000 1.2
@@ -1,4 +1,3 @@
-<?xml version="1.0" encoding="UTF-8"?>
<!--
|| Authored by Michael Rimov (rimovm@centercomp.com) in an attempt at reading the
|| digester code. No Guarantee as to it's accuracy! Please email me if you have corrections
@@ -9,32 +8,89 @@
className CDATA #IMPLIED
>
+<!--
+ creates a Messenger (a JMS connection with session pools)
+
+ name - the name of the messenger instance. Can be any String
+ jndiDestinations - whether destinations should be created or pulled from JNDI
+ cacheProducers - should MessageProducers be cached (defaults to true)
+ durable - sets whether topic subscribers are durable or not
+ durableName - the durable name used for durable topic subscriptions
+ noLocal - whether local messages are ignored when using topic subscriptions
+ persitentDelivery - sets whether or not message delivery should be persistent
+-->
+
<!ELEMENT messenger (jndi|factory)>
<!ATTLIST messenger
- name (queue | topic) #REQUIRED
+ name CDATA #REQUIRED
jndiDestinations (false | true) #IMPLIED
+ cacheProducers (false | true) #IMPLIED
+ durable (false | true) #IMPLIED
+ durableName CDATA #IMPLIED
+ noLocal (false | true) #IMPLIED
+ persitentDelivery (false | true) #IMPLIED
>
-<!ELEMENT name (#PCDATA)>
-<!ELEMENT property (name, value)>
-<!ELEMENT value (#PCDATA)>
-<!ELEMENT factory (property*)>
+<!--
+ specifies a custom factory of Connection and Session objects
+ className - specifies the SessionFactory implementation class to use
+ username - the user name to use for the Connection
+ password - the password to use for the connection
+
+ acknowlege - sets the acknowledgement mode to auto, client or duplicates ok
+ clientID - sets the clientID on the JMS Connection
+ topic - whether or not the Connection should be considered a topic of queue connection
+ (some JMS Connections can implement both mechanisms).
+
+ transacted - whether or not the connection should behave in transacted mode
+-->
+
+<!ELEMENT factory (property*)>
<!ATTLIST factory
className CDATA #REQUIRED
- topic (false | true) #REQUIRED
username CDATA #IMPLIED
password CDATA #IMPLIED
+
+ acknowlege (auto | client | dups_ok) #IMPLIED
+ clientID CDATA #IMPLIED
+ topic (false | true) #REQUIRED
transacted (false | true) #IMPLIED
- acknowlegeMode (Session.AUTO_ACKNOWLEDGE | Session.CLIENT_ACKNOWLEDGE | Session.DUPS_OK_ACKNOWLEDGE) #IMPLIED
>
+<!--
+ specifies a factory of Connection and Session objects using JNDI to lookup the Factory
+
+ lookupName - the JNDI lookup name used to find the ConnectionFactory
+
+ className - specifies the SessionFactory implementation class to use
+ username - the user name to use for the Connection
+ password - the password to use for the connection
+
+ acknowlege - sets the acknowledgement mode to auto, client or duplicates ok
+ clientID - sets the clientID on the JMS Connection
+ topic - whether or not the Connection should be considered a topic of queue connection
+ (some JMS Connections can implement both mechanisms).
+
+ transacted - whether or not the connection should behave in transacted mode
+-->
+
<!ELEMENT jndi (property+)>
<!ATTLIST jndi
lookupName CDATA #REQUIRED
- topic (false | true) #IMPLIED
+
+ className CDATA #REQUIRED
username CDATA #IMPLIED
password CDATA #IMPLIED
+
+ acknowlege (auto | client | dups_ok) #IMPLIED
+ clientID CDATA #IMPLIED
+ topic (false | true) #REQUIRED
transacted (false | true) #IMPLIED
- acknowlegeMode (Session.AUTO_ACKNOWLEDGE | Session.CLIENT_ACKNOWLEDGE | Session.DUPS_OK_ACKNOWLEDGE) #IMPLIED
>
+
+<!-- used to create nested properties for the factory or jndi elements -->
+
+<!ELEMENT property (name, value)>
+<!ELEMENT name (#PCDATA)>
+<!ELEMENT value (#PCDATA)>
1.2 +2 -0 jakarta-commons-sandbox/messenger/src/conf/MessengerOpenjms.xml
Index: MessengerOpenjms.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/MessengerOpenjms.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MessengerOpenjms.xml 10 Jul 2002 10:01:23 -0000 1.1
+++ MessengerOpenjms.xml 4 Dec 2002 10:02:09 -0000 1.2
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manager SYSTEM "messenger.dtd">
+
<!--
|| Sample Connection file for working with Exolab's OpenJMS server using
|| the default rmi_jms.xml configuration file.
1.4 +1 -0 jakarta-commons-sandbox/messenger/src/conf/MessengerAshna.xml
Index: MessengerAshna.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/MessengerAshna.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MessengerAshna.xml 17 May 2002 15:05:46 -0000 1.3
+++ MessengerAshna.xml 4 Dec 2002 10:02:09 -0000 1.4
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manager SYSTEM "messenger.dtd">
<manager>
<!-- this example Messenger XML config file should work with J2EE SDK -->
1.16 +5 -5 jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/SessionFactory.java
Index: SessionFactory.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/SessionFactory.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SessionFactory.java 26 Nov 2002 18:25:45 -0000 1.15
+++ SessionFactory.java 4 Dec 2002 10:02:09 -0000 1.16
@@ -205,7 +205,7 @@
/**
* A String based setter method to allow this property to be defined
* easily from within the digester XML file.
- *
* @param value is either "auto", "client" or "dups ok"
+ *
* @param value is either "auto", "client" or "dups_ok"
* @throws IllegalArgumentException if the value is not one of the correct values
*/
public void setAcknowledge(String value) {
if (value != null) {
@@ -215,13 +215,13 @@
else if (value.equalsIgnoreCase("client")) {
setAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
}
- else if (value.equalsIgnoreCase("dups ok")) {
+ else if (value.equalsIgnoreCase("dups_ok")) {
setAcknowledgeMode(Session.DUPS_OK_ACKNOWLEDGE);
}
else {
throw new IllegalArgumentException(
"Value: " + value
- + " is invalid. Must be 'auto', 'client' or 'dups ok'"
+ + " is invalid. Must be 'auto', 'client' or 'dups_ok'"
);
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>