axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r161850 - in webservices/axis/trunk/java/modules/core/src/org/apache/axis: deployment/ deployment/listener/ deployment/repository/utill/ deployment/scheduler/ phaseresolver/
Date Tue, 19 Apr 2005 06:32:38 GMT
Author: deepal
Date: Mon Apr 18 23:32:35 2005
New Revision: 161850

URL: http://svn.apache.org/viewcvs?view=rev&rev=161850
Log:
Modified deployemnt to add pre-dispatch handlers to the global chain :)

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/EngineRegistryFactoryImpl.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/UnZipJAR.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/DeploymentIterator.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/Scheduler.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
Mon Apr 18 23:32:35 2005
@@ -16,19 +16,6 @@
 
 package org.apache.axis.deployment;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
 import org.apache.axis.deployment.listener.RepositoryListenerImpl;
 import org.apache.axis.deployment.repository.utill.HDFileItem;
 import org.apache.axis.deployment.repository.utill.UnZipJAR;
@@ -36,20 +23,18 @@
 import org.apache.axis.deployment.scheduler.DeploymentIterator;
 import org.apache.axis.deployment.scheduler.Scheduler;
 import org.apache.axis.deployment.scheduler.SchedulerTask;
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.EngineConfiguration;
-import org.apache.axis.engine.EngineConfigurationImpl;
-import org.apache.axis.engine.Handler;
-import org.apache.axis.engine.MessageReceiver;
+import org.apache.axis.description.*;
+import org.apache.axis.engine.*;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import java.io.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 
 public class DeploymentEngine implements DeploymentConstants {
 
@@ -189,7 +174,7 @@
     }
 
     public EngineConfiguration load() throws DeploymentException {
-       if (serverConfigName == null) {
+        if (serverConfigName == null) {
             throw new DeploymentException("path to Server.xml can not be NUll");
         }
         File tempfile = new File(serverConfigName);
@@ -224,7 +209,7 @@
      * This methode used to check the modules referd by server.xml
      * are exist , or they have deployed
      */
-    private void validateServerModule() throws AxisFault{
+    private void validateServerModule() throws AxisFault {
         Iterator itr = axisGlobal.getModules().iterator();
         while (itr.hasNext()) {
             QName qName = (QName) itr.next();
@@ -255,7 +240,7 @@
     }
 
 
-    private void addnewService(AxisService serviceMetaData) throws AxisFault{
+    private void addnewService(AxisService serviceMetaData) throws AxisFault {
         currentFileItem.setClassLoader();
         loadServiceProperties(serviceMetaData);
         engineconfig.addService(serviceMetaData);
@@ -269,7 +254,7 @@
      * @param axisService
      * @throws AxisFault
      */
-    private void loadServiceProperties(AxisService axisService) throws AxisFault{
+    private void loadServiceProperties(AxisService axisService) throws AxisFault {
         loadMessageReceiver(axisService);
         Flow inflow = axisService.getInFlow();
         if (inflow != null) {
@@ -302,7 +287,7 @@
             String readInClass = currentFileItem.getMessgeReceiver();
             if (readInClass != null && !"".equals(readInClass)) {
                 messageReceiver = Class.forName(readInClass, true, loader1);
-                service.setMessageReceiver((MessageReceiver)messageReceiver.newInstance());
+                service.setMessageReceiver((MessageReceiver) messageReceiver.newInstance());
             }
         } catch (Exception e) {
             throw new AxisFault(e.getMessage(), e);
@@ -506,13 +491,14 @@
      * an axisservice object using WSDL and then fill that using given servic.xml and load
all the requed
      * class and build the chains , finally add the  servicecontext to EngineContext and
axisservice into
      * EngineConfiguration
+     *
      * @param axisService
      * @param serviceInputStream
      * @param classLoader
      * @return
      * @throws DeploymentException
      */
-    public AxisService buildService(AxisService axisService , InputStream serviceInputStream,
ClassLoader classLoader) throws DeploymentException {
+    public AxisService buildService(AxisService axisService, InputStream serviceInputStream,
ClassLoader classLoader) throws DeploymentException {
         try {
             DeploymentParser schme = new DeploymentParser(serviceInputStream, this);
             schme.parseServiceXML(axisService);
@@ -523,11 +509,11 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("XMLStreamException" + e.getMessage());
         } catch (DeploymentException e) {
-            throw new DeploymentException(e.getMessage()) ;
-        }  catch (AxisFault axisFault) {
+            throw new DeploymentException(e.getMessage());
+        } catch (AxisFault axisFault) {
             throw new DeploymentException(axisFault.getMessage());
         }
-        return  axisService;
+        return axisService;
     }
 
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java
Mon Apr 18 23:32:35 2005
@@ -16,31 +16,19 @@
 
 package org.apache.axis.deployment;
 
-import java.io.InputStream;
-import java.util.ArrayList;
+import org.apache.axis.description.*;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineConfigurationImpl;
+import org.apache.axis.transport.TransportReceiver;
+import org.apache.axis.transport.TransportSender;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisOperation;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.AxisTransportIn;
-import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.FlowImpl;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.description.ParameterImpl;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.EngineConfigurationImpl;
-import org.apache.axis.phaseresolver.PhaseException;
-import org.apache.axis.transport.TransportReceiver;
-import org.apache.axis.transport.TransportSender;
+import java.io.InputStream;
+import java.util.ArrayList;
 
 
 /**
@@ -76,7 +64,7 @@
         pullparser = XMLInputFactory.newInstance().createXMLStreamReader(inputStream);
     }
 
-    public void parseServiceXML(AxisService axisService) throws DeploymentException{
+    public void parseServiceXML(AxisService axisService) throws DeploymentException {
         //To check whether document end tag has encountered
         boolean END_DOCUMENT = false;
         //   ServiceMetaData service = null;
@@ -113,9 +101,9 @@
                     break;
                 } else if (eventType == XMLStreamConstants.START_ELEMENT) {
                     String ST = pullparser.getLocalName(); //Staring tag name
-                    if(SERVERST.equals(ST)){
+                    if (SERVERST.equals(ST)) {
                         //todo complete this to fill the names
-                    }else if (PARAMETERST.equals(ST)) {
+                    } else if (PARAMETERST.equals(ST)) {
                         Parameter parameter = processParameter();
                         serverMetaData.addParameter(parameter);
                     } else if (TRANSPORTSENDER.equals(ST)) {
@@ -144,22 +132,21 @@
                                 String attname = pullparser.getAttributeLocalName(i);
                                 String attvalue = pullparser.getAttributeValue(i);
                                 if (TYPE.equals(attname)) {
-                                    if(INFLOWST.equals(attvalue)){
-                                        ((EngineConfigurationImpl)dpengine.getEngineconfig()).setInPhases(processPhaseOrder());
-                                    }   else if (OUTFLOWST.equals(attvalue)){
-                                        ((EngineConfigurationImpl)dpengine.getEngineconfig()).setOutPhases(processPhaseOrder());
-                                    }  else if (IN_FAILTFLOW.equals(attvalue)){
-                                        ((EngineConfigurationImpl)dpengine.getEngineconfig()).setInFaultPhases(processPhaseOrder());
-                                    }else if (OUT_FAILTFLOW.equals(attvalue)){
-                                        ((EngineConfigurationImpl)dpengine.getEngineconfig()).setOutFaultPhases(processPhaseOrder());
-                                    }
-                                    else {
-                                        throw new DeploymentException("un defined flow type
 "  + ST);
+                                    if (INFLOWST.equals(attvalue)) {
+                                        ((EngineConfigurationImpl) dpengine.getEngineconfig()).setInPhases(processPhaseOrder());
+                                    } else if (OUTFLOWST.equals(attvalue)) {
+                                        ((EngineConfigurationImpl) dpengine.getEngineconfig()).setOutPhases(processPhaseOrder());
+                                    } else if (IN_FAILTFLOW.equals(attvalue)) {
+                                        ((EngineConfigurationImpl) dpengine.getEngineconfig()).setInFaultPhases(processPhaseOrder());
+                                    } else if (OUT_FAILTFLOW.equals(attvalue)) {
+                                        ((EngineConfigurationImpl) dpengine.getEngineconfig()).setOutFaultPhases(processPhaseOrder());
+                                    } else {
+                                        throw new DeploymentException("un defined flow type
 " + ST);
                                     }
                                 }
                             }
                         } else {
-                            throw new DeploymentException("Flow type is a required attribute
in "  + ST);
+                            throw new DeploymentException("Flow type is a required attribute
in " + ST);
                         }
                     } else {
                         throw new UnsupportedOperationException(ST + " element is not allowed
in the server.xml");
@@ -301,7 +288,7 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (Exception e) {
-            throw new DeploymentException( e.getMessage());
+            throw new DeploymentException(e.getMessage());
         }
         return transportout;
     }
@@ -316,7 +303,7 @@
             for (int i = 0; i < attribCount; i++) {
                 String attname = pullparser.getAttributeLocalName(i);
                 String attvalue = pullparser.getAttributeValue(i);
-                if(MESSAGERECEIVER.equals(attname)) {
+                if (MESSAGERECEIVER.equals(attname)) {
                     dpengine.getCurrentFileItem().setMessgeReceiver(attvalue);
                     foundMR = true;
                 } else if (STYLENAME.equals(attname)) {
@@ -329,7 +316,7 @@
             }
         } else
             throw new DeploymentException("Bad arguments" + axisService.getName());
-        if(! foundMR ) {
+        if (!foundMR) {
             throw new DeploymentException("Message Receiver dose not specify " + axisService.getName());
         }
 
@@ -372,7 +359,7 @@
                     } else if (IN_FAILTFLOW.equals(ST)) {
                         Flow faultFlow = processInFaultFlow();
                         axisService.setFaultInFlow(faultFlow);
-                    }else if (OUT_FAILTFLOW.equals(ST)) {
+                    } else if (OUT_FAILTFLOW.equals(ST)) {
                         Flow faultFlow = processOutFaultFlow();
                         axisService.setFaultOutFlow(faultFlow);
                     } else if (MODULEST.equals(ST)) {
@@ -477,14 +464,14 @@
                 handler.setClassName(attvalue);
             } else if (ATTNAME.equals(attname)) {
                 if (ref_name) {
-                    throw new DeploymentException("Hander canot have both name and ref  "
+ attvalue);
+                    throw new DeploymentException("Hanlder canot have both name and ref 
" + attvalue);
                 } else {
                     handler.setName(new QName(attvalue));
                     ref_name = true;
                 }
             } else if (REF.equals(attname)) {
                 if (ref_name) {
-                    throw new DeploymentException("Hander canot have both name and ref  "
+ attvalue);
+                    throw new DeploymentException("Hanlder canot have both name and ref 
" + attvalue);
                 } else {
                     ref_name = true;
                     throw new UnsupportedOperationException("This should be implmented");
@@ -550,7 +537,7 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (Exception e) {
-           throw new DeploymentException(e.getMessage());
+            throw new DeploymentException(e.getMessage());
         }
         // adding element to the parameter
         return handler;
@@ -586,7 +573,7 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (Exception e) {
-          throw new DeploymentException(e.getMessage());
+            throw new DeploymentException(e.getMessage());
         }
     }
 
@@ -727,7 +714,7 @@
                     } else if (IN_FAILTFLOW.equals(ST)) {
                         Flow faultFlow = processInFaultFlow();
                         module.setFaultInFlow(faultFlow);
-                    }else if (OUT_FAILTFLOW.equals(ST)) {
+                    } else if (OUT_FAILTFLOW.equals(ST)) {
                         Flow faultFlow = processOutFaultFlow();
                         module.setFaultOutFlow(faultFlow);
                     } else if (INFLOWST.equals(ST)) {
@@ -822,7 +809,7 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (Exception e) {
-           throw new DeploymentException(e.getMessage());
+            throw new DeploymentException(e.getMessage());
         }
 
         return outFlow;
@@ -858,12 +845,12 @@
         } catch (XMLStreamException e) {
             throw new DeploymentException("parser Exception", e);
         } catch (Exception e) {
-           throw new DeploymentException(e.getMessage());
+            throw new DeploymentException(e.getMessage());
         }
         return faultFlow;
     }
 
-     public Flow processOutFaultFlow() throws DeploymentException {
+    public Flow processOutFaultFlow() throws DeploymentException {
         Flow faultFlow = new FlowImpl();
         boolean END_FAULTFLOW = false;
         try {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/EngineRegistryFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/EngineRegistryFactoryImpl.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/EngineRegistryFactoryImpl.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/EngineRegistryFactoryImpl.java
Mon Apr 18 23:32:35 2005
@@ -16,10 +16,8 @@
 
 package org.apache.axis.deployment;
 
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.ContextBuilder;
+import org.apache.axis.context.EngineContext;
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineRegistryFactory;
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
Mon Apr 18 23:32:35 2005
@@ -16,13 +16,13 @@
 
 package org.apache.axis.deployment.listener;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.axis.deployment.DeploymentConstants;
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.repository.utill.WSInfoList;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
 
 public class RepositoryListenerImpl implements RepositoryListener, DeploymentConstants {
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/HDFileItem.java
Mon Apr 18 23:32:35 2005
@@ -16,12 +16,12 @@
 
 package org.apache.axis.deployment.repository.utill;
 
+import org.apache.axis.engine.AxisFault;
+
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
-
-import org.apache.axis.engine.AxisFault;
 
 /**
  * HDFileItem = Hot Deployment File Item , to store infromation of the module or servise

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/UnZipJAR.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/UnZipJAR.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/UnZipJAR.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/UnZipJAR.java
Mon Apr 18 23:32:35 2005
@@ -16,16 +16,16 @@
 
 package org.apache.axis.deployment.repository.utill;
 
-import java.io.FileInputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
 import org.apache.axis.deployment.DeploymentConstants;
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.DeploymentException;
 import org.apache.axis.deployment.DeploymentParser;
 import org.apache.axis.description.AxisModule;
 import org.apache.axis.description.AxisService;
+
+import java.io.FileInputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
 
 public class UnZipJAR implements DeploymentConstants {
     //final int BUFFER = 2048;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/repository/utill/WSInfoList.java
Mon Apr 18 23:32:35 2005
@@ -16,13 +16,13 @@
 
 package org.apache.axis.deployment.repository.utill;
 
+import org.apache.axis.deployment.DeploymentConstants;
+import org.apache.axis.deployment.DeploymentEngine;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-
-import org.apache.axis.deployment.DeploymentConstants;
-import org.apache.axis.deployment.DeploymentEngine;
 
 public class WSInfoList implements DeploymentConstants {
     /**

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/DeploymentIterator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/DeploymentIterator.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/DeploymentIterator.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/DeploymentIterator.java
Mon Apr 18 23:32:35 2005
@@ -19,7 +19,7 @@
 import java.util.Calendar;
 import java.util.Date;
 
-public class DeploymentIterator{
+public class DeploymentIterator {
 
     private Calendar calendar = Calendar.getInstance();
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/Scheduler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/Scheduler.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/Scheduler.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/Scheduler.java
Mon Apr 18 23:32:35 2005
@@ -52,7 +52,7 @@
      *                               scheduler was cancelled, or scheduler thread terminated.
      */
 
-    public void schedule(SchedulerTask schedulerTask, DeploymentIterator  iterator) {
+    public void schedule(SchedulerTask schedulerTask, DeploymentIterator iterator) {
 
         Date time = iterator.next();
         if (time == null) {
@@ -67,7 +67,7 @@
         }
     }
 
-    private void reschedule(SchedulerTask schedulerTask,DeploymentIterator iterator) {
+    private void reschedule(SchedulerTask schedulerTask, DeploymentIterator iterator) {
         Date time = iterator.next();
         if (time == null) {
             schedulerTask.cancel();

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/scheduler/SchedulerTask.java
Mon Apr 18 23:32:35 2005
@@ -16,11 +16,11 @@
 
 package org.apache.axis.deployment.scheduler;
 
-import java.util.TimerTask;
-
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.listener.RepositoryListener;
 import org.apache.axis.deployment.listener.RepositoryListenerImpl;
+
+import java.util.TimerTask;
 
 public class SchedulerTask implements Runnable {
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
Mon Apr 18 23:32:35 2005
@@ -15,15 +15,20 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-
-import org.apache.axis.description.*;
-import org.apache.axis.engine.*;
-import org.apache.axis.context.ServiceContext;
 import org.apache.axis.context.EngineContext;
+import org.apache.axis.context.ServiceContext;
+import org.apache.axis.description.AxisService;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.PhasesInclude;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineConfiguration;
+import org.apache.axis.engine.Handler;
+import org.apache.axis.engine.SimplePhase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.ArrayList;
+
 /**
  * This class hold all the phases found in the service.xml and server.xml
  */
@@ -63,7 +68,7 @@
      * @param registry
      * @param serviceIN
      */
-    public PhaseHolder(EngineConfiguration registry, AxisService serviceIN , ServiceContext
context) {
+    public PhaseHolder(EngineConfiguration registry, AxisService serviceIN, ServiceContext
context) {
         this.registry = registry;
         this.service = serviceIN;
         this.serviceContext = context;
@@ -78,7 +83,6 @@
     }
 
 
-
     public void setFlowType(int flowType) {
         switch (flowType) {
             case PhaseMetadata.IN_FLOW:
@@ -257,7 +261,7 @@
                             inChain.add(axisPhase);
                         }
                         serviceContext.setPhases(inChain, EngineConfiguration.INFLOW);
-                       // service.setPhases(inChain, EngineConfiguration.INFLOW);
+                        // service.setPhases(inChain, EngineConfiguration.INFLOW);
                         break;
                     }
                 case PhaseMetadata.OUT_FLOW:
@@ -291,10 +295,10 @@
                             faultInChain.add(axisPhase);
                         }
                         serviceContext.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
-                       // service.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
+                        // service.setPhases(faultInChain, EngineConfiguration.FAULT_IN_FLOW);
                         break;
                     }
-                    case PhaseMetadata.FAULT_OUT_FLOW:
+                case PhaseMetadata.FAULT_OUT_FLOW:
                     {
                         ArrayList faultOutChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -308,7 +312,7 @@
                             faultOutChain.add(axisPhase);
                         }
                         serviceContext.setPhases(faultOutChain, EngineConfiguration.FAULT_OUT_FLOW);
-                     //   service.setPhases(faultOutChain, EngineConfiguration.FAULT_IN_FLOW);
+                        //   service.setPhases(faultOutChain, EngineConfiguration.FAULT_IN_FLOW);
                         break;
                     }
             }
@@ -417,7 +421,7 @@
                         trnsport.setPhases(faultChain, EngineConfiguration.FAULT_IN_FLOW);
                         break;
                     }
-                    case PhaseMetadata.FAULT_OUT_FLOW:
+                case PhaseMetadata.FAULT_OUT_FLOW:
                     {
                         ArrayList faultChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {
@@ -515,7 +519,7 @@
                         engineContext.setPhases(faultChain, EngineConfiguration.FAULT_IN_FLOW);
                         break;
                     }
-                     case PhaseMetadata.FAULT_OUT_FLOW:
+                case PhaseMetadata.FAULT_OUT_FLOW:
                     {
                         ArrayList faultChain = new ArrayList();
                         for (int i = 0; i < phaseholder.size(); i++) {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseMetadata.java
Mon Apr 18 23:32:35 2005
@@ -15,10 +15,10 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-
 import org.apache.axis.description.HandlerMetadata;
 
+import java.util.ArrayList;
+
 /**
  * Class PhaseMetadata
  */
@@ -28,6 +28,8 @@
     public static final int OUT_FLOW = 2;
     public static final int FAULT_IN_FLOW = 3;
     public static final int FAULT_OUT_FLOW = 4;
+
+    public static final String PRE_DISPATCH = "pre-dispatch";
     /**
      * Field BOTH_BEFORE_AFTER
      */

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?view=diff&r1=161849&r2=161850
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
(original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
Mon Apr 18 23:32:35 2005
@@ -15,25 +15,14 @@
 */
 package org.apache.axis.phaseresolver;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis.description.AxisGlobal;
-import org.apache.axis.description.AxisModule;
-import org.apache.axis.description.AxisService;
-import org.apache.axis.description.AxisTransportIn;
-import org.apache.axis.description.AxisTransportOut;
-import org.apache.axis.description.Flow;
-import org.apache.axis.description.HandlerMetadata;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.EngineConfiguration;
 import org.apache.axis.context.EngineContext;
 import org.apache.axis.context.ServiceContext;
+import org.apache.axis.description.*;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineConfiguration;
+
+import javax.xml.namespace.QName;
+import java.util.*;
 
 /**
  * Class PhaseResolver
@@ -106,54 +95,62 @@
             throws AxisFault, PhaseException {
         int flowtype = type;
         ArrayList allHandlers = new ArrayList();
-
-       // engineConfig.getGlobal().getModules()
-
-       //  int count = server.getModuleCount();
-        // QName moduleName;
         AxisModule module;
         Flow flow = null;
-
-        /*
-        * //adding server specific handlers  . global
-        * for(int intA=0 ; intA < count; intA ++){
-        * moduleName = server.getModule(intA);
-        * module = engineConfig.getModule(moduleName);
-        * switch (flowtype){
-        * case 1 : {
-        * flow = module.getInFlow();
-        * break;
-        * }
-        * case  2 : {
-        * flow = module.getOutFlow();
-        * break;
-        * }
-        * case 3 : {
-        * flow = module.getFaultInFlow();
-        * break;
-        * }
-        * }
-        * for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
-        * HandlerMetaData metadata = flow.getHandler(j);
-        * //todo change this in properway
-        * if (metadata.getRules().getPhaseName().equals("")){
-        * metadata.getRules().setPhaseName("global");
-        * }
-        * allHandlers.add(metadata);
-        * }
-        * }
-        */
+        ArrayList modules = (ArrayList)engineConfig.getGlobal().getModules();
+        //Global modules
+        for (int i = 0; i < modules.size(); i++) {
+            QName name = (QName) modules.get(i);
+            module = engineConfig.getModule(name);
+            if(module != null){
+                switch (flowtype) {
+                    case PhaseMetadata.IN_FLOW:
+                        {
+                            flow = module.getInFlow();
+                            break;
+                        }
+                    case PhaseMetadata.OUT_FLOW:
+                        {
+                            flow = module.getOutFlow();
+                            break;
+                        }
+                    case PhaseMetadata.FAULT_IN_FLOW:
+                        {
+                            flow = module.getFaultInFlow();
+                            break;
+                        }
+                    case PhaseMetadata.FAULT_OUT_FLOW:
+                        {
+                            flow = module.getFaultOutFlow();
+                            break;
+                        }
+                }
+                if (flow != null) {
+                    for (int j = 0; j < flow.getHandlerCount(); j++) {
+                        HandlerMetadata metadata = flow.getHandler(j);
+                        /**
+                         * If the phase property of a handler is pre-dispatch then those
handlers
+                         * should go to the global chain , to the pre-dispatch phase
+                         */
+                        if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                            continue;
+                        }
+                        if (metadata.getRules().getPhaseName().equals("")) {
+                            metadata.getRules().setPhaseName("service");
+                        }
+                        allHandlers.add(metadata);
+                    }
+                }
+            } else {
+                throw new PhaseException("Referred module is NULL " +  name.getLocalPart());
+            }
+        }
 
         // service module handlers
         Collection collection = axisService.getModules();
         Iterator itr = collection.iterator();
         while (itr.hasNext()) {
             QName moduleref = (QName) itr.next();
-
-            // }
-            // Vector modules = (Vector)axisService.getModules();
-            // for (int i = 0; i < modules.size(); i++) {
-            // QName moduleref = (QName) modules.elementAt(i);
             module = engineConfig.getModule(moduleref);
             switch (flowtype) {
                 case PhaseMetadata.IN_FLOW:
@@ -181,7 +178,13 @@
                 for (int j = 0; j < flow.getHandlerCount(); j++) {
                     HandlerMetadata metadata = flow.getHandler(j);
 
-                    // todo change this in properway
+                    /**
+                     * If the phase property of a handler is pre-dispatch then those handlers
+                     * should go to the global chain , to the pre-dispatch phase
+                     */
+                    if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                        continue;
+                    }
                     if (metadata.getRules().getPhaseName().equals("")) {
                         metadata.getRules().setPhaseName("service");
                     }
@@ -222,7 +225,7 @@
                 allHandlers.add(metadata);
             }
         }
-        phaseHolder = new PhaseHolder(engineConfig, axisService,serviceContext);
+        phaseHolder = new PhaseHolder(engineConfig, axisService, serviceContext);
         phaseHolder.setFlowType(flowtype);
         for (int i = 0; i < allHandlers.size(); i++) {
             HandlerMetadata handlerMetaData =
@@ -339,7 +342,7 @@
     public EngineContext buildGlobalChains()
             throws AxisFault, PhaseException {
         EngineContext engineContext = new EngineContext(engineConfig);
-        AxisGlobal global =engineConfig.getGlobal();
+        AxisGlobal global = engineConfig.getGlobal();
         List modules = (List) global.getModules();
         int count = modules.size();
         QName moduleName;
@@ -376,12 +379,15 @@
                 if (flow != null) {
                     for (int j = 0; j < flow.getHandlerCount(); j++) {
                         HandlerMetadata metadata = flow.getHandler(j);
-
-                        // todo change this in properway
-                        if (metadata.getRules().getPhaseName().equals("")) {
-                            metadata.getRules().setPhaseName("global");
+                        /**
+                         * If the phase property of a handler is pre-dispatch then those
handlers
+                         * should go to the global chain , to the pre-dispatch phase
+                         */
+                        if(PhaseMetadata.PRE_DISPATCH.equals(metadata.getRules().getPhaseName())){
+                            phaseHolder.addHandler(metadata);
+                        }  else {
+                            continue;
                         }
-                        phaseHolder.addHandler(metadata);
                     }
                 }
             }



Mime
View raw message