unico 2004/01/05 09:15:16
Modified: src/blocks/jms/java/org/apache/cocoon/components/jms
JMSConnectionImpl.java
Log:
code formatting
Revision Changes Path
1.6 +64 -63
cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
Index: JMSConnectionImpl.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JMSConnectionImpl.java 15 Nov 2003 04:21:29 -0000 1.5
+++ JMSConnectionImpl.java 5 Jan 2004 17:15:16 -0000 1.6
@@ -100,11 +100,11 @@
* @author <a href="mailto:[EMAIL PROTECTED]">haul</a>
*/
public class JMSConnectionImpl extends AbstractLogEnabled
- implements Configurable,
- Disposable,
- ThreadSafe,
- Initializable,
- JMSConnection {
+ implements Configurable,
+ Disposable,
+ ThreadSafe,
+ Initializable,
+ JMSConnection {
private boolean available = false;
protected String topicFactoryName;
@@ -121,6 +121,64 @@
protected TopicConnectionFactory topicConnectionFactory;
private Parameters jndiParams;
+
+
+ public void configure(Configuration conf) throws ConfigurationException {
+ Parameters parameters = Parameters.fromConfiguration(conf);
+ this.jndiParams =
Parameters.fromConfiguration(conf.getChild("jndi-info"));
+ this.topicFactoryName =
+ parameters.getParameter("topic-factory", null);
+ this.topicName = parameters.getParameter("topic", null);
+ this.durableSubscriptionID =
+ parameters.getParameter(
+ "durable-subscription-id",null);
+
+ this.ackModeName =
+ parameters.getParameter("ack-mode",
this.ackModeName).toLowerCase();
+ // see if an ack mode has been specified. If it hasn't
+ // then assume CLIENT_ACKNOWLEDGE mode.
+ this.ackMode = Session.CLIENT_ACKNOWLEDGE;
+ if (this.ackModeName.equals("auto")) {
+ this.ackMode = Session.AUTO_ACKNOWLEDGE;
+ } else if (this.ackModeName.equals("dups")) {
+ this.ackMode = Session.DUPS_OK_ACKNOWLEDGE;
+ } else if (!this.ackModeName.equals("client")) {
+ // ignore all ack modes, to test no acking
+ this.ackMode = -1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.avalon.framework.activity.Initializable#initialize()
+ */
+ public void initialize() throws Exception {
+ try {
+ this.context = setupContext();
+ this.setupConnection();
+ this.setupSession();
+ this.available = true;
+ } catch (NamingException e) {
+ if (getLogger().isWarnEnabled()) {
+ getLogger().warn("Cannot get Initial Context. Is the JNDI
server reachable?",e);
+ }
+ } catch (JMSException e) {
+ if (getLogger().isWarnEnabled()) {
+ getLogger().warn("Failed to initialize JMS.",e);
+ }
+ }
+ }
+
+ /*
+ * @see org.apache.avalon.framework.activity.Disposable#dispose()
+ */
+ public void dispose() {
+ try {
+ this.disconnect();
+ } catch (JMSException e) {
+ } catch (NamingException e) {
+ }
+ }
+
/**
* Register a new TopicListener for this connection.
*
@@ -250,62 +308,5 @@
this.session.close();
this.connection.close();
}
-
- public void configure(Configuration conf) throws ConfigurationException {
- Parameters parameters =
Parameters.fromConfiguration(conf);
- this.jndiParams =
Parameters.fromConfiguration(conf.getChild("jndi-info"));
- this.topicFactoryName =
- parameters.getParameter("topic-factory", null);
- this.topicName = parameters.getParameter("topic", null);
- this.durableSubscriptionID =
- parameters.getParameter(
- "durable-subscription-id",null);
-
- this.ackModeName =
- parameters.getParameter("ack-mode",
this.ackModeName).toLowerCase();
- // see if an ack mode has been specified. If it hasn't
- // then assume CLIENT_ACKNOWLEDGE mode.
- this.ackMode = Session.CLIENT_ACKNOWLEDGE;
- if (this.ackModeName.equals("auto")) {
- this.ackMode = Session.AUTO_ACKNOWLEDGE;
- } else if (this.ackModeName.equals("dups")) {
- this.ackMode = Session.DUPS_OK_ACKNOWLEDGE;
- } else if (!this.ackModeName.equals("client")) {
- // ignore all ack modes, to test no acking
- this.ackMode = -1;
- }
- }
-
-
- /*
- * @see org.apache.avalon.framework.activity.Disposable#dispose()
- */
- public void dispose() {
- try {
- this.disconnect();
- } catch (JMSException e) {
- } catch (NamingException e) {
- }
- }
-
- /* (non-Javadoc)
- * @see org.apache.avalon.framework.activity.Initializable#initialize()
- */
- public void initialize() throws Exception {
- try {
- this.context = setupContext();
- this.setupConnection();
- this.setupSession();
- this.available = true;
- } catch (NamingException e) {
- if (getLogger().isWarnEnabled()) {
- getLogger().warn("Cannot get Initial Context. Is the JNDI
server reachable?",e);
- }
- } catch (JMSException e) {
- if (getLogger().isWarnEnabled()) {
- getLogger().warn("Failed to initialize JMS.",e);
- }
- }
- }
}