jstrachan 2002/11/12 04:38:06 Modified: messenger/src/conf MessengerSpiritWave.xml Messenger.xml messenger project.xml messenger/src/java/org/apache/commons/messenger SessionFactory.java Log: Patch to support the setting of acknowledgement mode via an acknowledge="auto|client|dups OK" attribute This should fix the issue that amit shetty has found. Revision Changes Path 1.6 +4 -4 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.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MessengerSpiritWave.xml 7 Oct 2002 10:38:23 -0000 1.5 +++ MessengerSpiritWave.xml 12 Nov 2002 12:38:06 -0000 1.6 @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <manager> - <messenger name="topic"> - <factory className="com.spirit.messenger.WaveTopicSessionFactory"> + <messenger name="topic" persistentDeliver="true"> + <factory className="com.spirit.messenger.WaveTopicSessionFactory" acknowledge="auto"> </factory> </messenger> - <messenger name="queue"> - <factory className="com.spirit.messenger.WaveQueueSessionFactory"> + <messenger name="queue" persistentDeliver="true"> + <factory className="com.spirit.messenger.WaveQueueSessionFactory" acknowledge="auto"> </factory> </messenger> </manager> 1.7 +2 -2 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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Messenger.xml 17 May 2002 15:05:46 -0000 1.6 +++ Messenger.xml 12 Nov 2002 12:38:06 -0000 1.7 @@ -4,8 +4,8 @@ <!-- this example Messenger XML config file should work with J2EE SDK --> <!-- when running inside of a J2EE container --> - <messenger name="topic" jndiDestinations="false"> - <jndi lookupName="TopicConnectionFactory" topic="true"> + <messenger name="topic" jndiDestinations="false" persistentDeliver="true> + <jndi lookupName="TopicConnectionFactory" topic="true" acknowledge="auto"> <!-- for some reason these don't work too well with J2EE SDK 1.12 +1 -1 jakarta-commons-sandbox/messenger/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/messenger/project.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- project.xml 8 Nov 2002 14:54:26 -0000 1.11 +++ project.xml 12 Nov 2002 12:38:06 -0000 1.12 @@ -4,7 +4,7 @@ <pomVersion>3</pomVersion> <name>commons-messenger</name> <id>commons-messenger</id> - <currentVersion>1.0-dev-9</currentVersion> + <currentVersion>1.0-dev-10</currentVersion> <organization> <name>Apache Software Foundation</name> <url>http://www.apache.org</url> 1.14 +27 -2 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.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- SessionFactory.java 8 Jul 2002 16:19:06 -0000 1.13 +++ SessionFactory.java 12 Nov 2002 12:38:06 -0000 1.14 @@ -193,6 +193,31 @@ public void setAcknowledgeMode(int acknowlegeMode) { this.acknowlegeMode = acknowlegeMode; } + + /** + * 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" + * @throws IllegalArgumentException if the value is not one of the correct values */ + public void setAcknowledge(String value) { + if (value != null) { + if (value.equalsIgnoreCase("auto")) { + setAcknowledgeMode(Session.AUTO_ACKNOWLEDGE); + } + else if (value.equalsIgnoreCase("client")) { + setAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE); + } + 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'" + ); + } + } + } /** Returns the optional username used when creating a new JMS connection via a JMS ConnectionFactory */ public String getUsername() {
-- To unsubscribe, e-mail: <mailto:commons-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:commons-dev-help@;jakarta.apache.org>