axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From barre...@apache.org
Subject svn commit: r509762 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
Date Tue, 20 Feb 2007 21:25:24 GMT
Author: barrettj
Date: Tue Feb 20 13:25:24 2007
New Revision: 509762

URL: http://svn.apache.org/viewvc?view=rev&rev=509762
Log:
AXIS2-2221
Submitted by Ming Cheung.  Add doPriv call.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java?view=diff&rev=509762&r1=509761&r2=509762
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
Tue Feb 20 13:25:24 2007
@@ -19,12 +19,16 @@
 
 import java.io.InputStream;
 import java.io.StringWriter;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Iterator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
+
+
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
@@ -38,6 +42,7 @@
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.java.security.AccessController;
 import org.apache.axis2.modules.Module;
 
 /**
@@ -59,7 +64,19 @@
         try {
             if ((moduleClassName != null) && !"".equals(moduleClassName)) {
                 moduleClass = Loader.loadClass(module.getModuleClassLoader(), moduleClassName);
-                module.setModule((Module) moduleClass.newInstance());
+                final Class fmoduleClass = moduleClass;
+                final AxisModule fmodule = module;
+                try {
+                	AccessController.doPrivileged( new PrivilegedExceptionAction() {
+                		public Object run() throws IllegalAccessException, InstantiationException
{
+                			Module new_module = (Module) fmoduleClass.newInstance();
+                        	fmodule.setModule(new_module);
+                        	return null;
+                        }
+                    });  	
+                } catch (PrivilegedActionException e) {
+                	throw e.getException();
+                }   
             }
         } catch (Exception e) {
             throw new DeploymentException(e.getMessage(), e);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message