Deepal,

How does the undeploy work? the "feature" itself is neither complete
nor does used. Am sorry i did not ask. But there was no emails on
axis-dev@ or any documentation either regarding this "feature". Please
take remove this unnecessary clutter.

thanks,
dims

On 6/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: deepal
Date: Tue Jun  5 02:05:17 2007
New Revision: 544426

URL: http://svn.apache.org/viewvc?view=rev&rev=544426
Log:
reverting Dims change on web resources
 (We should not remove the code just because it has zero usage , better to ask 
that in the list and do that . If we are going to do so we will remove our 
features without knowing )
- fixing the build break due to axis2.xml changes

Modified:
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisServiceGroup.java
    
webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=544426&r1=544425&r2=544426
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
 Tue Jun  5 02:05:17 2007
@@ -51,6 +51,14 @@
 public abstract class DeploymentEngine implements DeploymentConstants {
     private static final Log log = LogFactory.getLog(DeploymentEngine.class);

+    //to keep the web resource location if any
+    protected static String webLocationString = null;
+
+    public static void setWebLocationString(String webLocationString) {
+        DeploymentEngine.webLocationString = webLocationString;
+    }
+
+
     /**
      * Support for hot update is controlled by this flag
      */
@@ -426,6 +434,10 @@
                                        AxisConfiguration axisConfiguration) 
throws AxisFault {
         fillServiceGroup(serviceGroup, serviceList, serviceLocation, 
axisConfiguration);
         axisConfiguration.addServiceGroup(serviceGroup);
+        if (currentDeploymentFile != null) {
+           addAsWebResources(currentDeploymentFile.getFile(),
+                             serviceGroup.getServiceGroupName(), serviceGroup);
+       }
     }

     protected static void fillServiceGroup(AxisServiceGroup serviceGroup,
@@ -653,6 +665,55 @@
         return hotUpdate;
     }

+    private static void addAsWebResources(File in,
+                                          String serviceFileName,
+                                          AxisServiceGroup serviceGroup) {
+        try {
+            if (webLocationString == null) {
+                return;
+            }
+            if (in.isDirectory()) {
+                return;
+            }
+            File webLocation = new File(webLocationString);
+            File out = new File(webLocation, serviceFileName);
+            int BUFFER = 1024;
+            byte data[] = new byte[BUFFER];
+            FileInputStream fin = new FileInputStream(in);
+            ZipInputStream zin = new ZipInputStream(
+                    fin);
+            ZipEntry entry;
+            while ((entry = zin.getNextEntry()) != null) {
+                ZipEntry zip = new ZipEntry(entry);
+                if (zip.getName().toUpperCase().startsWith("WWW")) {
+                    String fileName = zip.getName();
+                    fileName = fileName.substring("WWW/".length(),
+                            fileName.length());
+                    if (zip.isDirectory()) {
+                        new File(out, fileName).mkdirs();
+                    } else {
+                        FileOutputStream tempOut = new FileOutputStream(new 
File(out, fileName));
+                        int count;
+                        while ((count = zin.read(data, 0, BUFFER)) != -1) {
+                            tempOut.write(data, 0, count);
+                        }
+                        tempOut.close();
+                        tempOut.flush();
+                    }
+                    serviceGroup.setFoundWebResources(true);
+                }
+            }
+            zin.close();
+            fin.close();
+        } catch (IOException e) {
+            log.info(e.getMessage());
+        }
+    }
+
+    public String getWebLocationString() {
+        return webLocationString;
+    }
+
     /**
      * To set the all the classLoader hierarchy this method can be used , the 
top most parent is
      * CCL then SCL(system Class Loader)

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java?view=diff&rev=544426&r1=544425&r2=544426
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
 Tue Jun  5 02:05:17 2007
@@ -160,6 +160,7 @@
             if (webpath != null && !"".equals(webpath)) {
                 log.debug("setting web location string: " + webpath);
                 File weblocation = new File(webpath);
+                setWebLocationString(weblocation.getAbsolutePath());
             } // if webpath not null



Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisServiceGroup.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisServiceGroup.java?view=diff&rev=544426&r1=544425&r2=544426
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisServiceGroup.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisServiceGroup.java
 Tue Jun  5 02:05:17 2007
@@ -30,6 +30,8 @@

 public class AxisServiceGroup extends AxisDescription {

+    //to check whether user has put WWW dir or not
+    private boolean foundWebResources;
     // to store module ref at deploy time parsing
     private ArrayList modulesList = new ArrayList();

@@ -256,4 +258,12 @@
         }
         return false;
     }
+
+        public boolean isFoundWebResources() {
+        return foundWebResources;
+    }
+
+    public void setFoundWebResources(boolean foundWebResources) {
+        this.foundWebResources = foundWebResources;
+     }
 }

Modified: 
webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java?view=diff&rev=544426&r1=544425&r2=544426
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/ModuleDisengagementTest.java
 Tue Jun  5 02:05:17 2007
@@ -63,7 +63,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         er.engageModule(module.getName());
@@ -88,7 +88,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         er.engageModule(module.getName());
@@ -122,7 +122,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         er.engageModule(module.getName());
@@ -147,7 +147,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         service.engageModule(module);
@@ -172,7 +172,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         service.engageModule(module);
@@ -197,7 +197,7 @@
         assertNotNull(service);
         AxisOperation operation = service.getOperation(opName);
         assertNotNull(operation);
-        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(0);
+        userPhase = (Phase) operation.getRemainingPhasesInFlow().get(1);
         assertNotNull(userPhase);
         assertEquals(0, userPhase.getHandlerCount());
         operation.engageModule(module);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to