axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r477903 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: deployment/AxisConfigBuilder.java deployment/DescriptionBuilder.java description/AxisService.java engine/AxisConfiguration.java
Date Tue, 21 Nov 2006 21:34:01 GMT
Author: nagy
Date: Tue Nov 21 13:34:00 2006
New Revision: 477903

URL: http://svn.apache.org/viewvc?view=rev&rev=477903
Log:
Ported r469707 (Added usages of AccessController) 

Modified:
    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/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=477903&r1=477902&r2=477903
==============================================================================
--- 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 Nov 21 13:34:00 2006
@@ -39,6 +39,8 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.io.InputStream;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -205,15 +207,22 @@
                 OMElement observerelement = (OMElement) oservers.next();
                 AxisObserver observer;
                 OMAttribute trsClas = observerelement.getAttribute(new QName(TAG_CLASS_NAME));
-                String clasName;
-                if (trsClas != null) {
-                    clasName = trsClas.getAttributeValue();
-                } else {
+                if (trsClas == null) {
                     log.info(Messages.getMessage(DeploymentErrorMsgs.OBSERVER_ERROR));
                     return;
                 }
+                final String clasName = trsClas.getAttributeValue();
 
-                Class observerclass = Loader.loadClass(clasName);
+                Class observerclass;
+                try {
+                  observerclass = (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();
+                }
                 observer = (AxisObserver) observerclass.newInstance();
                 // processing Parameters
                 // Processing service level parameters

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=477903&r1=477902&r2=477903
==============================================================================
--- 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 Nov 21 13:34:00 2006
@@ -41,6 +41,8 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.InputStream;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -131,8 +133,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=477903&r1=477902&r2=477903
==============================================================================
--- 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 Nov 21 13:34:00 2006
@@ -64,6 +64,7 @@
 import java.io.OutputStream;
 import java.net.SocketException;
 import java.net.URL;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 /**
@@ -243,7 +244,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();
+          }
+        });
         objectSupplier = new DefaultObjectSupplier();
     }
 

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=477903&r1=477902&r2=477903
==============================================================================
--- 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 Nov 21 13:34:00 2006
@@ -30,6 +30,7 @@
 
 import javax.xml.namespace.QName;
 import java.net.URL;
+import java.security.PrivilegedAction;
 import java.util.*;
 
 /**
@@ -129,9 +130,14 @@
         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