You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by de...@apache.org on 2005/06/07 08:50:04 UTC

svn commit: r188721 - in /webservices/axis/trunk/java/modules: addressing/src/META-INF/module.xml addressing/src/org/apache/axis/AddressingModule.java core/src/org/apache/axis/context/ConfigurationContextFactory.java core/src/org/apache/axis/deployment/DeploymentParser.java

Author: deepal
Date: Mon Jun  6 23:50:03 2005
New Revision: 188721

URL: http://svn.apache.org/viewcvs?rev=188721&view=rev
Log:
Removed compulsory Module implementation from Modules.
so the class atribute of module.xml is optional

Removed:
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java
Modified:
    webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ConfigurationContextFactory.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentParser.java

Modified: webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml?rev=188721&r1=188720&r2=188721&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml (original)
+++ webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml Mon Jun  6 23:50:03 2005
@@ -1,4 +1,4 @@
-<module name="addressing" class="org.apache.axis.AddressingModule">
+<module name="addressing">
     <inflow>
         <handler name="AddressingInHandler" class="org.apache.axis.handlers.addressing.AddressingInHandler">
             <order phase="PreDispatch"/>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ConfigurationContextFactory.java?rev=188721&r1=188720&r2=188721&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ConfigurationContextFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/ConfigurationContextFactory.java Mon Jun  6 23:50:03 2005
@@ -32,7 +32,6 @@
             DeploymentEngine deploymentEngine = new DeploymentEngine(RepositaryName);
             AxisConfiguration configuration = deploymentEngine.load();
             PhaseResolver phaseResolver = new PhaseResolver(configuration);
-            //TODO have to do smt Deepal
             configurationContext = new ConfigurationContext(configuration) ;
             phaseResolver.buildTranspotsChains();
             initModules(configurationContext);
