Package org.apache.aries.application

Examples of org.apache.aries.application.DeploymentMetadata


    protected ApplicationState getApplicationState() {
        return applicationState;
    }
   
    private DeploymentMetadata getDeploymentMetadata(AriesApplicationResolver resolver, DeploymentMetadataFactory deploymentFactory) throws ResolverException {
        DeploymentMetadata meta = application.getDeploymentMetadata();
        if (meta == null) {
            // try to resolve the application
            LOG.debug("Resolving {} application.", application.getApplicationMetadata().getApplicationScope());
            Set<BundleInfo> requiredBundles = resolver.resolve(application);
            meta = deploymentFactory.createDeploymentMetadata(application, requiredBundles);
View Full Code Here


                             
        applicationBundles = new HashSet<Bundle>();
        try {
            resolver = getService(resolverRef, AriesApplicationResolver.class);
           
            DeploymentMetadata meta = getDeploymentMetadata(resolver, deploymentFactory);
           
            List<DeploymentContent> deploymentContentsBundles = meta.getApplicationDeploymentContents();
            List<DeploymentContent> provisionBundles = meta.getApplicationProvisionBundles();
           
            List<DeploymentContent> bundlesToInstall = new ArrayList<DeploymentContent>();
            bundlesToInstall.addAll(deploymentContentsBundles);
            bundlesToInstall.addAll(provisionBundles);
           
View Full Code Here

        }
       
        ManifestDefaultsInjector.updateManifest(applicationMF, ebaFile.getName(), ebaFile);
        ApplicationMetadata applicationMetadata = getApplicationMetadataFactory().createApplicationMetadata(applicationMF);
       
        DeploymentMetadata deploymentMetadata = readDeploymentManifest(ebaJarFile);
       
        return new GeronimoApplication(applicationMetadata,  deploymentMetadata, bundleInfos);
    }
View Full Code Here

            applicationMetadata = getApplicationMetadataFactory().parseApplicationMetadata(applicationMFStream);
        } finally {
            IOUtils.close(applicationMFStream);
        }
       
        DeploymentMetadata deploymentMetadata = null;
        URL deploymentMF = bundle.getEntry(AppConstants.DEPLOYMENT_MF);
        if (deploymentMF != null) {
            InputStream deploymentMFStream = null;
            try {
                deploymentMFStream = deploymentMF.openStream();
View Full Code Here

        }
        return manifest;
    }
   
    private DeploymentMetadata readDeploymentManifest(JarFile ebaJarFile) throws IOException, ManagementException {
        DeploymentMetadata deploymentMetadata = null;
        ZipEntry entry = ebaJarFile.getEntry(AppConstants.DEPLOYMENT_MF);
        if (entry != null) {
            InputStream deploymentMFStream = null;
            try {
                deploymentMFStream = ebaJarFile.getInputStream(entry);
View Full Code Here

    protected String getApplicationName() {
        return application.getApplicationMetadata().getApplicationScope();
    }
   
    private DeploymentMetadata getDeploymentMetadata(AriesApplicationResolver resolver, DeploymentMetadataFactory deploymentFactory) throws ResolverException {
        DeploymentMetadata meta = application.getDeploymentMetadata();
        if (meta == null) {
            // try to resolve the application
            LOG.debug("Resolving {} application.", getApplicationName());
            Set<BundleInfo> requiredBundles = resolver.resolve(application);
            meta = deploymentFactory.createDeploymentMetadata(application, requiredBundles);
View Full Code Here

                             
        applicationBundles = new LinkedHashSet<Bundle>();
        try {
            resolver = getService(resolverRef, AriesApplicationResolver.class);
           
            DeploymentMetadata meta = getDeploymentMetadata(resolver, deploymentFactory);
           
            List<DeploymentContent> deploymentContentsBundles = meta.getApplicationDeploymentContents();
            List<DeploymentContent> provisionBundles = meta.getApplicationProvisionBundles();
           
            List<DeploymentContent> bundlesToInstall = new ArrayList<DeploymentContent>();
            bundlesToInstall.addAll(deploymentContentsBundles);
            bundlesToInstall.addAll(provisionBundles);
           
View Full Code Here

   
    protected void storeApplication(AriesApplication app, File directory, boolean unpack) throws IOException {
        ApplicationMetadata appMetadata = app.getApplicationMetadata();
        appMetadata.store(new File(directory, AppConstants.APPLICATION_MF));

        DeploymentMetadata deploymentMetadata = app.getDeploymentMetadata();
        if (deploymentMetadata != null) {
            deploymentMetadata.store(new File(directory, AppConstants.DEPLOYMENT_MF));
        }
       
        for (BundleInfo bi : app.getBundleInfo()) {
          // bi.getLocation() will return a URL to the source bundle. It may be of the form
          // file:/path/to/my/file.jar, or
View Full Code Here

   
    private void storeInPlaceApplication(AriesApplication app, File inPlaceLocation) throws IOException {
        // save DEPLOYMENT.MF if it was not there before and application is resolved
        File deploymentMF = new File(inPlaceLocation, AppConstants.DEPLOYMENT_MF);
        if (!deploymentMF.exists()) {
            DeploymentMetadata deploymentMetadata = app.getDeploymentMetadata();
            if (deploymentMetadata != null) {
                deploymentMetadata.store(deploymentMF);
            }
        }
    }
View Full Code Here

    AriesApplication app = manager.createApplication(FileSystem.getFSRoot(new File("demo.eba")));
    //installing requires a valid url for the bundle in repository.xml.
   
    app = manager.resolve(app);
   
    DeploymentMetadata depMeta = app.getDeploymentMetadata();
   
    List<DeploymentContent> provision = depMeta.getApplicationProvisionBundles();
    Collection<DeploymentContent> useBundles = depMeta.getDeployedUseBundle();
    Collection<Content> importPackages = depMeta.getImportPackage();
    assertEquals(provision.toString(), 2, provision.size());
    assertEquals(useBundles.toString(), 1, useBundles.size());
    assertEquals(importPackages.toString(), 4, importPackages.size());
   
    List<String> bundleSymbolicNames = new ArrayList<String>();
View Full Code Here

TOP

Related Classes of org.apache.aries.application.DeploymentMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.