Package org.jboss.osgi.resolver

Examples of org.jboss.osgi.resolver.XBundle.adapt()


    private ServiceController<StandardContext> controller;

    @Override
    public void start(BundleContext context) throws Exception {
        XBundle sysbundle = (XBundle) context.getBundle();
        BundleManager bundleManager = sysbundle.adapt(BundleManager.class);
        ServiceTarget serviceTarget = bundleManager.getServiceTarget();
        controller = HttpServiceFactoryService.addService(serviceTarget);
    }

    @Override
View Full Code Here


            // 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

    @Override
    public void undeploy(final DeploymentUnit depUnit) {
        ContextActivator activator = depUnit.getAttachment(ContextActivator.ATTACHMENT_KEY);
        XBundle bundle = depUnit.getAttachment(OSGiConstants.BUNDLE_KEY);
        if (activator != null && bundle != null) {
            bundle.adapt(Deployment.class).removeAttachment(ContextActivator.class);
        }
    }
}
View Full Code Here

         * by the {@link ServiceModuleLoader}
         */
        @Override
        public ModuleIdentifier getModuleIdentifier(XBundleRevision brev) {
            XBundle bundle = brev.getBundle();
            Deployment deployment = bundle.adapt(Deployment.class);
            ModuleIdentifier identifier = deployment.getAttachment(ModuleIdentifier.class);
            if (identifier == null) {
                XIdentityCapability icap = brev.getIdentityCapability();
                List<XBundleRevision> allrevs = bundle.getAllBundleRevisions();
                String name = icap.getSymbolicName();
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.