axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r469707 - in /webservices/axis2/trunk/java/modules: jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/description/ kernel/src/org/apache/axis2/engine/
Date Tue, 31 Oct 2006 23:53:46 GMT
Author: scheu
Date: Tue Oct 31 15:53:45 2006
New Revision: 469707

URL: http://svn.apache.org/viewvc?view=rev&rev=469707
Log:
AXIS2-1566
Contributor: Ming Cheung
Added usages of AccessController

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java?view=diff&rev=469707&r1=469706&r2=469707
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
Tue Oct 31 15:53:45 2006
@@ -19,6 +19,8 @@
 
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import javax.activation.DataSource;
 import javax.xml.bind.JAXBContext;
@@ -150,7 +152,11 @@
         // Invoke the actual Provider.invoke() method
         Object responseParamValue = null;
         try {
-            responseParamValue = providerInstance.invoke(input);
+            responseParamValue = (Object) org.apache.axis2.java.security.AccessController.doPrivileged(new
PrivilegedAction() {
+            	public Object run() {
+            		return providerInstance.invoke(input);
+            	}
+            });
         } catch (Exception e) {
             e.printStackTrace();
             throw ExceptionFactory.makeWebServiceException(e);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=469707&r1=469706&r2=469707
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
Tue Oct 31 15:53:45 2006
@@ -38,7 +38,12 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+
 import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -329,9 +334,17 @@
                 OMAttribute trsClas = transport.getAttribute(new QName(TAG_CLASS_NAME));
                 if (trsClas != null) {
                     try {
-                        String clasName = trsClas.getAttributeValue();
+                        final String clasName = trsClas.getAttributeValue();
                         Class receiverClass;
-                        receiverClass = Loader.loadClass(clasName); 
+                        try {
+                             receiverClass = (Class) org.apache.axis2.java.security.AccessController.doPrivileged(new
PrivilegedExceptionAction() {
+                        		public Object run() throws ClassNotFoundException {
+                        			return Loader.loadClass(clasName);	
+                        		}
+                        	});  
+                        } catch (PrivilegedActionException e) {
+                            throw (ClassNotFoundException)e.getException();
+                        }
 
                         TransportListener receiver =
                                 (TransportListener) receiverClass.newInstance();

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=469707&r1=469706&r2=469707
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
Tue Oct 31 15:53:45 2006
@@ -46,6 +46,10 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -127,8 +131,17 @@
                 TAG_MESSAGE_RECEIVER));
         while (msgReceivers.hasNext()) {
             OMElement msgReceiver = (OMElement) msgReceivers.next();
-            MessageReceiver receiver = loadMessageReceiver(Thread
-                    .currentThread().getContextClassLoader(), msgReceiver);
+            final OMElement tempMsgReceiver = msgReceiver;
+            MessageReceiver receiver = null;
+            try { 
+                receiver = (MessageReceiver) org.apache.axis2.java.security.AccessController.doPrivileged(new
PrivilegedExceptionAction() {
+                    public Object run() throws org.apache.axis2.deployment.DeploymentException
{
+                        return loadMessageReceiver(Thread.currentThread().getContextClassLoader(),
tempMsgReceiver);
+                    }
+                });
+            } catch (PrivilegedActionException e) {
+                throw (DeploymentException)e.getException();
+            }              
             OMAttribute mepAtt = msgReceiver.getAttribute(new QName(TAG_MEP));
             mr_mep.put(mepAtt.getAttributeValue(), receiver);
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=469707&r1=469706&r2=469707
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Tue Oct 31 15:53:45 2006
@@ -62,6 +62,8 @@
 import java.io.OutputStream;
 import java.net.SocketException;
 import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 /**
@@ -226,7 +228,11 @@
         moduleRefs = new ArrayList();
         engagedModules = new ArrayList();
         schemaList = new ArrayList();
-        serviceClassLoader = Thread.currentThread().getContextClassLoader();
+        serviceClassLoader = (ClassLoader) org.apache.axis2.java.security.AccessController.doPrivileged(new
PrivilegedAction() {
+            public Object run() {
+                return Thread.currentThread().getContextClassLoader();
+            }
+        });
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?view=diff&rev=469707&r1=469706&r2=469707
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
Tue Oct 31 15:53:45 2006
@@ -30,6 +30,8 @@
 
 import javax.xml.namespace.QName;
 import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 /**
@@ -127,9 +129,13 @@
         faultyModules = new Hashtable();
         observersList = new ArrayList();
         inPhasesUptoAndIncludingPostDispatch = new ArrayList();
-        systemClassLoader = Thread.currentThread().getContextClassLoader();
-        serviceClassLoader = Thread.currentThread().getContextClassLoader();
-        moduleClassLoader = Thread.currentThread().getContextClassLoader();
+        systemClassLoader = (ClassLoader) org.apache.axis2.java.security.AccessController.doPrivileged(new
PrivilegedAction() {
+            public Object run() {
+                return Thread.currentThread().getContextClassLoader();      
+            }
+        });
+        serviceClassLoader = systemClassLoader; 
+        moduleClassLoader = systemClassLoader;
         this.phasesinfo = new PhasesInfo();
         targetResolvers = new ArrayList();
     }



---------------------------------------------------------------------
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