@@ -47,7 +46,6 @@
         try {
             AxisConfiguration configuration = new DeploymentEngine().loadClient(axis2home);
             PhaseResolver phaseResolver = new PhaseResolver(configuration);
-               //TODO have to do smt Deepal
             engineContext = new ConfigurationContext(configuration) ;
             phaseResolver.buildTranspotsChains();
             initModules(engineContext);
@@ -65,8 +63,7 @@
      * @throws DeploymentException
      */
 
-
-    private void initModules(ConfigurationContext context) throws DeploymentException {
+   private void initModules(ConfigurationContext context) throws DeploymentException {
         try {
             HashMap modules = ((AxisConfigurationImpl) context.getAxisConfiguration()).getModules();
             Collection col = modules.values();

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?rev=188721&r1=188720&r2=188721&view=diff
==============================================================================
--- 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 Jun  6 23:50:03 2005
@@ -61,7 +61,7 @@
      * @param engine
      */
     public DeploymentParser(InputStream inputStream, DeploymentEngine engine)
-        throws XMLStreamException {
+            throws XMLStreamException {
         this.dpengine = engine;
         pullparser = XMLInputFactory.newInstance().createXMLStreamReader(inputStream);
     }
@@ -92,7 +92,7 @@
      * To process server.xml
      */
     public void processGlobalConfig(AxisConfigurationImpl axisGlobal, String starttag)
-        throws DeploymentException {
+            throws DeploymentException {
         String START_TAG = starttag;
         try {
             boolean END_DOCUMENT = false;
@@ -130,31 +130,31 @@
                                     try {
                                         Class messageReceiver = null;
                                         ClassLoader loader1 =
-                                            Thread.currentThread().getContextClassLoader();
+                                                Thread.currentThread().getContextClassLoader();
                                         if (attvalue != null && !"".equals(attvalue)) {
                                             messageReceiver =
-                                                Class.forName(attvalue, true, loader1);
+                                                    Class.forName(attvalue, true, loader1);
                                             axisGlobal.addMessageReceiver(
-                                                name,
-                                                (MessageReceiver) messageReceiver.newInstance());
+                                                    name,
+                                                    (MessageReceiver) messageReceiver.newInstance());
                                         }
                                     } catch (ClassNotFoundException e) {
                                         throw new DeploymentException(
-                                            "Error in loading messageRecivers " + e.getMessage());
+                                                "Error in loading messageRecivers " + e.getMessage());
                                     } catch (IllegalAccessException e) {
                                         throw new DeploymentException(
-                                            "Error in loading messageRecivers " + e.getMessage());
+                                                "Error in loading messageRecivers " + e.getMessage());
                                     } catch (InstantiationException e) {
                                         throw new DeploymentException(
-                                            "Error in loading messageRecivers " + e.getMessage());
+                                                "Error in loading messageRecivers " + e.getMessage());
                                     }
                                 } else
                                     throw new UnsupportedOperationException(
-                                        "invalid attributes in server.xml (messageReceiver elemet) "
+                                            "invalid attributes in server.xml (messageReceiver elemet) "
                                             + attname);
                             } else
                                 throw new UnsupportedOperationException(
-                                    "invalid attributes in server.xml (messageReceiver elemet) "
+                                        "invalid attributes in server.xml (messageReceiver elemet) "
                                         + attname);
                         } else
                             throw new UnsupportedOperationException("invalid attributes in server.xml (messageReceiver elemet)");
@@ -188,17 +188,17 @@
                                         tempdata.setOUT_FaultPhases(processPhaseOrder());
                                     } else {
                                         throw new DeploymentException(
-                                            "un defined flow type  " + ST);
+                                                "un defined flow type  " + ST);
                                     }
                                 }
                             }
                         } else {
                             throw new DeploymentException(
-                                "Flow type is a required attribute in " + ST);
+                                    "Flow type is a required attribute in " + ST);
                         }
                     } else {
                         throw new UnsupportedOperationException(
-                            ST + " element is not allowed in the server.xml");
+                                ST + " element is not allowed in the server.xml");
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -230,10 +230,10 @@
                 Class reciever = null;
                 try {
                     reciever =
-                        Class.forName(
-                            attvalue,
-                            true,
-                            Thread.currentThread().getContextClassLoader());
+                            Class.forName(
+                                    attvalue,
+                                    true,
+                                    Thread.currentThread().getContextClassLoader());
                     TransportListener trnsrecievr = (TransportListener) reciever.newInstance();
                     transportin.setReciver(trnsrecievr);
                 } catch (ClassNotFoundException e) {
@@ -261,7 +261,7 @@
                         transportin.setInFlow(inFlow);
                     } else if (transportin != null && OUTFLOWST.equals(tagnae)) {
                         throw new DeploymentException(
-                            "OUTFlow dose not support in AxisTransportIN " + tagnae);
+                                "OUTFlow dose not support in AxisTransportIN " + tagnae);
                     } else if (transportin != null && IN_FAILTFLOW.equals(tagnae)) {
                         Flow faultFlow = processInFaultFlow();
                         transportin.setFaultFlow(faultFlow);
@@ -298,10 +298,10 @@
                 Class sender = null;
                 try {
                     sender =
-                        Class.forName(
-                            attvalue,
-                            true,
-                            Thread.currentThread().getContextClassLoader());
+                            Class.forName(
+                                    attvalue,
+                                    true,
+                                    Thread.currentThread().getContextClassLoader());
                     TransportSender transportSender = (TransportSender) sender.newInstance();
                     transportout.setSender(transportSender);
                 } catch (ClassNotFoundException e) {
@@ -326,7 +326,7 @@
                         transportout.addParameter(parameter);
                     } else if (transportout != null && INFLOWST.equals(tagnae)) {
                         throw new DeploymentException(
-                            "InFlow dose not support in TransportOutDescription  " + tagnae);
+                                "InFlow dose not support in TransportOutDescription  " + tagnae);
                     } else if (transportout != null && OUTFLOWST.equals(tagnae)) {
                         Flow outFlow = processOutFlow();
                         transportout.setOutFlow(outFlow);
@@ -364,15 +364,15 @@
                 if (ATQNAME.equals(attname)) {
                     if (attvalue == null || attvalue.trim().equals("")) {
                         axisService.setName(
-                            new QName(
-                                getAxisServiceName(
-                                    dpengine.getCurrentFileItem().getServiceName())));
+                                new QName(
+                                        getAxisServiceName(
+                                                dpengine.getCurrentFileItem().getServiceName())));
                     } else {
                         axisService.setName(new QName(attvalue));
                     }
                 } else {
                     throw new DeploymentException(
-                        attname
+                            attname
                             + " Bad arguments for the service"
                             + getAxisServiceName(dpengine.getCurrentFileItem().getServiceName()));
                 }
