[jboss-cvs] JBossAS SVN: r77656 - trunk/server/src/main/org/jboss/proxy/ejb.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Aug 29 10:23:24 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-08-29 10:23:23 -0400 (Fri, 29 Aug 2008)
New Revision: 77656
Modified:
trunk/server/src/main/org/jboss/proxy/ejb/RetryInterceptor.java
Log:
[JBAS-5906] Clean up our NamingContext
Modified: trunk/server/src/main/org/jboss/proxy/ejb/RetryInterceptor.java
===================================================================
--- trunk/server/src/main/org/jboss/proxy/ejb/RetryInterceptor.java 2008-08-29 13:47:06 UTC (rev 77655)
+++ trunk/server/src/main/org/jboss/proxy/ejb/RetryInterceptor.java 2008-08-29 14:23:23 UTC (rev 77656)
@@ -27,6 +27,7 @@
import java.util.Hashtable;
import java.util.Properties;
import javax.naming.InitialContext;
+import javax.naming.NamingException;
import org.jboss.invocation.Invocation;
import org.jboss.invocation.InvocationContext;
@@ -238,10 +239,11 @@
Invoker newInvoker = null;
while( retry == true )
{
+ InitialContext namingCtx = null;
try
{
Thread.sleep(sleepTime);
- InitialContext namingCtx = new InitialContext(retryProps);
+ namingCtx = new InitialContext(retryProps);
if( trace )
log.trace("Looking for invoker: "+jndiName);
newInvoker = (Invoker) namingCtx.lookup(jndiName);
@@ -263,6 +265,22 @@
break;
}
}
+ finally
+ {
+ // JBAS-5906 -- clean up after ourselves
+ if (namingCtx != null)
+ {
+ try
+ {
+ namingCtx.close();
+ }
+ catch (NamingException e)
+ {
+ log.warn("Problem closing naming context used for reaquiring invoker: " +
+ e.getClass() + " -- " + e.getLocalizedMessage());
+ }
+ }
+ }
}
if( trace )
log.trace("End reestablishInvokerProxy");
More information about the jboss-cvs-commits
mailing list