axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r465620 - in /webservices/axis2/branches/java/1_1/modules: kernel/src/org/apache/axis2/context/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/repository/util/ kernel/src/org/apache/axis2/deployment/util/ ker...
Date Thu, 19 Oct 2006 13:26:10 GMT
Author: deepal
Date: Thu Oct 19 06:26:09 2006
New Revision: 465620

URL: http://svn.apache.org/viewvc?view=rev&rev=465620
Log:
fixing AXIS2-1448

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/branches/java/1_1/modules/kernel/test/org/apache/axis2/engine/ModuleConfigTest.java
    webservices/axis2/branches/java/1_1/modules/samples/groovy/src/sample/groovy/GroovyReceiver.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
Thu Oct 19 06:26:09 2006
@@ -70,7 +70,7 @@
         init(configContext);
         axisConfigurator.engageGlobalModules();
         axisConfigurator.loadServices();
-        addModuleService(axisConfig);
+        addModuleService(configContext);
         initApplicationScopeServices(configContext);
         axisConfig.setStart(true);
         return configContext;
@@ -89,13 +89,14 @@
         }
     }
 
-    public static void addModuleService(AxisConfiguration axisConfig) throws AxisFault {
+    public static void addModuleService(ConfigurationContext configCtx) throws AxisFault
{
+        AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
         HashMap modules = axisConfig.getModules();
         if (modules != null && modules.size() > 0) {
             Iterator mpduleItr = modules.values().iterator();
             while (mpduleItr.hasNext()) {
                 AxisModule axisModule = (AxisModule) mpduleItr.next();
-                Utils.deployModuleServices(axisModule, axisConfig);
+                Utils.deployModuleServices(axisModule, configCtx);
             }
         }
     }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
Thu Oct 19 06:26:09 2006
@@ -32,7 +32,6 @@
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.engine.ServiceLifeCycle;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
@@ -220,7 +219,7 @@
                 throw new DeploymentException(
                         Messages.getMessage(DeploymentErrorMsgs.SERVICE_XML_NOT_FOUND, servicesURL.toString()));
             }
-            DescriptionBuilder builder = new DescriptionBuilder(servicexmlStream, axisConfig);
+            DescriptionBuilder builder = new DescriptionBuilder(servicexmlStream, configContext);
             OMElement rootElement = builder.buildOM();
             String elementName = rootElement.getLocalName();
 
@@ -244,7 +243,7 @@
                 axisService.setParent(serviceGroup);
                 axisService.setClassLoader(serviceClassLoader);
 
-                ServiceBuilder serviceBuilder = new ServiceBuilder(axisConfig, axisService);
+                ServiceBuilder serviceBuilder = new ServiceBuilder(configContext, axisService);
                 AxisService service = serviceBuilder.populateService(rootElement);
 
                 ArrayList serviceList = new ArrayList();
