Author: ron.sigal(a)jboss.com
Date: 2009-04-14 06:25:23 -0400 (Tue, 14 Apr 2009)
New Revision: 5022
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java
Log:
JBREM-1116: Eliminated dependence on SecurityUtility.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java 2009-04-14
10:24:53 UTC (rev 5021)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/web/WebServerInvoker.java 2009-04-14
10:25:23 UTC (rev 5022)
@@ -100,7 +100,7 @@
public UnMarshaller getUnMarshaller()
{
- ClassLoader classLoader = SecurityUtility.getClassLoader(WebServerInvoker.class);
+ ClassLoader classLoader = getClassLoader(WebServerInvoker.class);
UnMarshaller unmarshaller = MarshalFactory.getUnMarshaller(getLocator(),
classLoader, configuration);
if(unmarshaller == null)
{
@@ -111,7 +111,7 @@
public Marshaller getMarshaller()
{
- ClassLoader classLoader = SecurityUtility.getClassLoader(WebServerInvoker.class);
+ ClassLoader classLoader = getClassLoader(WebServerInvoker.class);
Marshaller marshaller = MarshalFactory.getMarshaller(getLocator(), classLoader,
configuration);
if(marshaller == null)
{
@@ -242,4 +242,20 @@
super(sessionId, subsystem, arg, requestPayload, returnPayload, locator);
}
}
+
+ static private ClassLoader getClassLoader(final Class c)
+ {
+ if (SecurityUtility.skipAccessControl())
+ {
+ return c.getClassLoader();
+ }
+
+ return (ClassLoader)AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return c.getClassLoader();
+ }
+ });
+ }
}
\ No newline at end of file
Show replies by date