You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/04/18 13:00:22 UTC

svn commit: r161755 - webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java

Author: deepal
Date: Mon Apr 18 04:00:21 2005
New Revision: 161755

URL: http://svn.apache.org/viewcvs?view=rev&rev=161755
Log:
added a method to creat an axisservice object directly

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.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=161754&r2=161755
==============================================================================
--- 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 04:00:21 2005
@@ -285,19 +285,19 @@
         engineconfig.addService(serviceMetaData);
         /*Parameter para = serviceMetaData.getParameter("OUTSERVICE");
         if (para != null) {
-            String value = (String) para.getValue();
-            if ("true".equals(value)) {
-                Class temp = serviceMetaData.getServiceClass();
-                try {
-                    Thread servie = (Thread) temp.newInstance();
-                    servie.start();
-                } catch (InstantiationException e) {
-                    throw new AxisFault(e.getMessage());
-                } catch (IllegalAccessException e) {
-                    throw new AxisFault(e.getMessage());
-                }
+        String value = (String) para.getValue();
+        if ("true".equals(value)) {
+        Class temp = serviceMetaData.getServiceClass();
+        try {
+        Thread servie = (Thread) temp.newInstance();
+        servie.start();
+        } catch (InstantiationException e) {
+        throw new AxisFault(e.getMessage());
+        } catch (IllegalAccessException e) {
+        throw new AxisFault(e.getMessage());
+        }
 
-            }
+        }
         }*/
     }
 
@@ -519,24 +519,57 @@
         return fileName;
     }
 
-   /* public AxisService deployService(ClassLoader classLoder, InputStream serviceStream, String servieName) throws DeploymentException {
-        AxisService service = null;
+    /* public AxisService deployService(ClassLoader classLoder, InputStream serviceStream, String servieName) throws DeploymentException {
+    AxisService service = null;
+    try {
+    currentFileItem = new HDFileItem(SERVICE, servieName);
+    currentFileItem.setClassLoader(classLoder);
+    service = new AxisService();
+    DeploymentParser schme = new DeploymentParser(serviceStream, this);
+    schme.parseServiceXML(service);
+    service = getRunnableService(service);
+    } catch (XMLStreamException e) {
+    throw  new DeploymentException(e.getMessage());
+    } catch (PhaseException e) {
+    throw  new DeploymentException(e.getMessage());
+    } catch (AxisFault axisFault) {
+    throw  new DeploymentException(axisFault.getMessage());
+    }
+    return service;
+    }
+*/
+
+    /**
+     * This method is used to fill a axisservice object using service.xml , first it should create
+     * 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 ServiceContext buildService(AxisService axisService , InputStream serviceInputStream, ClassLoader classLoader) throws DeploymentException {
+        ServiceContext serviceContext;
         try {
-            currentFileItem = new HDFileItem(SERVICE, servieName);
-            currentFileItem.setClassLoader(classLoder);
-            service = new AxisService();
-            DeploymentParser schme = new DeploymentParser(serviceStream, this);
-            schme.parseServiceXML(service);
-            service = getRunnableService(service);
+            DeploymentParser schme = new DeploymentParser(serviceInputStream, this);
+            schme.parseServiceXML(axisService);
+            axisService.setClassLoader(classLoader);
+            serviceContext = getRunnableService(axisService);
+            engineContext.addService(serviceContext);
+            engineconfig.addService(axisService);
+
         } catch (XMLStreamException e) {
-            throw  new DeploymentException(e.getMessage());
+            throw new DeploymentException("XMLStreamException" + e.getMessage());
+        } catch (DeploymentException e) {
+            throw new DeploymentException(e.getMessage()) ;
         } catch (PhaseException e) {
-            throw  new DeploymentException(e.getMessage());
+            throw new DeploymentException(e.getMessage());
         } catch (AxisFault axisFault) {
-            throw  new DeploymentException(axisFault.getMessage());
+            throw new DeploymentException(axisFault.getMessage());
         }
-        return service;
+        return  serviceContext;
     }
-*/
 
 }