Package org.jboss.osgi.resolver

Examples of org.jboss.osgi.resolver.XIdentityCapability


            Repository repository = injectedRepository.getValue();
            MavenCoordinates mavenId = MavenCoordinates.parse(identifier);
            Requirement req = XRequirementBuilder.createArtifactRequirement(mavenId);
            Collection<Capability> caps = repository.findProviders(Collections.singleton(req)).get(req);
            if (caps.isEmpty() == false) {
                XIdentityCapability icap = (XIdentityCapability) caps.iterator().next();
                URL bundleURL = (URL) icap.getAttribute(XResourceConstants.CONTENT_URL);
                result =  installBundleFromURL(bundleURL, identifier, level, listener);
            }
        }

        if (result == null)
View Full Code Here


     * Get the module identifier for the given {@link XModule} The returned identifier must be such that it can be used by the
     * {@link ServiceModuleLoader}
     */
    @Override
    public ModuleIdentifier getModuleIdentifier(XResource resource, int rev) {
        XIdentityCapability icap = resource.getIdentityCapability();
        String name = icap.getSymbolicName();
        String slot = icap.getVersion() + (rev > 0 ? "-rev" + rev : "");
        return ModuleIdentifier.create(MODULE_PREFIX + name, slot);
    }
View Full Code Here

        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();
                if (allrevs.size() > 1) {
                    name += "-rev" + (allrevs.size() - 1);
                }
                identifier = ModuleIdentifier.create(MODULE_PREFIX + name, "" + icap.getVersion());
            }
            return identifier;
        }
View Full Code Here

TOP

Related Classes of org.jboss.osgi.resolver.XIdentityCapability

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.