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/02/17 04:38:05 UTC
svn commit: r154116 - in
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment:
DeploymentEngine.java listener/RepositoryListenerImpl.java
repository/utill/UnZipJAR.java repository/utill/WSInfo.java
repository/utill/WSInfoList.java
Author: deepal
Date: Wed Feb 16 19:38:03 2005
New Revision: 154116
URL: http://svn.apache.org/viewcvs?view=rev&rev=154116
Log:
Hot deployment and hot update
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfo.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfoList.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java?view=diff&r1=154115&r2=154116
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java Wed Feb 16 19:38:03 2005
@@ -52,7 +52,7 @@
*/
public class DeploymentEngine implements DeploymentConstants {
private Log log = LogFactory.getLog(getClass());
- private final Scheduler scheduler = new Scheduler();
+ private static Scheduler scheduler;
private boolean hotdeployment = true; //to do hot deployment or not
private boolean hotupdate = true; // to do hot update or not
@@ -210,7 +210,6 @@
hotupdate =false;
}
-
}
/**
@@ -241,6 +240,7 @@
* inorder to perform Hot deployment and so on..
*/
private void startSearch(DeploymentEngine engine) {
+ scheduler =new Scheduler();
scheduler.schedule(new SchedulerTask(engine, folderName), new DeploymentIterator());
}
@@ -412,6 +412,7 @@
unZipJAR.unzipService(currentFileItem.getAbsolutePath(), this, service);
addnewService(service);
log.info("Deployement WS Name " + currentFileItem.getName());
+ System.out.println("ok");
} catch (DeploymentException de) {
throw new RuntimeException(de);
} catch (AxisFault axisFault) {
@@ -450,9 +451,11 @@
if (wsToUnDeploy.size() > 0) {
for (int i = 0; i < wsToUnDeploy.size(); i++) {
WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
- serviceName = getAxisServiceName(wsInfo.getFilename());
- engineRegistry.removeService(new QName(serviceName));
- log.info("UnDeployement WS Name " + wsInfo.getFilename());
+ if(wsInfo.getType()==SERVICE) {
+ serviceName = getAxisServiceName(wsInfo.getFilename());
+ engineRegistry.removeService(new QName(serviceName));
+ log.info("UnDeployement WS Name " + wsInfo.getFilename());
+ }
}
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/listener/RepositoryListenerImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/listener/RepositoryListenerImpl.java?view=diff&r1=154115&r2=154116
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/listener/RepositoryListenerImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/listener/RepositoryListenerImpl.java Wed Feb 16 19:38:03 2005
@@ -114,7 +114,7 @@
// adding the root folder to the vector
currentJars.add(root);
- while (currentJars.size() > 0) { // loop until empty
+ while (currentJars.size() > 0) { // loop until empty
File dir = (File) currentJars.get(0); // get first dir
currentJars.remove(0); // remove it
files = dir.list(); // get list of files
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java?view=diff&r1=154115&r2=154116
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java Wed Feb 16 19:38:03 2005
@@ -53,7 +53,6 @@
break;
}
}
- // zin.closeEntry();
zin.close();
if (!foundServiceXML) {
throw new DeploymentException("service.xml not found");
@@ -67,7 +66,7 @@
// get attribute values
boolean foundmoduleXML = false;
String strArchive = filename;
- ZipInputStream zin;
+ ZipInputStream zin = null;
try {
zin = new ZipInputStream(new FileInputStream(strArchive));
ZipEntry entry;
@@ -79,7 +78,7 @@
break;
}
}
- // zin.closeEntry();
+ // zin.closeEntry();
zin.close();
if (!foundmoduleXML) {
throw new DeploymentException("module.xml not found");
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfo.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfo.java?view=diff&r1=154115&r2=154116
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfo.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfo.java Wed Feb 16 19:38:03 2005
@@ -51,4 +51,8 @@
public void setLastmodifieddate(long lastmodifieddate) {
this.lastmodifieddate = lastmodifieddate;
}
+
+ public int getType() {
+ return type;
+ }
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfoList.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfoList.java?view=diff&r1=154115&r2=154116
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfoList.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/WSInfoList.java Wed Feb 16 19:38:03 2005
@@ -75,14 +75,16 @@
HDFileItem hdFileItem = new HDFileItem(file, SERVICE);
deplorer.addtowsToDeploy(hdFileItem);//to inform that new web service is deployed
} else {
- WSInfo tempWSInfo = getFileItem(file.getName());
- if (isModified(file, tempWSInfo)) { // caheck whether file is updated
- tempWSInfo.setLastmodifieddate(file.lastModified());
- WSInfo wsInfo = new WSInfo(tempWSInfo.getFilename(), tempWSInfo.getLastmodifieddate(), SERVICE);
- deplorer.addtowstoUnDeploy(wsInfo); // add entry to undeploy list
- HDFileItem hdFileItem = new HDFileItem(file, SERVICE);
- deplorer.addtowsToDeploy(hdFileItem); // add entry to deploylist
+ if(deplorer.isHotupdate()) {
+ WSInfo tempWSInfo = getFileItem(file.getName());
+ if (isModified(file, tempWSInfo)) { // caheck whether file is updated
+ tempWSInfo.setLastmodifieddate(file.lastModified());
+ WSInfo wsInfo = new WSInfo(tempWSInfo.getFilename(), tempWSInfo.getLastmodifieddate(), SERVICE);
+ deplorer.addtowstoUnDeploy(wsInfo); // add entry to undeploy list
+ HDFileItem hdFileItem = new HDFileItem(file, SERVICE);
+ deplorer.addtowsToDeploy(hdFileItem); // add entry to deploylist
+ }
}
}
break;
@@ -95,14 +97,16 @@
HDFileItem hdFileItem = new HDFileItem(file, MODULE);
deplorer.addtowsToDeploy(hdFileItem);//to inform that new web service is deployed
} else {
- WSInfo tempWSInfo = getFileItem(file.getName());
- if (isModified(file, tempWSInfo)) {
- tempWSInfo.setLastmodifieddate(file.lastModified());
- WSInfo wsInfo = new WSInfo(tempWSInfo.getFilename(), tempWSInfo.getLastmodifieddate(), MODULE);
- deplorer.addtowstoUnDeploy(wsInfo); // add entry to undeploy list
- HDFileItem hdFileItem = new HDFileItem(file, MODULE);
- deplorer.addtowsToDeploy(hdFileItem); // add entry to deploylist
+ if(deplorer.isHotupdate()) {
+ WSInfo tempWSInfo = getFileItem(file.getName());
+ if (isModified(file, tempWSInfo)) {
+ tempWSInfo.setLastmodifieddate(file.lastModified());
+ WSInfo wsInfo = new WSInfo(tempWSInfo.getFilename(), tempWSInfo.getLastmodifieddate(), MODULE);
+ deplorer.addtowstoUnDeploy(wsInfo); // add entry to undeploy list
+ HDFileItem hdFileItem = new HDFileItem(file, MODULE);
+ deplorer.addtowsToDeploy(hdFileItem); // add entry to deploylist
+ }
}
}
break;
@@ -201,8 +205,8 @@
*
*/
public void update() {
+ checkForUndeploye();
if(deplorer.isHotupdate()) {
- checkForUndeploye();
deplorer.doUnDeploye();
}
deplorer.doDeploy();