@@ -252,7 +251,7 @@
                 return serviceList;
             } else if (TAG_SERVICE_GROUP.equals(elementName)) {
                 ServiceGroupBuilder groupBuilder = new ServiceGroupBuilder(rootElement, new
HashMap(),
-                        axisConfig);
+                        configContext);
                 ArrayList servicList = groupBuilder.populateServiceGroup(serviceGroup);
                 Iterator serviceIterator = servicList.iterator();
                 while (serviceIterator.hasNext()) {
@@ -340,7 +339,6 @@
             throws AxisFault {
         fillServiceGroup(serviceGroup, serviceList, serviceLocation, axisConfig);
         axisConfig.addServiceGroup(serviceGroup);
-        startUpService(serviceGroup);
         if (currentArchiveFile != null) {
             addAsWebResources(currentArchiveFile.getFile(),
                     serviceGroup.getServiceGroupName(), serviceGroup);
@@ -423,25 +421,6 @@
         }
     }
 
-    /**
-     * When user adds the "load-on-startup" parameter into services.xml ,
-     * Axis2 will call following method using Java reflection.
-     * If user has DB initialization , Thread creation then he can do that at this point.
-     * Public void startUp(ConfigurationContext) {}
-     *
-     * @param serviceGroup
-     */
-    private void startUpService(AxisServiceGroup serviceGroup) {
-        Iterator services = serviceGroup.getServices();
-        while (services.hasNext()) {
-            AxisService axisService = (AxisService) services.next();
-            ServiceLifeCycle serviceLifeCycle = axisService.getServiceLifeCycle();
-            if (serviceLifeCycle != null) {
-                serviceLifeCycle.startUp(configContext, axisService);
-            }
-        }
-    }
-
     private void addAsWebResources(File in, String serviceFileName, AxisServiceGroup serviceGroup)
{
         try {
             if (webLocationString == null) {
@@ -533,7 +512,7 @@
                                 ArrayList serviceList = archiveReader.processServiceGroup(
                                         currentArchiveFile.getAbsolutePath(), currentArchiveFile,
                                         sericeGroup, explodedDir, wsdlservice,
-                                        axisConfig);
+                                        configContext);
                                 addServiceGroup(sericeGroup, serviceList, currentArchiveFile.getFile().toURL(),
currentArchiveFile);
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
                                         currentArchiveFile.getName()));
@@ -981,11 +960,12 @@
      */
     public static AxisService buildService(InputStream serviceInputStream,
                                            ClassLoader classLoader,
-                                           AxisConfiguration axisConfig)
+                                           ConfigurationContext configCtx)
             throws DeploymentException {
         AxisService axisService = new AxisService();
         try {
 
+            AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
             Parameter parahotupdate = axisConfig.getParameter(TAG_HOT_UPDATE);
             boolean antiJARLocking = true;
             if (parahotupdate != null) {
@@ -999,7 +979,7 @@
                     DeploymentConstants.TYPE_SERVICE, "", antiJARLocking);
             currentArchiveFile.setClassLoader(classLoader);
 
-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig,
+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
                     axisService);
 
             builder.populateService(builder.buildOM());
@@ -1015,16 +995,16 @@
     /**
      * To build a AxisServiceGroup for a given services.xml
      * You have to add the created group into AxisConfig
-     * @param servicesxml : inpupstream create using services.xml
-     * @param classLoader : corresponding class loader to load the class
+     *
+     * @param servicesxml      : inpupstream create using services.xml
+     * @param classLoader      : corresponding class loader to load the class
      * @param serviceGroupName : name of the service group
-     * @param axisConfig : 
      * @throws AxisFault
      */
     public static AxisServiceGroup buildServiceGroup(InputStream servicesxml,
                                                      ClassLoader classLoader,
                                                      String serviceGroupName,
-                                                     AxisConfiguration axisConfig,
+                                                     ConfigurationContext configCtx,
                                                      ArchiveReader archiveReader,
                                                      HashMap wsdlServices) throws AxisFault
{
         ArchiveFileData currentArchiveFile = new ArchiveFileData(
@@ -1033,10 +1013,11 @@
         AxisServiceGroup serviceGroup = new AxisServiceGroup();
         serviceGroup.setServiceGroupClassLoader(classLoader);
         serviceGroup.setServiceGroupName(serviceGroupName);
+        AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
         try {
             ArrayList serviceList = archiveReader.buildServiceGroup(servicesxml,
                     currentArchiveFile, serviceGroup,
-                    wsdlServices, axisConfig);
+                    wsdlServices, configCtx);
             fillServiceGroup(serviceGroup, serviceList, null, axisConfig);
             return serviceGroup;
         } catch (XMLStreamException e) {

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
Thu Oct 19 06:26:09 2006
@@ -20,22 +20,17 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.util.Loader;
-import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.Flow;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.Parameter;
-import org.apache.axis2.description.ParameterInclude;
-import org.apache.axis2.description.PolicyInclude;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.i18n.Messages;
+import org.apache.axis2.util.Loader;
+import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.Policy;
@@ -57,6 +52,8 @@
 
     private static final Log log = LogFactory.getLog(DescriptionBuilder.class);
 
+    protected ConfigurationContext configCtx;
+
     protected AxisConfiguration axisConfig;
 
     protected InputStream descriptionStream;
@@ -65,7 +62,14 @@
     }
 
     public DescriptionBuilder(InputStream serviceInputStream,
-            AxisConfiguration axisConfig) {
+                              ConfigurationContext configCtx) {
+        this.configCtx = configCtx;
+        this.descriptionStream = serviceInputStream;
+        this.axisConfig = this.configCtx.getAxisConfiguration();
+    }
+
+    public DescriptionBuilder(InputStream serviceInputStream,
+                              AxisConfiguration axisConfig) {
         this.descriptionStream = serviceInputStream;
         this.axisConfig = axisConfig;
     }
@@ -73,10 +77,10 @@
     /**
      * Creates OMElement for a given description document (axis2.xml ,
      * services.xml and module.xml).
-     * 
+     *
      * @return Returns <code>OMElement</code> .
      * @throws javax.xml.stream.XMLStreamException
-     * 
+     *
      */
     public OMElement buildOM() throws XMLStreamException {
         XMLStreamReader xmlReader = StAXUtils
@@ -94,14 +98,14 @@
      * Loads default message receivers. First searches in Axiservice for the
      * given mepURL, if not found searches in AxisConfiguration with the given
      * mepURL.
-     * 
-     * @param mepURL :
-     *            can be null
+     *
+     * @param mepURL  :
+     *                can be null
      * @param service :
-     *            This can be null <code>AxisService</code>
+     *                This can be null <code>AxisService</code>
      */
     protected MessageReceiver loadDefaultMessageReceiver(String mepURL,
-            AxisService service) {
+                                                         AxisService service) {
         MessageReceiver messageReceiver;
         if (mepURL == null) {
             mepURL = WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT;
@@ -117,7 +121,7 @@
     /**
      * Processes default message receivers specified either in axis2.xml or
      * services.xml.
-     * 
+     *
      * @param messageReceivers
      */
     protected HashMap processMessageReceivers(OMElement messageReceivers)
@@ -138,11 +142,11 @@
     /**
      * Processes default message receivers specified either in axis2.xml or
      * services.xml.
-     * 
+     *
      * @param element
      */
     protected HashMap processMessageReceivers(ClassLoader loader,
-            OMElement element) throws DeploymentException {
+                                              OMElement element) throws DeploymentException
{
         HashMap meps = new HashMap();
         Iterator iterator = element.getChildrenWithName(new QName(
                 TAG_MESSAGE_RECEIVER));
@@ -158,7 +162,7 @@
     }
 
     protected MessageReceiver loadMessageReceiver(ClassLoader loader,
-            OMElement element) throws DeploymentException {
+                                                  OMElement element) throws DeploymentException
{
         OMAttribute receiverName = element.getAttribute(new QName(
                 TAG_CLASS_NAME));
         String className = receiverName.getAttributeValue();
@@ -190,12 +194,10 @@
 
     /**
      * Processes flow elements in services.xml .
-     * 
-     * @param flowelement
-     *            <code>OMElement</code>
+     *
+     * @param flowelement <code>OMElement</code>
      * @return Returns Flow.
-     * @throws DeploymentException
-     *             <code>DeploymentException</code>
+     * @throws DeploymentException <code>DeploymentException</code>
      */
     protected Flow processFlow(OMElement flowelement, ParameterInclude parent)
             throws DeploymentException {
@@ -229,39 +231,37 @@
         }
         return null;
     }
-    
+
     protected QName[] getLocalPolicyAssertionNames(OMElement localPolicyAssertionsElement)
{
-        
+
         Iterator iterator = localPolicyAssertionsElement.getChildElements();
         if (! iterator.hasNext()) {
-            return null;            
+            return null;
         }
-                
+
         ArrayList qnames = new ArrayList();
         OMElement childElement;
-        
+
         for (; iterator.hasNext();) {
             childElement = (OMElement) iterator.next();
             qnames.add(childElement.getQName());
         }
-        
+
         QName[] buffer = new QName[qnames.size()];
         System.arraycopy(qnames.toArray(), 0, buffer, 0, qnames.size());
         return buffer;
-         
+
     }
 
     /**
      * Processes Handler element.
-     * 
-     * @param handler_element
-     *            <code>OMElement</code>
+     *
+     * @param handler_element <code>OMElement</code>
      * @return Returns HandlerDescription.
-     * @throws DeploymentException
-     *             <code>DeploymentException</code>
+     * @throws DeploymentException <code>DeploymentException</code>
      */
     protected HandlerDescription processHandler(OMElement handler_element,
-            ParameterInclude parent) throws DeploymentException {
+                                                ParameterInclude parent) throws DeploymentException
{
         HandlerDescription handler = new HandlerDescription();
 
         // Setting handler name
@@ -340,7 +340,7 @@
     }
 
     protected void processOperationModuleRefs(Iterator moduleRefs,
-            AxisOperation operation) throws DeploymentException {
+                                              AxisOperation operation) throws DeploymentException
{
         try {
             while (moduleRefs.hasNext()) {
                 OMElement moduleref = (OMElement) moduleRefs.next();
@@ -361,22 +361,19 @@
         } catch (AxisFault axisFault) {
             throw new DeploymentException(Messages.getMessage(
                     DeploymentErrorMsgs.MODULE_NOT_FOUND, axisFault
-                            .getMessage()), axisFault);
+                    .getMessage()), axisFault);
         }
     }
 
     /**
      * Gets the Parameter object from the OM.
-     * 
-     * @param parameters
-     *            <code>Parameter</code>
-     * @param parameterInclude
-     *            <code>ParameterInclude</code>
-     * @param parent
-     *            <code>ParameterInclude</code>
+     *
+     * @param parameters       <code>Parameter</code>
+     * @param parameterInclude <code>ParameterInclude</code>
+     * @param parent           <code>ParameterInclude</code>
      */
     protected void processParameters(Iterator parameters,
-            ParameterInclude parameterInclude, ParameterInclude parent)
+                                     ParameterInclude parameterInclude, ParameterInclude
parent)
             throws DeploymentException {
         while (parameters.hasNext()) {
             // this is to check whether some one has locked the parmeter at the
@@ -421,7 +418,7 @@
                             && parent.isParameterLocked(parameter.getName())) {
                         throw new DeploymentException(Messages.getMessage(
                                 DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter
-                                        .getName()));
+                                .getName()));
                     } else {
                         parameter.setLocked(true);
                     }
@@ -448,12 +445,12 @@
      * Populate the AxisOperation with details from the actionMapping,
      * outputActionMapping and faultActionMapping elements from the operation
      * element.
-     * 
+     *
      * @param operation
      * @param op_descrip
      */
     protected void processActionMappings(OMElement operation,
-            AxisOperation op_descrip) {
+                                         AxisOperation op_descrip) {
         Iterator mappingIterator = operation.getChildrenWithName(new QName(
                 Constants.ACTION_MAPPING));
         ArrayList mappingList = new ArrayList();
@@ -463,9 +460,9 @@
             if (log.isTraceEnabled()) {
                 log.trace("Input Action Mapping found: " + inputActionString);
             }
-            if(!"".equals(inputActionString)){
+            if (!"".equals(inputActionString)) {
                 mappingList.add(inputActionString);
-            }else{
+            } else {
                 if (log.isTraceEnabled()) {
                     log.trace("Zero length input action string found. Not added to mapping");
                 }
@@ -501,7 +498,7 @@
     }
 
     protected void processPolicyElements(int type, Iterator policyElements,
-            PolicyInclude policyInclude) {
+                                         PolicyInclude policyInclude) {
         while (policyElements.hasNext()) {
             Policy p = PolicyEngine
                     .getPolicy((OMElement) policyElements.next());
@@ -510,7 +507,7 @@
     }
 
     protected void processPolicyRefElements(int type,
-            Iterator policyRefElements, PolicyInclude policyInclude) {
+                                            Iterator policyRefElements, PolicyInclude policyInclude)
{
 
         while (policyRefElements.hasNext()) {
             PolicyReference policyReference = PolicyEngine
@@ -521,7 +518,7 @@
 
     /**
      * Gets the short file name. Short file name is the name before the dot.
-     * 
+     *
      * @param fileName
      * @return Returns String.
      */
@@ -541,7 +538,7 @@
 
     /**
      * Gets the value of an attribute. eg xsd:anyVal --> anyVal
-     * 
+     *
      * @return Returns String.
      */
     protected String getValue(String in) {

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceBuilder.java
Thu Oct 19 06:26:09 2006
@@ -20,10 +20,10 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.*;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.engine.ServiceLifeCycle;
 import org.apache.axis2.i18n.Messages;
@@ -46,14 +46,15 @@
     private static final Log log = LogFactory.getLog(ServiceBuilder.class);
     private AxisService service;
 
-    public ServiceBuilder(AxisConfiguration axisConfig, AxisService service) {
+    public ServiceBuilder(ConfigurationContext configCtx, AxisService service) {
         this.service = service;
-        this.axisConfig = axisConfig;
+        this.configCtx = configCtx;
+        this.axisConfig = this.configCtx.getAxisConfiguration();
     }
 
-    public ServiceBuilder(InputStream serviceInputStream, AxisConfiguration axisConfig,
+    public ServiceBuilder(InputStream serviceInputStream, ConfigurationContext configCtx,
                           AxisService service) {
-        super(serviceInputStream, axisConfig);
+        super(serviceInputStream, configCtx);
         this.service = service;
     }
 
@@ -126,8 +127,10 @@
                     try {
                         ClassLoader loader = service.getClassLoader();
                         Class serviceLifeCycleClassImpl = Loader.loadClass(loader, className);
+                        ServiceLifeCycle serviceLifeCycle = (ServiceLifeCycle) serviceLifeCycleClassImpl.newInstance();
+                        serviceLifeCycle.startUp(configCtx, service);
                         service.setServiceLifeCycle(
-                                (ServiceLifeCycle) serviceLifeCycleClassImpl.newInstance());
+                                serviceLifeCycle);
                     } catch (Exception e) {
                         throw new DeploymentException(e.getMessage(), e);
                     }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/ServiceGroupBuilder.java
Thu Oct 19 06:26:09 2006
@@ -20,11 +20,11 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.description.ModuleConfiguration;
 import org.apache.axis2.description.ParameterInclude;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
 
 import javax.xml.namespace.QName;
@@ -37,10 +37,11 @@
     private HashMap wsdlServices;
 
     public ServiceGroupBuilder(OMElement service, HashMap wsdlServices,
-                               AxisConfiguration axisConfig) {
+                               ConfigurationContext configCtx) {
         this.serviceElement = service;
         this.wsdlServices = wsdlServices;
-        this.axisConfig = axisConfig;
+        this.configCtx = configCtx;
+        this.axisConfig = this.configCtx.getAxisConfiguration();
     }
 
     public ArrayList populateServiceGroup(AxisServiceGroup axisServiceGroup)
@@ -87,7 +88,7 @@
                     axisService.setParent(axisServiceGroup);
                     axisService.setClassLoader(axisServiceGroup.getServiceGroupClassLoader());
 
-                    ServiceBuilder serviceBuilder = new ServiceBuilder(axisConfig, axisService);
+                    ServiceBuilder serviceBuilder = new ServiceBuilder(configCtx, axisService);
                     AxisService as = serviceBuilder.populateService(service);
                     serviceList.add(as);
                 }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
Thu Oct 19 06:26:09 2006
@@ -288,7 +288,7 @@
                 }
                 AxisServiceGroup serviceGroup = DeploymentEngine.buildServiceGroup(servicexml,
                         Thread.currentThread().getContextClassLoader(),
-                        "annonServiceGroup", axisConfig,
+                        "annonServiceGroup", configContext,
                         archiveReader, wsdlServices);
                 axisConfig.addServiceGroup(serviceGroup);
             }

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
Thu Oct 19 06:26:09 2006
@@ -21,6 +21,7 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.*;
 import org.apache.axis2.deployment.resolver.AARBasedWSDLLocator;
 import org.apache.axis2.deployment.resolver.AARFileBasedURIResolver;
@@ -44,11 +45,11 @@
     private static final Log log = LogFactory.getLog(ArchiveReader.class);
 
     public ArrayList buildServiceGroup(InputStream zin, ArchiveFileData currentFile,
-                                        AxisServiceGroup axisServiceGroup, HashMap wsdlServices,
-                                        AxisConfiguration axisConfig)
+                                       AxisServiceGroup axisServiceGroup, HashMap wsdlServices,
+                                       ConfigurationContext configCtx)
             throws XMLStreamException, AxisFault {
 
-        DescriptionBuilder builder = new DescriptionBuilder(zin, axisConfig);
+        DescriptionBuilder builder = new DescriptionBuilder(zin, configCtx);
         OMElement rootElement = builder.buildOM();
         String elementName = rootElement.getLocalName();
 
@@ -71,7 +72,7 @@
             axisService.setParent(axisServiceGroup);
             axisService.setClassLoader(currentFile.getClassLoader());
 
-            ServiceBuilder serviceBuilder = new ServiceBuilder(axisConfig, axisService);
+            ServiceBuilder serviceBuilder = new ServiceBuilder(configCtx, axisService);
             AxisService service = serviceBuilder.populateService(rootElement);
 
             ArrayList serviceList = new ArrayList();
@@ -79,7 +80,7 @@
             return serviceList;
         } else if (TAG_SERVICE_GROUP.equals(elementName)) {
             ServiceGroupBuilder groupBuilder = new ServiceGroupBuilder(rootElement, wsdlServices,
-                    axisConfig);
+                    configCtx);
             return groupBuilder.populateServiceGroup(axisServiceGroup);
         }
         throw new AxisFault("Invalid services.xml found");
@@ -92,7 +93,7 @@
      * @param axisServiceGroup
      * @param extractService
      * @param wsdls
-     * @param axisConfig
+     * @param configCtx
      * @return Returns ArrayList.
      * @throws DeploymentException
      */
@@ -100,7 +101,7 @@
                                          AxisServiceGroup axisServiceGroup,
                                          boolean extractService,
                                          HashMap wsdls,
-                                         AxisConfiguration axisConfig)
+                                         ConfigurationContext configCtx)
             throws AxisFault {
         // get attribute values
         if (!extractService) {
@@ -114,7 +115,7 @@
                     if (entry.getName().equalsIgnoreCase(SERVICES_XML)) {
                         axisServiceGroup.setServiceGroupName(
                                 DescriptionBuilder.getShortFileName(currentFile.getName()));
-                        return buildServiceGroup(zin, currentFile, axisServiceGroup, wsdls,
axisConfig);
+                        return buildServiceGroup(zin, currentFile, axisServiceGroup, wsdls,
configCtx);
                     }
                 }
                 throw new DeploymentException(
@@ -148,7 +149,7 @@
                 try {
                     in = new FileInputStream(file);
                     axisServiceGroup.setServiceGroupName(currentFile.getName());
-                    return buildServiceGroup(in, currentFile, axisServiceGroup, wsdls, axisConfig);
+                    return buildServiceGroup(in, currentFile, axisServiceGroup, wsdls, configCtx);
                 } catch (FileNotFoundException e) {
                     throw new DeploymentException(
                             Messages.getMessage(DeploymentErrorMsgs.FILE_NOT_FOUND, e.getMessage()));
@@ -359,6 +360,7 @@
             }
         }
     }
+
     public void readModuleArchive(ArchiveFileData archiveFile,
                                   AxisModule module, boolean explodedDir,
                                   AxisConfiguration axisConfig)

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
Thu Oct 19 06:26:09 2006
@@ -5,6 +5,7 @@
 import org.apache.axiom.om.OMFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.util.Loader;
 import org.apache.axis2.deployment.DeploymentConstants;
 import org.apache.axis2.deployment.DeploymentException;
@@ -380,8 +381,9 @@
      */
 
     public static void deployModuleServices(AxisModule module,
-                                            AxisConfiguration axisConfig) throws AxisFault
{
+                                            ConfigurationContext configCtx) throws AxisFault
{
         try {
+            AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
             ArchiveReader archiveReader = new ArchiveReader();
             PhasesInfo phasesInfo = axisConfig.getPhasesInfo();
             ClassLoader moduleClassLoader = module.getModuleClassLoader();
@@ -433,7 +435,7 @@
                     ArrayList serviceList = archiveReader.processServiceGroup(
                             filedata.getAbsolutePath(), filedata,
                             serviceGroup, false, wsdlservice,
-                            axisConfig);
+                            configCtx);
                     for (int j = 0; j < serviceList.size(); j++) {
                         AxisService axisService = (AxisService) serviceList.get(j);
                         serviceGroup.addService(axisService);

Modified: webservices/axis2/branches/java/1_1/modules/kernel/test/org/apache/axis2/engine/ModuleConfigTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/test/org/apache/axis2/engine/ModuleConfigTest.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/test/org/apache/axis2/engine/ModuleConfigTest.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/test/org/apache/axis2/engine/ModuleConfigTest.java
Thu Oct 19 06:26:09 2006
@@ -19,6 +19,7 @@
 import junit.framework.TestCase;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.DeploymentException;
 import org.apache.axis2.deployment.ServiceBuilder;
 import org.apache.axis2.description.AxisOperation;
@@ -61,14 +62,15 @@
 
     public void testModuleConfigAtService() {
         try {
-            ar = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
axis2xml).getAxisConfiguration();
+            ConfigurationContext configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,
axis2xml);
+            ar = configurationContext.getAxisConfiguration();
 
 
             AxisService service = new AxisService();
             service.setName("testService");
             ar.addService(service);
             InputStream in = new FileInputStream(repo + "/service1.xml");
-            ServiceBuilder sbuilder = new ServiceBuilder(in, new AxisConfiguration(), service);
+            ServiceBuilder sbuilder = new ServiceBuilder(in, configurationContext, service);
             sbuilder.populateService(sbuilder.buildOM());
 
             ModuleConfiguration moduleConfiguration = service.getModuleConfig(new QName("Servie_module"));

Modified: webservices/axis2/branches/java/1_1/modules/samples/groovy/src/sample/groovy/GroovyReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/samples/groovy/src/sample/groovy/GroovyReceiver.java?view=diff&rev=465620&r1=465619&r2=465620
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/samples/groovy/src/sample/groovy/GroovyReceiver.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/samples/groovy/src/sample/groovy/GroovyReceiver.java
Thu Oct 19 06:26:09 2006
@@ -22,8 +22,8 @@
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axis2.AxisFault;
@@ -35,51 +35,51 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver;
 
-import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
-import java.io.StringWriter;
 import java.io.StringReader;
+import java.io.StringWriter;
+
 public class GroovyReceiver
-    extends AbstractInOutSyncMessageReceiver
-    implements MessageReceiver {
+        extends AbstractInOutSyncMessageReceiver
+        implements MessageReceiver {
 
     public void invokeBusinessLogic(
-        MessageContext inMessage,
-        MessageContext outMessage)
-        throws AxisFault {
+            MessageContext inMessage,
+            MessageContext outMessage)
+            throws AxisFault {
         try {
             AxisService service =
-                inMessage
-                    .getOperationContext()
-                    .getServiceContext()
-                    .getAxisService();
+                    inMessage
+                            .getOperationContext()
+                            .getServiceContext()
+                            .getAxisService();
             Parameter implInfoParam = service.getParameter("GroovyClass");
             if (implInfoParam == null) {
                 throw new AxisFault(
-                    Messages.getMessage("paramIsNotSpecified", "ServiceClass"));
+                        Messages.getMessage("paramIsNotSpecified", "ServiceClass"));
             }
             InputStream groovyFileStream =
-                service.getClassLoader().getResourceAsStream(
-                    implInfoParam.getValue().toString());
+                    service.getClassLoader().getResourceAsStream(
+                            implInfoParam.getValue().toString());
 
             if (groovyFileStream == null) {
                 throw new AxisFault(
-                    Messages.getMessage("groovyUnableToLoad", implInfoParam.getValue().toString()));
+                        Messages.getMessage("groovyUnableToLoad", implInfoParam.getValue().toString()));
             }
 
             //look at the method name. if available this should be a groovy method
             AxisOperation op =
-                inMessage.getOperationContext().getAxisOperation();
+                    inMessage.getOperationContext().getAxisOperation();
             if (op == null) {
                 throw new AxisFault(
-                    Messages.getMessage("notFound", "Operation"));
+                        Messages.getMessage("notFound", "Operation"));
             }
             String methodName = op.getName().getLocalPart();
             OMElement firstChild =
-                (OMElement) inMessage.getEnvelope().getBody().getFirstOMChild();
+                    (OMElement) inMessage.getEnvelope().getBody().getFirstOMChild();
             inMessage.getEnvelope().build();
             StringWriter writer = new StringWriter();
             firstChild.build();
@@ -90,24 +90,24 @@
                 GroovyClassLoader loader = new GroovyClassLoader();
                 Class groovyClass = loader.parseClass(groovyFileStream);
                 GroovyObject groovyObject =
-                    (GroovyObject) groovyClass.newInstance();
-                Object[] arg = { new StringReader(value) };
+                        (GroovyObject) groovyClass.newInstance();
+                Object[] arg = {new StringReader(value)};
                 Object obj = groovyObject.invokeMethod(methodName, arg);
                 if (obj == null) {
                     throw new AxisFault(Messages.getMessage("groovyNoanswer"));
                 }
 
-                SOAPFactory fac = null;
-                if(inMessage.isSOAP11()){
+                SOAPFactory fac ;
+                if (inMessage.isSOAP11()) {
                     fac = OMAbstractFactory.getSOAP11Factory();
-                }else{
+                } else {
                     fac = OMAbstractFactory.getSOAP12Factory();
                 }
                 SOAPEnvelope envelope = fac.getDefaultEnvelope();
                 OMNamespace ns =
-                    fac.createOMNamespace("http://soapenc/", "res");
+                        fac.createOMNamespace("http://soapenc/", "res");
                 OMElement responseElement =
-                    fac.createOMElement(methodName + "Response", ns);
+                        fac.createOMElement(methodName + "Response", ns);
                 String outMessageString = obj.toString();
                 // System.out.println("outMessageString = " + outMessageString);
                 // responseElement.setText(outMessageString);
@@ -122,12 +122,12 @@
 
     private OMElement getpayLoad(String str) throws XMLStreamException {
         XMLStreamReader xmlReader =
-            StAXUtils.createXMLStreamReader(
-                new ByteArrayInputStream(str.getBytes()));
+                StAXUtils.createXMLStreamReader(
+                        new ByteArrayInputStream(str.getBytes()));
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
         StAXOMBuilder staxOMBuilder =
-            new StAXOMBuilder(fac, xmlReader);
+                new StAXOMBuilder(fac, xmlReader);
         return staxOMBuilder.getDocumentElement();
     }
 



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