Examples of XBundleRevision


Examples of org.jboss.osgi.resolver.XBundleRevision

        DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
        ContextActivator activator = depUnit.getAttachment(ContextActivator.ATTACHMENT_KEY);
        XBundle bundle = depUnit.getAttachment(OSGiConstants.BUNDLE_KEY);
        if (activator != null && bundle != null) {
            // Add the {@link ContextActivator} to the {@link XBundleRevision}
            XBundleRevision brev = bundle.getBundleRevision();
            brev.addAttachment(ContextActivator.class, activator);

            // Start the context when the bundle will get started automatically
            Deployment deployment = bundle.adapt(Deployment.class);
            if (deployment.isAutoStart()) {
                activator.startAsync();
View Full Code Here

Examples of org.jboss.osgi.resolver.XBundleRevision

    }

    @Override
    public void invoke(int state, InvocationContext context) {
        XBundle bundle = (XBundle) context.getBundle();
        XBundleRevision brev = bundle.getBundleRevision();
        ContextActivator activator = brev.getAttachment(ContextActivator.class);
        if (activator != null) {
            switch (state) {
                case Bundle.ACTIVE:
                    try {
                        injectBundleContext(activator.getContext(), bundle.getBundleContext());
View Full Code Here

Examples of org.jboss.osgi.resolver.XBundleRevision

        resolveBundle(phaseContext, depUnit, bundle);
    }

    private void resolveBundle(DeploymentPhaseContext phaseContext, DeploymentUnit depUnit, XBundle bundle) {
        XBundleRevision brev = bundle.getBundleRevision();
        XEnvironment env = depUnit.getAttachment(OSGiConstants.ENVIRONMENT_KEY);
        XResolver resolver = depUnit.getAttachment(OSGiConstants.RESOLVER_KEY);
        BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY);
        Set<XBundleRevision> mandatoryResources = Collections.singleton(brev);
        Set<XBundleRevision> optionalResources = getOptionalResources(bundleManager, brev);
View Full Code Here

Examples of org.jboss.osgi.resolver.XBundleRevision

        }

        @Override
        public void addIntegrationDependencies(ModuleSpecBuilderContext context) {
            Builder builder = context.getModuleSpecBuilder();
            XBundleRevision brev = context.getBundleRevision();
            Map<ModuleIdentifier, DependencySpec> moduleDependencies = context.getModuleDependencies();
            Deployment deployment = brev.getBundle().adapt(Deployment.class);
            ModuleSpecification moduleSpecification = deployment.getAttachment(ModuleSpecification.class);
            if (moduleSpecification != null) {
                List<ModuleDependency> dependencies = moduleSpecification.getAllDependencies();
                LOGGER.debugf("Adding integration dependencies: %d", dependencies.size());
                for (ModuleDependency moduleDep : dependencies) {
View Full Code Here

Examples of org.jboss.osgi.resolver.XBundleRevision

                dependencies.add(new ModuleDependency(null, depId, false, false, false, false));
            }

            // Add dependencies on all modules this brev has a wire to
            for (BundleWire wire : wires) {
                XBundleRevision provider = (XBundleRevision) wire.getProvider();
                ModuleIdentifier providerid = provider.getModuleIdentifier();
                dependencies.add(new ModuleDependency(null, providerid, false, false, false, false));
            }

            ModuleIdentifier identifier = brev.getModuleIdentifier();
            return ModuleLoadService.install(serviceTarget, identifier, dependencies);
View Full Code Here

Examples of org.jboss.osgi.resolver.XBundleRevision

        BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY);
        ServiceName bundleResolve = bundleManager.getServiceName(bundle, Bundle.RESOLVED);
        phaseContext.addDeploymentDependency(bundleResolve, AttachmentKey.create(Object.class));

        // Add a dependency on the Module service
        XBundleRevision brev = bundle.getBundleRevision();
        ServiceName moduleService = ServiceModuleLoader.moduleServiceName(brev.getModuleIdentifier());
        phaseContext.addDeploymentDependency(moduleService, Attachments.MODULE);

        // Defer the module phase if the bundle is not resolved
        if (bundle.isResolved() == false) {
            depUnit.putAttachment(Attachments.DEFERRED_ACTIVATION_COUNT, new AtomicInteger());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.