Package org.jboss.osgi.spi.util

Examples of org.jboss.osgi.spi.util.BundleInfo


      URL artifactURL = ArquillianHelper.getArtifactURL(groupId, artifactId, version);
      if (artifactURL == null)
         return null;

      // Verify that the artifact is a bundle
      BundleInfo info = BundleInfo.createBundleInfo(artifactURL);
      Bundle bundle = getBundle(info.getSymbolicName(), info.getVersion());
      if (bundle != null)
         return bundle;

      bundle = context.installBundle(artifactURL.toExternalForm());
      return bundle;
View Full Code Here


    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {

        // Check if we already have an OSGi deployment
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        BundleInfo info = BundleInfoAttachment.getBundleInfo(deploymentUnit);
        if (info != null)
            return;

        // Get the manifest from the deployment's virtual file
        VirtualFile virtualFile = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
View Full Code Here

        String location = holderDep != null ? holderDep.getLocation() : contextName;
        boolean autoStart = holderDep != null ? holderDep.isAutoStart() : true;

        // Check for attached BundleInfo
        BundleInfo info = BundleInfoAttachment.getBundleInfo(deploymentUnit);
        if (deployment == null && info != null) {
            deployment = DeploymentFactory.createDeployment(info);
            deployment.addAttachment(BundleInfo.class, info);
            OSGiDeploymentAttachment.attachDeployment(deploymentUnit, deployment);
        }
View Full Code Here

        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final String contextName = deploymentUnit.getName();
        final ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();

        // Check if we already have a BundleInfo
        BundleInfo info = BundleInfoAttachment.getBundleInfo(deploymentUnit);
        ServiceController<Deployment> deploymentController = DeploymentHolderService.getDeployment(serviceRegistry, contextName);
        if (info != null || deploymentController != null)
            return;

        // Get the manifest from the deployment's virtual file
View Full Code Here

                ServiceName serviceName;
                ModuleIdentifier identifier = moduleMetaData.getIdentifier();
                File bundleFile = getRepositoryEntry(bundlesDir, identifier);
                if (bundleFile != null) {
                    URL url = bundleFile.toURI().toURL();
                    BundleInfo info = BundleInfo.createBundleInfo(url);
                    Deployment dep = DeploymentFactory.createDeployment(info);
                    Integer startLevel = moduleMetaData.getStartLevel();
                    if (startLevel != null)
                        dep.setStartLevel(startLevel.intValue());
                    serviceName = bundleManager.installBundle(serviceTarget, dep);
View Full Code Here

      }
   }

   private BundleHandle installBundle(VirtualFile virtualFile) throws BundleException, IOException
   {
      BundleInfo info = BundleInfo.createBundleInfo(virtualFile);
      String streamURL = info.getRoot().getStreamURL().toExternalForm();
      FrameworkMBean frameworkMBean = jmxSupport.getFrameworkMBean();
      long bundleId = frameworkMBean.installBundleFromURL(info.getLocation(), streamURL);
      return new BundleHandle(bundleId, info.getSymbolicName());
   }
View Full Code Here

        ZipExporter exporter = archive.as(ZipExporter.class);
        return AbstractVFS.toVirtualFile(archive.getName(), exporter.exportAsInputStream());
    }

    private BundleHandle installBundle(VirtualFile virtualFile) throws BundleException, IOException {
        BundleInfo info = BundleInfo.createBundleInfo(virtualFile);
        String streamURL = info.getRoot().getStreamURL().toExternalForm();
        FrameworkMBean frameworkMBean = jmxSupport.getFrameworkMBean();
        long bundleId = frameworkMBean.installBundleFromURL(info.getLocation(), streamURL);
        return new BundleHandle(bundleId, info.getSymbolicName());
    }
View Full Code Here

      URL artifactURL = RepositoryArchiveLocator.getArtifactURL(groupId, artifactId, version);
      if (artifactURL == null)
         return null;

      // Verify that the artifact is a bundle
      BundleInfo info = BundleInfo.createBundleInfo(artifactURL);
      Bundle bundle = getBundle(info.getSymbolicName(), info.getVersion());
      if (bundle != null)
         return bundle;

      bundle = context.installBundle(artifactURL.toExternalForm());
      return bundle;
View Full Code Here

        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final String contextName = deploymentUnit.getName();
        final ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();

        // Check if we already have a BundleInfo
        BundleInfo info = BundleInfoAttachment.getBundleInfo(deploymentUnit);
        ServiceController<Deployment> deploymentController = DeploymentHolderService.getDeployment(serviceRegistry, contextName);
        if (info != null || deploymentController != null)
            return;

        // Get the manifest from the deployment's virtual file
View Full Code Here

                controller.setMode(Mode.REMOVE);
            }
        }

        // Check for attached BundleInfo
        BundleInfo info = BundleInfoAttachment.getBundleInfo(depUnit);
        if (deployment == null && info != null) {
            deployment = DeploymentFactory.createDeployment(info);
            deployment.addAttachment(BundleInfo.class, info);
            deployment.setAutoStart(true);
        }
View Full Code Here

TOP

Related Classes of org.jboss.osgi.spi.util.BundleInfo

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.