@@ -380,7 +380,7 @@
         } else {
             //if user dose not specify the service name then the default name will be the archive name
             axisService.setName(
-                new QName(getAxisServiceName(dpengine.getCurrentFileItem().getServiceName())));
+                    new QName(getAxisServiceName(dpengine.getCurrentFileItem().getServiceName())));
         }
         boolean END_DOCUMENT = false;
         try {
@@ -414,23 +414,23 @@
                                  * Setting default Message Recive as Message Reciever
                                  */
                                 ClassLoader loader1 =
-                                    Thread.currentThread().getContextClassLoader();
+                                        Thread.currentThread().getContextClassLoader();
                                 Class messageReceiver =
-                                    Class.forName(
-                                        "org.apache.axis.receivers.RawXMLINOutMessageRecevier",
-                                        true,
-                                        loader1);
+                                        Class.forName(
+                                                "org.apache.axis.receivers.RawXMLINOutMessageRecevier",
+                                                true,
+                                                loader1);
                                 operation.setMessageReciever(
-                                    (MessageReceiver) messageReceiver.newInstance());
+                                        (MessageReceiver) messageReceiver.newInstance());
                             } catch (ClassNotFoundException e) {
                                 throw new DeploymentException(
-                                    "Error in loading messageRecivers " + e.getMessage());
+                                        "Error in loading messageRecivers " + e.getMessage());
                             } catch (IllegalAccessException e) {
                                 throw new DeploymentException(
-                                    "Error in loading messageRecivers " + e.getMessage());
+                                        "Error in loading messageRecivers " + e.getMessage());
                             } catch (InstantiationException e) {
                                 throw new DeploymentException(
-                                    "Error in loading messageRecivers " + e.getMessage());
+                                        "Error in loading messageRecivers " + e.getMessage());
                             }
                         }
                         axisService.addOperation(operation);
@@ -455,11 +455,11 @@
                                 if (REF.equals(attname)) {
                                     if (dpengine.getModule(new QName(attvalue)) == null) {
                                         throw new DeploymentException(
-                                            ST
+                                                ST
                                                 + " module is invalid or dose not have bean deployed");
                                     } else {
                                         dpengine.getCurrentFileItem().addModule(
-                                            new QName(attvalue));
+                                                new QName(attvalue));
                                     }
                                 }
                             }
@@ -467,7 +467,7 @@
 
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + ST);
+                                "parser Exception : un supported element" + ST);
                     }
                 }
             }
