[jboss-cvs] JBossAS SVN: r60428 - branches/Branch_4_2/server/src/main/org/jboss/naming.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 8 13:15:14 EST 2007
Author: scott.stark at jboss.org
Date: 2007-02-08 13:15:13 -0500 (Thu, 08 Feb 2007)
New Revision: 60428
Modified:
branches/Branch_4_2/server/src/main/org/jboss/naming/ExternalContext.java
Log:
JBAS-4048, look to all superclass interfaces when creating the proxy
Modified: branches/Branch_4_2/server/src/main/org/jboss/naming/ExternalContext.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/naming/ExternalContext.java 2007-02-08 17:45:18 UTC (rev 60427)
+++ branches/Branch_4_2/server/src/main/org/jboss/naming/ExternalContext.java 2007-02-08 18:15:13 UTC (rev 60428)
@@ -32,12 +32,10 @@
import java.lang.reflect.Proxy;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Properties;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
import javax.naming.CompositeName;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -46,11 +44,11 @@
import javax.naming.RefAddr;
import javax.naming.Reference;
import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
import javax.naming.ldap.Control;
import javax.naming.spi.ObjectFactory;
import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.util.Classes;
/**
* A MBean that binds an arbitrary InitialContext into the JBoss default
@@ -263,17 +261,14 @@
private void rebind() throws Exception
{
- boolean debug = log.isDebugEnabled();
Context ctx = contextInfo.newContext();
Context rootCtx = (Context) new InitialContext();
- if (debug)
- log.debug("ctx="+ctx+", env="+ctx.getEnvironment());
+ log.debug("ctx="+ctx+", env="+ctx.getEnvironment());
// Get the parent context into which we are to bind
String jndiName = contextInfo.getJndiName();
Name fullName = rootCtx.getNameParser("").parse(jndiName);
- if (debug)
- log.debug("fullName="+fullName);
+ log.debug("fullName="+fullName);
Name parentName = fullName;
if( fullName.size() > 1 )
@@ -281,12 +276,10 @@
else
parentName = new CompositeName();
- if (debug)
- log.debug("parentName="+parentName);
+ log.debug("parentName="+parentName);
Context parentCtx = createContext(rootCtx, parentName);
- if (debug)
- log.debug("parentCtx="+parentCtx);
+ log.debug("parentCtx="+parentCtx);
Name atomName = fullName.getSuffix(fullName.size()-1);
String atom = atomName.get(0);
@@ -522,7 +515,10 @@
static Context createProxyContext(Context ctx)
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
- Class[] interfaces = ctx.getClass().getInterfaces();
+ ArrayList<Class> ifaces = new ArrayList<Class>();
+ Classes.getAllInterfaces(ifaces, ctx.getClass());
+ Class[] interfaces = new Class[ifaces.size()];
+ ifaces.toArray(interfaces);
InvocationHandler handler = new CachedContext(ctx);
Context proxyCtx = (Context) Proxy.newProxyInstance(loader, interfaces, handler);
return proxyCtx;
More information about the jboss-cvs-commits
mailing list