[jboss-cvs] JBossRemoting/src/main/org/jboss/remoting/transport ...
Tom Elrod
telrod at belmont.prod.atl2.jboss.com
Wed Aug 30 11:50:46 EDT 2006
User: telrod
Date: 06/08/30 11:50:46
Modified: src/main/org/jboss/remoting/transport Connector.java
Log:
JBREM-594 - fixed problem where Connector not cleaning up when exception encountered during create or start.
Revision Changes Path
1.27 +34 -8 JBossRemoting/src/main/org/jboss/remoting/transport/Connector.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Connector.java
===================================================================
RCS file: /cvsroot/jboss/JBossRemoting/src/main/org/jboss/remoting/transport/Connector.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- Connector.java 15 Jul 2006 04:40:12 -0000 1.26
+++ Connector.java 30 Aug 2006 15:50:46 -0000 1.27
@@ -111,7 +111,7 @@
* @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
* @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>
* @author <a href="mailto:tom at jboss.org">Tom Elrod</a>
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
* @jmx.mbean description = "An MBean wrapper around a ServerInvoker."
* @jboss.xmbean
*/
@@ -746,7 +746,6 @@
marshallerLoaderConnector.stop();
marshallerLoaderConnector = null;
}
- isCreated = false;
isStarted = false;
}
}
@@ -761,9 +760,25 @@
{
if (!isCreated)
{
+ try
+ {
init();
isCreated = true;
}
+ catch (Exception e)
+ {
+ // unwind create process
+ if (invoker != null)
+ {
+ invoker.stop();
+ invoker.destroy();
+ InvokerRegistry.destroyServerInvoker(invoker);
+ invoker = null;
+ }
+ isCreated = false;
+ throw e;
+ }
+ }
}
/**
@@ -773,7 +788,18 @@
*/
public void destroy()
{
- //NOOP as all is taken care of in the stop() method
+ if (isStarted)
+ {
+ stop();
+ }
+ if (invoker != null)
+ {
+ invoker.stop();
+ invoker.destroy();
+ InvokerRegistry.destroyServerInvoker(invoker);
+ invoker = null;
+ }
+ isCreated = false;
}
public ServerInvoker getServerInvoker()
More information about the jboss-cvs-commits
mailing list