Package org.jboss.osgi.metadata

Examples of org.jboss.osgi.metadata.OSGiMetaData


        }

        // Register module with the OSGi layer
        ModuleLoader moduleLoader = Module.getBootModuleLoader();
        Module module = moduleLoader.loadModule(identifier);
        OSGiMetaData metadata = getModuleMetadata(module);
        return bundleManager.registerModule(serviceTarget, module, metadata);
    }
View Full Code Here


            // Attempt to load the module from the modules hierarchy
            try {
                ModuleLoader moduleLoader = Module.getBootModuleLoader();
                Module module = moduleLoader.loadModule(moduleId);
                OSGiMetaData metadata = getModuleMetadata(module);
                return bundleManager.registerModule(serviceTarget, module, metadata);
            } catch (ModuleLoadException e) {
                ROOT_LOGGER.debugf("Cannot load module: %s", moduleId);
            }
        }
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();
        OSGiMetaData metadata = OSGiMetaDataAttachment.getOSGiMetaData(deploymentUnit);
        if (metadata != null)
            return;

        // Get the OSGi XService properties
        VirtualFile virtualFile = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
View Full Code Here

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {

        // Create the {@link ModuleRegisterService}
        final DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
        final Module module = depUnit.getAttachment(Attachments.MODULE);
        final OSGiMetaData metadata = OSGiMetaDataAttachment.getOSGiMetaData(depUnit);
        if (module != null && metadata != null) {
            ModuleRegisterService.addService(phaseContext, module, metadata);
        }
    }
View Full Code Here

    }

    @Override
    public void undeploy(final DeploymentUnit depUnit) {
        final Module module = depUnit.getAttachment(Attachments.MODULE);
        final OSGiMetaData metadata = OSGiMetaDataAttachment.getOSGiMetaData(depUnit);
        if (module != null && metadata != null) {
            ModuleRegisterService.removeService(depUnit);
        }
    }
View Full Code Here

            deployment.setAutoStart(true);
            OSGiDeploymentAttachment.attachDeployment(deploymentUnit, deployment);
        }

        // Check for attached OSGiMetaData
        OSGiMetaData metadata = OSGiMetaDataAttachment.getOSGiMetaData(deploymentUnit);
        if (deployment == null && metadata != null) {
            String symbolicName = metadata.getBundleSymbolicName();
            Version version = metadata.getBundleVersion();
            VirtualFile virtualFile = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
            deployment = DeploymentFactory.createDeployment(AbstractVFS.adapt(virtualFile), contextName, symbolicName, version);
            deployment.setAutoStart(true);
            deployment.addAttachment(OSGiMetaData.class, metadata);
            OSGiDeploymentAttachment.attachDeployment(deploymentUnit, deployment);
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();
        OSGiMetaData metadata = OSGiMetaDataAttachment.getOSGiMetaData(deploymentUnit);
        if (metadata != null)
            return;

        // Get the OSGi XService properties
        String resName = "META-INF/jbosgi-xservice.properties";
View Full Code Here

                    serviceName = bundleManager.installBundle(serviceTarget, dep);
                }
                else {
                    ModuleLoader moduleLoader = Module.getBootModuleLoader();
                    Module module = moduleLoader.loadModule(identifier);
                    OSGiMetaData metadata = getModuleMetadata(module);
                    serviceName = bundleManager.installBundle(serviceTarget, module, metadata);
                }
                pendingServices.put(serviceName, moduleMetaData);
            }
View Full Code Here

            // Attempt to load the module from the modules hirarchy
            try {
                ModuleLoader moduleLoader = Module.getBootModuleLoader();
                Module module = moduleLoader.loadModule(moduleId);
                OSGiMetaData metadata = getModuleMetadata(module);
                return bundleManager.registerModule(serviceTarget, module, metadata);
            } catch (ModuleLoadException e) {
                ROOT_LOGGER.debugf("Cannot load module: %s", moduleId);
            }
        }
View Full Code Here

    public void autostartBundle(@Observes AfterDeploy event) throws Exception {
        if (event.getDeployableContainer() instanceof CommonDeployableContainer) {
            CommonDeployableContainer<?> container = (CommonDeployableContainer<?>) event.getDeployableContainer();
            if (container.isAutostartBundle()) {
                Manifest manifest = new Manifest(event.getDeployment().getArchive().get("/META-INF/MANIFEST.MF").getAsset().openStream());
                OSGiMetaData metadata = OSGiMetaDataBuilder.load(manifest);
                container.startBundle(metadata.getBundleSymbolicName(), metadata.getBundleVersion().toString());
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.osgi.metadata.OSGiMetaData

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.