[jboss-svn-commits] JBL Code SVN: r23964 - 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 08:57:42 EST 2008
Author: beve
Date: 2008-11-19 08:57:42 -0500 (Wed, 19 Nov 2008)
New Revision: 23964
Modified:
labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsOutboundRouter.java
Log:
Just changing the order of the methods.
Modified: labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsOutboundRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsOutboundRouter.java 2008-11-19 13:53:18 UTC (rev 23963)
+++ labs/jbossesb/workspace/skeagh/routing/jms/src/main/java/org/jboss/esb/jms/JmsOutboundRouter.java 2008-11-19 13:57:42 UTC (rev 23964)
@@ -132,55 +132,6 @@
setupMessageComposer();
}
- /**
- * Send the contents of the ESB Message object to the configured
- * JMS destination.
- *
- * @param message The ESB Message object
- * @throws RoutingException If an error occurs while trying to send the JMS Message.
- */
- public final void route(final Message esbMessage) throws RoutingException
- {
- final javax.jms.Message jmsMessage = composeJmsMessage(esbMessage);
- publishJmsMessage(jmsMessage);
- }
-
- /**
- * Closes the underlying JMS connection.
- * This method will be called by the runtime upon deployment.
- */
- @Uninitialize
- public final void uninitialize()
- {
- try
- {
- if (messageSender != null)
- {
- messageSender.close();
- }
- }
- finally
- {
- RouterUtil.closeJmsSession(jmsSession);
- }
- }
-
- public String getDestination()
- {
- return destination;
- }
-
- public Properties getJmsProperties()
- {
- return (Properties) configProperties.clone();
- }
-
- @Override
- public final String toString()
- {
- return "JMSOutboundRouter [name='" + objectName + "', destination='" + destination + "', jmsProperties='" + configProperties + "']";
- }
-
private void setupJmsSession() throws ConfigurationException
{
try
@@ -208,6 +159,24 @@
}
}
+ private void connectMessageSender(final MessageSender sender) throws JMSException
+ {
+ try
+ {
+ sender.connect();
+ }
+ catch (final JMSException e)
+ {
+ RouterUtil.closeJmsSession(jmsSession);
+ throw e;
+ }
+ catch (final Throwable t)
+ {
+ RouterUtil.closeJmsSession(jmsSession);
+ throw (JMSException) (new JMSException("Unexpected exception while connecting JmsMesssageSender.").initCause(t));
+ }
+ }
+
private void setupMessageComposer() throws ConfigurationException
{
try
@@ -222,6 +191,19 @@
}
}
+ /**
+ * Send the contents of the ESB Message object to the configured
+ * JMS destination.
+ *
+ * @param message The ESB Message object
+ * @throws RoutingException If an error occurs while trying to send the JMS Message.
+ */
+ public final void route(final Message esbMessage) throws RoutingException
+ {
+ final javax.jms.Message jmsMessage = composeJmsMessage(esbMessage);
+ publishJmsMessage(jmsMessage);
+ }
+
private javax.jms.Message composeJmsMessage(final Message esbMessage) throws RoutingException
{
try
@@ -252,22 +234,40 @@
}
}
- private void connectMessageSender(final MessageSender sender) throws JMSException
+ /**
+ * Closes the underlying JMS connection.
+ * This method will be called by the runtime upon deployment.
+ */
+ @Uninitialize
+ public final void uninitialize()
{
try
{
- sender.connect();
+ if (messageSender != null)
+ {
+ messageSender.close();
+ }
}
- catch (final JMSException e)
+ finally
{
RouterUtil.closeJmsSession(jmsSession);
- throw e;
}
- catch (final Throwable t)
- {
- RouterUtil.closeJmsSession(jmsSession);
- throw (JMSException) (new JMSException("Unexpected exception while connecting JmsMesssageSender.").initCause(t));
- }
}
+ public String getDestination()
+ {
+ return destination;
+ }
+
+ public Properties getJmsProperties()
+ {
+ return (Properties) configProperties.clone();
+ }
+
+ @Override
+ public final String toString()
+ {
+ return "JMSOutboundRouter [name='" + objectName + "', destination='" + destination + "', jmsProperties='" + configProperties + "']";
+ }
+
}
More information about the jboss-svn-commits
mailing list