@@ -579,7 +579,7 @@
             } else if (ATTNAME.equals(attname)) {
                 if (ref_name) {
                     throw new DeploymentException(
-                        "Hanlder canot have both name and ref  " + attvalue);
+                            "Hanlder canot have both name and ref  " + attvalue);
                 } else {
                     handler.setName(new QName(attvalue));
                     ref_name = true;
@@ -587,7 +587,7 @@
             } else if (REF.equals(attname)) {
                 if (ref_name) {
                     throw new DeploymentException(
-                        "Hanlder canot have both name and ref  " + attvalue);
+                            "Hanlder canot have both name and ref  " + attvalue);
                 } else {
                     ref_name = true;
                     throw new UnsupportedOperationException("This should be implmented");
@@ -639,7 +639,7 @@
                         handler.addParameter(parameter);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -720,7 +720,7 @@
                                 if (REF.equals(attname)) {
                                     if (dpengine.getModule(new QName(attvalue)) == null) {
                                         throw new DeploymentException(
-                                            ST
+                                                ST
                                                 + " module is invalid or dose not have bean deployed");
                                     } else {
                                         operation.addModule(new QName(attvalue));
@@ -743,25 +743,25 @@
                                 try {
                                     Class messageReceiver = null;
                                     ClassLoader loader1 =
-                                        Thread.currentThread().getContextClassLoader();
+                                            Thread.currentThread().getContextClassLoader();
                                     if (attvalue != null && !"".equals(attvalue)) {
                                         messageReceiver = Class.forName(attvalue, true, loader1);
                                         operation.setMessageReciever(
-                                            (MessageReceiver) messageReceiver.newInstance());
+                                                (MessageReceiver) messageReceiver.newInstance());
                                     }
                                 } catch (ClassNotFoundException e) {
                                     throw new DeploymentException(
-                                        "Error in loading messageRecivers " + e.getMessage());
+                                            "Error in loading messageRecivers " + e.getMessage());
                                 } catch (IllegalAccessException e) {
                                     throw new DeploymentException(
-                                        "Error in loading messageRecivers " + e.getMessage());
+                                            "Error in loading messageRecivers " + e.getMessage());
                                 } catch (InstantiationException e) {
                                     throw new DeploymentException(
-                                        "Error in loading messageRecivers " + e.getMessage());
+                                            "Error in loading messageRecivers " + e.getMessage());
                                 }
                             } else {
                                 throw new UnsupportedOperationException(
-                                    attname + " is not allowed in messageRecievr element");
+                                        attname + " is not allowed in messageRecievr element");
                             }
                         }
                     }
@@ -814,7 +814,7 @@
     public void processModule(ModuleDescription module) throws DeploymentException {
         int attribCount = pullparser.getAttributeCount();
         boolean ref_name = false;
-        boolean foundClass = false;
+        //boolean foundClass = false;
         if (attribCount > 0) {
             for (int i = 0; i < attribCount; i++) {
                 String attname = pullparser.getAttributeLocalName(i);
@@ -823,18 +823,18 @@
                 if (ATTNAME.equals(attname)) {
                     if (ref_name) {
                         throw new DeploymentException(
-                            "Module canot have both name and ref  " + attvalue);
+                                "Module canot have both name and ref  " + attvalue);
                     } else {
                         module.setName(new QName(attvalue));
                         ref_name = true;
                     }
                 } else if (CLASSNAME.equals(attname)) {
-                    foundClass = true;
+                    //          foundClass = true;
                     dpengine.getCurrentFileItem().setModuleClass(attvalue);
                 } else if (REF.equals(attname)) {
                     if (ref_name) {
                         throw new DeploymentException(
-                            "Module canot have both name and ref  " + attvalue);
+                                "Module canot have both name and ref  " + attvalue);
                     } else {
                         //  module.setRef(attvalue);
                         ref_name = true;
@@ -842,10 +842,10 @@
                     }
                 }
             }
-        }
-        if (!foundClass) {
-            throw new DeploymentException("Module Implemantation class dose not found");
-        }
+        }                                                          
+        /*if (!foundClass) {
+        throw new DeploymentException("Module Implemantation class dose not found");
+        }*/
         boolean END_MODULE = false;
         try {
             while (!END_MODULE) {
@@ -873,7 +873,7 @@
                         module.setOutFlow(outFlow);
                     } else {
                         throw new UnsupportedOperationException(
-                            ST + "elment is not allowed in module.xml");
+                                ST + "elment is not allowed in module.xml");
                     }
                     // complete implenatation
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
@@ -910,7 +910,7 @@
                         inFlow.addHandler(handler);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -945,7 +945,7 @@
                         outFlow.addHandler(handler);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -981,7 +981,7 @@
                         faultFlow.addHandler(handler);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -1016,7 +1016,7 @@
                         faultFlow.addHandler(handler);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -1052,7 +1052,7 @@
                         }
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + tagnae);
+                                "parser Exception : un supported element" + tagnae);
                     }
                 } else if (eventType == XMLStreamConstants.END_ELEMENT) {
                     String endtagname = pullparser.getLocalName();
@@ -1124,7 +1124,7 @@
                         // module.setName(archiveName);
                     } else {
                         throw new DeploymentException(
-                            "parser Exception : un supported element" + ST);
+                                "parser Exception : un supported element" + ST);
                     }
                     //processStartElement();
                     break;