Skip to content

Commit

Permalink
Removed protection domain services from ProxyServices
Browse files Browse the repository at this point in the history
  • Loading branch information
drallen authored and pmuir committed Aug 9, 2010
1 parent dcb6768 commit f05defd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
Expand Up @@ -28,7 +28,6 @@
import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
import java.security.ProtectionDomain;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -74,7 +73,6 @@ public class ProxyFactory<T>
private final Class<?> beanType;
private final Set<Class<?>> additionalInterfaces = new HashSet<Class<?>>();
private final ClassLoader classLoader;
private final ProtectionDomain protectionDomain;
private final ClassPool classPool;
private final String baseProxyName;

Expand Down Expand Up @@ -112,7 +110,6 @@ public ProxyFactory(Class<?> proxiedBeanType, Set<? extends Type> businessInterf
this.classLoader = Container.instance().services().get(ProxyServices.class).getClassLoader(superClass);
}
this.beanType = superClass;
this.protectionDomain = Container.instance().services().get(ProxyServices.class).getProtectionDomain(beanType);
this.classPool = new ClassPool();
this.classPool.appendClassPath(new ClassloaderClassPath(classLoader));
addDefaultAdditionalInterfaces();
Expand Down Expand Up @@ -307,7 +304,7 @@ private Class<T> createProxyClass(String proxyClassName) throws Exception
proxyClassType.addInterface(classPool.get(specialInterface.getName()));
}

Class<T> proxyClass = proxyClassType.toClass(classLoader, protectionDomain);
Class<T> proxyClass = proxyClassType.toClass(classLoader, null);
proxyClassType.detach();
log.trace("Created Proxy class of type " + proxyClass + " supporting interfaces " + Arrays.toString(proxyClass.getInterfaces()));
return proxyClass;
Expand Down
Expand Up @@ -69,18 +69,6 @@ private ClassLoader _getClassLoader(Class<?> proxiedBeanType)
}
}

public ProtectionDomain getProtectionDomain(Class<?> type)
{
if (type.getName().startsWith("java"))
{
return this.getClass().getProtectionDomain();
}
else
{
return type.getProtectionDomain();
}
}

public void cleanup()
{
// This implementation requires no cleanup
Expand Down

0 comments on commit f05defd

Please sign in to comment.