User: pra
Date: 01/05/07 12:19:57
Modified: src/main/org/jboss/ejb/plugins/jms JMSContainerInvoker.java
Log:
Repositioning of failover code, more orthogonal to start/stop/destroy now
Revision Changes Path
1.10 +25 -16
jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java
Index: JMSContainerInvoker.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JMSContainerInvoker.java 2001/04/17 21:27:14 1.9
+++ JMSContainerInvoker.java 2001/05/07 19:19:57 1.10
@@ -54,9 +54,9 @@
* @see <related>
* @author Peter Antman ([EMAIL PROTECTED])
* @author Rickard �berg ([EMAIL PROTECTED])
- * @author <a href="mailto:[EMAIL PROTECTED]">Sebastien
Alborini</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Sebastien Alborini</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
public class JMSContainerInvoker implements
ContainerInvoker, XmlLoadable
@@ -317,28 +317,32 @@
connection = queueConnection;
Logger.debug("Queue connectionConsumer set up");
}
- exListener = new ExceptionListenerImpl(this);
- connection.setExceptionListener(exListener);
}
+ // Start the connection
public void start()
throws Exception
{
Logger.debug("Starting JMSContainerInvoker");
+ exListener = new ExceptionListenerImpl(this);
+ connection.setExceptionListener(exListener);
connection.start();
}
- // What are the differences between stop and destroy?
+ // Stop the connection
public void stop()
{
Logger.debug("Stopping JMSContainerInvoker");
+ // Silence the exception listener
if (exListener != null)
exListener.stop();
innerStop();
+
}
-
- protected void innerStop() {
+ // Stop done from inside, we should not stop the exceptionListener in
+ // inner stop
+ protected void innerStop() {
try {
if (connection != null)
connection.setExceptionListener(null);
@@ -347,12 +351,20 @@
Logger.log("Could not set JMSContainerInvoker ExceptionListener to null :"
+ se);
}
+ // Stop the connection
try {
- if(connection == null)
+ if(connection != null)
connection.stop();
}catch(Exception cs) {
- Logger.log("Could not stop JMSContainerInvoker consumer:" + cs);
+ Logger.log("Could not stop JMS connection:" + cs);
}
+ }
+
+
+ // Take down all fixtures
+ public void destroy()
+ {
+ Logger.debug("Destroying JMSContainerInvoker");
try {
if (pool instanceof org.jboss.jms.asf.StdServerSessionPool) {
org.jboss.jms.asf.StdServerSessionPool p =
@@ -360,7 +372,7 @@
p.clear();
}
}catch(Exception pe) {
- Logger.log("Could not cleat ServerSessionPool:" + pe);
+ Logger.log("Could not clear ServerSessionPool:" + pe);
}
@@ -374,15 +386,10 @@
if (connection != null)
connection.close();
}catch(Exception ex) {
- Logger.log("Could not close JMSContainerInvoker connection:" + ex);
+ Logger.log("Could not close JMSContainerInvoker connection:" + ex);
}
}
- public void destroy()
- {
- Logger.debug("Destroying JMSContainerInvoker");
- }
-
// XmlLoadable implementation
public void importXml(Element element) throws DeploymentException
{
@@ -493,7 +500,9 @@
Thread.sleep(10000);
}catch(InterruptedException ie) { tryIt=false; return;}
//try {
+ // Reboot container
invoker.innerStop();
+ invoker.destroy();
invoker.init();
invoker.start();
tryIt = false;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development