[jboss-svn-commits] JBL Code SVN: r23965 - labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Nov 19 09:13:12 EST 2008
Author: beve
Date: 2008-11-19 09:13:12 -0500 (Wed, 19 Nov 2008)
New Revision: 23965
Modified:
labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsInboundRouter.java
Log:
Just changing the order of methods in the class. No code change.
Modified: labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsInboundRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsInboundRouter.java 2008-11-19 13:57:42 UTC (rev 23964)
+++ labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsInboundRouter.java 2008-11-19 14:13:12 UTC (rev 23965)
@@ -125,20 +125,6 @@
private EsbMessageComposer esbMessageComposer;
/**
- * Sets up the JmsMesssageListener of this class.
- *
- * @throws JMSException if a JMS exception occurs.
- * @throws ConfigurationException If a message composer could not be created.
- */
- @Initialize
- public final void initialize() throws JMSException, ConfigurationException
- {
- setupJmsSession();
- setupMessageListener();
- setupMessageComposer();
- }
-
- /**
* Set the dispatcher used by this instance.
*
* @param dispatcher - the dispatcher to use
@@ -149,55 +135,19 @@
}
/**
- * Closes the underlying JMS connection.
- */
- @Uninitialize
- public final void uninitialize()
- {
- try
- {
- if (messageListener != null)
- {
- messageListener.close();
- }
- }
- finally
- {
- RouterUtil.closeJmsSession(jmsSession);
- }
- }
-
- /**
- * Will display the dispatcher and the properties for this instance.
+ * Sets up the JmsMesssageListener of this class.
*
- * @return String - string representation of this instance.
+ * @throws JMSException if a JMS exception occurs.
+ * @throws ConfigurationException If a message composer could not be created.
*/
- @Override
- public final String toString()
+ @Initialize
+ public final void initialize() throws JMSException, ConfigurationException
{
- return "[dispatcher=" + dispatcher + ", extractProperties=" + extractJmsProperties + ", jmsProperties=" + configProperties + "]";
+ setupJmsSession();
+ setupMessageListener();
+ setupMessageComposer();
}
- /**
- * Gets the JMS properties.
- *
- * @return Properties - the properties used by this instance.
- */
- public final Properties getProperties()
- {
- return (Properties) configProperties.clone();
- }
-
- /**
- * Gets the jms destination(Topic or Queue).
- *
- * @return String the name of the destination.
- */
- public final String getDestination()
- {
- return destination;
- }
-
private void setupJmsSession() throws ConfigurationException
{
try
@@ -225,6 +175,34 @@
}
}
+ /**
+ * Creates and connects a {@link MessageSender}.
+ *
+ * @param session The {@link JMSSession} to use for creating the MessageSender.
+ * @return MessageSender The newly create {@link MessageSender}.
+ * @throws JMSException If an error occurs while trying to create the MessageSender.
+ */
+ private JmsMessageListener createMessageListener(final JMSSession session) throws JMSException
+ {
+ JmsMessageListener listener = null;
+ try
+ {
+ listener = new JmsMessageListener(destination, jmsSession, configProperties, dispatcher);
+ listener.connect();
+ }
+ catch (final JMSException e)
+ {
+ RouterUtil.closeJmsSession(jmsSession);
+ throw e;
+ }
+ catch (final Exception t)
+ {
+ RouterUtil.closeJmsSession(jmsSession);
+ throw (JMSException) (new JMSException("Unexpected exception while connecting JmsMesssageListener.").initCause(t));
+ }
+ return listener;
+ }
+
private void connectMessageListener(final JmsMessageListener listener) throws JMSException
{
try
@@ -258,34 +236,56 @@
}
/**
- * Creates and connects a {@link MessageSender}.
- *
- * @param session The {@link JMSSession} to use for creating the MessageSender.
- * @return MessageSender The newly create {@link MessageSender}.
- * @throws JMSException If an error occurs while trying to create the MessageSender.
+ * Closes the underlying JMS connection.
*/
- private JmsMessageListener createMessageListener(final JMSSession session) throws JMSException
+ @Uninitialize
+ public final void uninitialize()
{
- JmsMessageListener listener = null;
try
{
- listener = new JmsMessageListener(destination, jmsSession, configProperties, dispatcher);
- listener.connect();
+ if (messageListener != null)
+ {
+ messageListener.close();
+ }
}
- catch (final JMSException e)
+ finally
{
RouterUtil.closeJmsSession(jmsSession);
- throw e;
}
- catch (final Exception t)
- {
- RouterUtil.closeJmsSession(jmsSession);
- throw (JMSException) (new JMSException("Unexpected exception while connecting JmsMesssageListener.").initCause(t));
- }
- return listener;
}
/**
+ * Will display the dispatcher and the properties for this instance.
+ *
+ * @return String - string representation of this instance.
+ */
+ @Override
+ public final String toString()
+ {
+ return "[dispatcher=" + dispatcher + ", extractProperties=" + extractJmsProperties + ", jmsProperties=" + configProperties + "]";
+ }
+
+ /**
+ * Gets the JMS properties.
+ *
+ * @return Properties - the properties used by this instance.
+ */
+ public final Properties getProperties()
+ {
+ return (Properties) configProperties.clone();
+ }
+
+ /**
+ * Gets the jms destination(Topic or Queue).
+ *
+ * @return String the name of the destination.
+ */
+ public final String getDestination()
+ {
+ return destination;
+ }
+
+ /**
* JmsMessageListener that listens to incoming messages and uses
* the {@link MessageDispatcher} to pass the message along though the ESB.
*
More information about the jboss-svn-commits
mailing list