/** Method invoked from the scheduler to start the listener. */ public void startListener() { checkServices(); // update(); }
/** Finds a list of services in the folder and adds to wsInfoList. */ public void checkServices() { findServicesInDirectory(deploymentEngine.getServicesDir()); loadOtherDirectories(); update(); }
public void init2(boolean isClasspath) { if (!isClasspath) { init(); } loadClassPathModules(); }
public void updateRemote() throws Exception { findServicesInDirectory(deploymentEngine.getServicesDir()); update(); }
public void loadServicesFromUrl(URL repoURL) { try { String path = servicesPath == null ? DeploymentConstants.SERVICE_PATH : servicesPath; if (!path.endsWith("/")) { path += "/"; } String repoPath = repoURL.getPath(); if (!repoPath.endsWith("/")) { repoPath += "/"; repoURL = new URL(repoURL.getProtocol() + "://" + repoPath); } URL servicesDir = new URL(repoURL, path); URL filelisturl = new URL(servicesDir, "services.list"); ArrayList<String> files = getFileList(filelisturl); repoListener = new RepositoryListener(this, false); for (Object file : files) { String fileUrl = (String) file; if (fileUrl.endsWith(".aar")) { URL servicesURL = new URL(servicesDir, fileUrl); repoListener.addURLToDeploy(servicesURL, getServiceDeployer(), WSInfo.TYPE_SERVICE); } } repoListener.update(); //Loading other type of services such as custom deployers loadCustomServices(repoURL); } catch (MalformedURLException e) { log.error(e.getMessage(), e); } }
for (int i = 0; i < files.length; i++) { File file = files[i]; if (isSourceControlDir(file)) { continue; Deployer deployer = deploymentEngine.getDeployer(dir, extension); deployer.setDirectory(dir); addFileToDeploy(file, deployer, WSInfo.TYPE_CUSTOM); } else if (extension != null) { if (!file.isDirectory() && extension Deployer deployer = deploymentEngine.getDeployer(dir, extension); deployer.setDirectory(dir); addFileToDeploy(file, deployer, WSInfo.TYPE_CUSTOM); } else if (file.isDirectory() && !file.getName().startsWith(".") && !(dir.equals(directory.getName()) && "lib".equalsIgnoreCase(file.getName()))) { findFileForGivenDirectory(file, extension, dir);
if (isSourceControlDir(file)) { continue; addFileToDeploy(file, deploymentEngine.getServiceDeployer(), WSInfo.TYPE_SERVICE); } else { findServicesInDirectory(file); addFileToDeploy(file, deploymentEngine.getServiceDeployer(), WSInfo.TYPE_SERVICE);
/** Finds a list of modules in the folder and adds to wsInfoList. */ public void checkModules() { File root = deploymentEngine.getModulesDir(); File[] files = null; if(root != null){ files = root.listFiles(); } if (files != null) { for (int i = 0; i < files.length; i++) { File file = files[i]; if (isSourceControlDir(file)) { continue; } if (!file.isDirectory()) { if (DeploymentFileData.isModuleArchiveFile(file.getName())) { addFileToDeploy(file, deploymentEngine.getModuleDeployer(), WSInfo.TYPE_MODULE); } } else { if (!"lib".equalsIgnoreCase(file.getName())) { addFileToDeploy(file, deploymentEngine.getModuleDeployer(), WSInfo.TYPE_MODULE); } } } } }
addFileToDeploy(f, deployer, WSInfo.TYPE_MODULE); String classPath = getLocation(); if (DeploymentFileData.isModuleArchiveFile(file.getName())) { addFileToDeploy(file, deployer, WSInfo.TYPE_MODULE); addFileToDeploy(file, deployer, WSInfo.TYPE_MODULE);
public void loadRepository(String repoDir) throws DeploymentException { File axisRepo = new File(repoDir); if (!axisRepo.exists()) { throw new DeploymentException( Messages.getMessage("cannotfindrepo", repoDir)); } setDeploymentFeatures(); prepareRepository(repoDir); // setting the CLs setClassLoaders(repoDir); repoListener = new RepositoryListener(this, false); org.apache.axis2.util.Utils .calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig); try { try { axisConfig.setRepository(axisRepo.toURI().toURL()); } catch (MalformedURLException e) { log.info(e.getMessage()); } axisConfig.validateSystemPredefinedPhases(); } catch (AxisFault axisFault) { throw new DeploymentException(axisFault); } }
/** * First initializes the WSInfoList, then calls checkModule to load all the modules and calls * update() to update the Deployment engine and engine registry. */ public void init() { wsInfoList.init(); checkModules(); deploymentEngine.doDeploy(); }
private void loadOtherDirectories() { for (Map.Entry<String, Map<String, Deployer>> entry : deploymentEngine.getDeployers().entrySet()) { String directory = entry.getKey(); Map<String, Deployer> extensionMap = entry.getValue(); for (String extension : extensionMap.keySet()) { File dirToSearch = new File(directory); if (!dirToSearch.isAbsolute()) { dirToSearch = new File(deploymentEngine.getRepositoryDir(), directory); } findFileForGivenDirectory(dirToSearch, extension, directory); } } }
/** * 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 loadServicesFromUrl(URL repoURL) { try { String path = servicesPath == null ? DeploymentConstants.SERVICE_PATH : servicesPath; if (!path.endsWith("/")) { path += "/"; } String repoPath = repoURL.getPath(); if (!repoPath.endsWith("/")) { repoPath += "/"; repoURL = new URL(repoURL.getProtocol() + "://" + repoPath); } URL servicesDir = new URL(repoURL, path); URL filelisturl = new URL(servicesDir, "services.list"); ArrayList<String> files = getFileList(filelisturl); repoListener = new RepositoryListener(this, false); for (Object file : files) { String fileUrl = (String) file; if (fileUrl.endsWith(".aar")) { URL servicesURL = new URL(servicesDir, fileUrl); repoListener.addURLToDeploy(servicesURL, getServiceDeployer(), WSInfo.TYPE_SERVICE); } } repoListener.update(); //Loading other type of services such as custom deployers loadCustomServices(repoURL); } catch (MalformedURLException e) { log.error(e.getMessage(), e); } }
for (int i = 0; i < files.length; i++) { File file = files[i]; if (isSourceControlDir(file)) { continue; Deployer deployer = deploymentEngine.getDeployer(dir, extension); deployer.setDirectory(dir); addFileToDeploy(file, deployer, WSInfo.TYPE_CUSTOM); } else if (extension != null) { if (!file.isDirectory() && extension Deployer deployer = deploymentEngine.getDeployer(dir, extension); deployer.setDirectory(dir); addFileToDeploy(file, deployer, WSInfo.TYPE_CUSTOM); } else if (file.isDirectory() && !file.getName().startsWith(".") && !(dir.equals(directory.getName()) && "lib".equalsIgnoreCase(file.getName()))) { findFileForGivenDirectory(file, extension, dir);
if (isSourceControlDir(file)) { continue; addFileToDeploy(file, deploymentEngine.getServiceDeployer(), WSInfo.TYPE_SERVICE); } else { findServicesInDirectory(file); addFileToDeploy(file, deploymentEngine.getServiceDeployer(), WSInfo.TYPE_SERVICE);
public void updateRemote() throws Exception { findServicesInDirectory(deploymentEngine.getServicesDir()); update(); }
/** Finds a list of modules in the folder and adds to wsInfoList. */ public void checkModules() { File root = deploymentEngine.getModulesDir(); File[] files = null; if(root != null){ files = root.listFiles(); } if (files != null) { for (int i = 0; i < files.length; i++) { File file = files[i]; if (isSourceControlDir(file)) { continue; } if (!file.isDirectory()) { if (DeploymentFileData.isModuleArchiveFile(file.getName())) { addFileToDeploy(file, deploymentEngine.getModuleDeployer(), WSInfo.TYPE_MODULE); } } else { if (!"lib".equalsIgnoreCase(file.getName())) { addFileToDeploy(file, deploymentEngine.getModuleDeployer(), WSInfo.TYPE_MODULE); } } } } }
addFileToDeploy(f, deployer, WSInfo.TYPE_MODULE); String classPath = getLocation(); if (DeploymentFileData.isModuleArchiveFile(file.getName())) { addFileToDeploy(file, deployer, WSInfo.TYPE_MODULE); addFileToDeploy(file, deployer, WSInfo.TYPE_MODULE);
public void loadRepository(String repoDir) throws DeploymentException { File axisRepo = new File(repoDir); if (!axisRepo.exists()) { throw new DeploymentException( Messages.getMessage("cannotfindrepo", repoDir)); } setDeploymentFeatures(); prepareRepository(repoDir); // setting the CLs setClassLoaders(repoDir); repoListener = new RepositoryListener(this, false); org.apache.axis2.util.Utils .calculateDefaultModuleVersion(axisConfig.getModules(), axisConfig); try { try { axisConfig.setRepository(axisRepo.toURI().toURL()); } catch (MalformedURLException e) { log.info(e.getMessage()); } axisConfig.validateSystemPredefinedPhases(); } catch (AxisFault axisFault) { throw new DeploymentException(axisFault); } }