/** * Checks if a file has been modified by comparing the last update date of * both files and WSInfo. If they are different, the file is assumed to have * been modified. * * @param file * @param wsInfo */ private boolean isModified(File file, WSInfo wsInfo) { long currentTimeStamp = wsInfo.getLastModifiedDate(); setLastModifiedDate(file, wsInfo); return (currentTimeStamp != wsInfo.getLastModifiedDate()); }
/** Updates WSInfoList object. */ public void update() { wsInfoList.update(); }
public void addURLToDeploy(URL url, Deployer deployer, int type) { wsInfoList.addWSInfoItem(url, deployer, type); } }
public synchronized void addWSInfoItem(URL url, Deployer deployer, int type) { // There is no way to set hot-update. // Here file.getAbsolutePath() = info.getFileName() WSInfo info = (WSInfo) currentJars.get(url.getPath()); if (info != null) { if (deploymentEngine.isHotUpdate()) { WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer, type); deploymentEngine.addWSToUndeploy(wsInfo); // add entry to undeploy list DeploymentFileData deploymentFileData = new DeploymentFileData(url, deployer, null); deploymentEngine.addWSToDeploy(deploymentFileData); // add entry to deploylist } } else { info = getFileItem(url, deployer, type); } jarList.add(info.getFileName()); }
public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException { deploymentFileDataMap.put(deploymentFileData.getAbsolutePath(), deploymentFileData); }
/** * Gets the WSInfo object related to a file if it exists, null otherwise. * */ private WSInfo getFileItem(URL url, Deployer deployer, int type) { WSInfo info = (WSInfo) currentJars.get(url.getPath()); if (info == null) { info = new WSInfo(url.getPath(), 0, deployer, type); currentJars.put(url.getPath(), info); DeploymentFileData fileData = new DeploymentFileData(url, deployer, null); deploymentEngine.addWSToDeploy(fileData); } return info; }
/** * Obtains the newest (as compared with timestamp stored in wsInfo) * timestamp and stores it in WSInfo. */ private void setLastModifiedDate(File file, WSInfo wsInfo) { if (file.isDirectory()) { File files [] = file.listFiles(); for (int i = 0; i < files.length; i++) { File fileItem = files[i]; if (fileItem.isDirectory()) { setLastModifiedDate(fileItem, wsInfo); } else if(wsInfo.getLastModifiedDate() < fileItem.lastModified()) { wsInfo.setLastModifiedDate(fileItem.lastModified()); } } } else if(wsInfo.getLastModifiedDate() < file.lastModified()) { wsInfo.setLastModifiedDate(file.lastModified()); } } }
/** * */ public void update() { synchronized (deploymentEngine) { checkForUndeployedServices(); deploymentEngine.unDeploy(); deploymentEngine.doDeploy(); } }
/** * This constructor takes two arguments, a folder name and a reference to Deployment Engine * First, it initializes the system, by loading all the modules in the /modules directory and * then creates a WSInfoList to store information about available modules and services. * * @param deploymentEngine reference to engine registry for updates * @param isClasspath true if this RepositoryListener should scan the classpath for * Modules */ public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) { this.deploymentEngine = deploymentEngine; wsInfoList = new WSInfoList(deploymentEngine); init2(isClasspath); }
public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException { deploymentFileDataMap.put(deploymentFileData.getAbsolutePath(), deploymentFileData); }
/** * Gets the WSInfo object related to a file if it exists, null otherwise. * */ private WSInfo getFileItem(URL url, Deployer deployer, int type) { WSInfo info = (WSInfo) currentJars.get(url.getPath()); if (info == null) { info = new WSInfo(url.getPath(), 0, deployer, type); currentJars.put(url.getPath(), info); DeploymentFileData fileData = new DeploymentFileData(url, deployer, null); deploymentEngine.addWSToDeploy(fileData); } return info; }
/** * Obtains the newest (as compared with timestamp stored in wsInfo) * timestamp and stores it in WSInfo. */ private void setLastModifiedDate(File file, WSInfo wsInfo) { if (file.isDirectory()) { File files [] = file.listFiles(); for (int i = 0; i < files.length; i++) { File fileItem = files[i]; if (fileItem.isDirectory()) { setLastModifiedDate(fileItem, wsInfo); } else if(wsInfo.getLastModifiedDate() < fileItem.lastModified()) { wsInfo.setLastModifiedDate(fileItem.lastModified()); } } } else if(wsInfo.getLastModifiedDate() < file.lastModified()) { wsInfo.setLastModifiedDate(file.lastModified()); } } }
/** * Checks if a file has been modified by comparing the last update date of * both files and WSInfo. If they are different, the file is assumed to have * been modified. * * @param file * @param wsInfo */ private boolean isModified(File file, WSInfo wsInfo) { long currentTimeStamp = wsInfo.getLastModifiedDate(); setLastModifiedDate(file, wsInfo); return (currentTimeStamp != wsInfo.getLastModifiedDate()); }
public void addFileToDeploy(File file, Deployer deployer, int type) { wsInfoList.addWSInfoItem(file, deployer, type); }
/** Updates WSInfoList object. */ public void update() { wsInfoList.update(); }
/** * */ public void update() { synchronized (deploymentEngine) { checkForUndeployedServices(); deploymentEngine.unDeploy(); deploymentEngine.doDeploy(); } }
/** * This constructor takes two arguments, a folder name and a reference to Deployment Engine * First, it initializes the system, by loading all the modules in the /modules directory and * then creates a WSInfoList to store information about available modules and services. * * @param deploymentEngine reference to engine registry for updates * @param isClasspath true if this RepositoryListener should scan the classpath for * Modules */ public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) { this.deploymentEngine = deploymentEngine; wsInfoList = new WSInfoList(deploymentEngine); init2(isClasspath); }
/** * Gets the WSInfo object related to a file if it exists, null otherwise. * */ private WSInfo getFileItem(File file , Deployer deployer , int type) { String fileName = file.getName(); WSInfo info = (WSInfo) currentJars.get(fileName); if(info==null){ info = new WSInfo(file.getAbsolutePath(), file.lastModified(), deployer ,type); currentJars.put(file.getAbsolutePath(), info); DeploymentFileData fileData = new DeploymentFileData(file, deployer); deploymentEngine.addWSToDeploy(fileData); } return info; }
public void addURLToDeploy(URL url, Deployer deployer, int type) { wsInfoList.addWSInfoItem(url, deployer, type); } }
public void addFileToDeploy(File file, Deployer deployer, int type) { wsInfoList.addWSInfoItem(file, deployer, type); }