Examples of BundleRevisions


Examples of org.osgi.framework.wiring.BundleRevisions

    private void populateFragementInfos(Bundle bundle) {
        this.isFragment = bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null;
        this.fragments = new ArrayList<Bundle>();
        this.fragmentHosts = new ArrayList<Bundle>();
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);
        if (revisions == null) {
            return;
        }
        for (BundleRevision revision : revisions.getRevisions()) {
            if (revision.getWiring() != null) {
                getFragments(revision);
                getFragmentHosts(revision);
            }
        }
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRevisions

            throw new IOException("No bundle associated with resource: " + url);
        }
        m_contentTime = bundle.getLastModified();

        // Get the bundle's revisions to find the target revision.
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);
        if ((revisions == null) || revisions.getRevisions().isEmpty())
        {
            throw new IOException("Resource does not exist: " + url);
        }

        // Search for matching revision name.
        for (BundleRevision br : revisions.getRevisions())
        {
            if (((BundleRevisionImpl) br).getId().equals(url.getHost()))
            {
                m_targetRevision = br;
                break;
            }
        }

        // If not found, assume the current revision.
        if (m_targetRevision == null)
        {
            m_targetRevision = revisions.getRevisions().get(0);
        }

        // If the resource cannot be found at the current class path index,
        // then search them all in order to see if it can be found. This is
        // necessary since the user might create a resource URL from another
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRevisions

    /* (non-Javadoc)
     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsDeclaredRequirements(long, java.lang.String, boolean)
     */
    public TabularData getRevisionsDeclaredRequirements(long bundleId, String namespace) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(bundleContext, bundleId);
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);

        TabularData td = new TabularDataSupport(BundleWiringStateMBean.REVISIONS_REQUIREMENTS_TYPE);
        for (BundleRevision revision : revisions.getRevisions()) {
            td.put(BundleWiringData.getRevisionRequirements(
                    System.identityHashCode(revision),
                    revision.getDeclaredRequirements(namespace)));
        }
        return td;
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRevisions

    /* (non-Javadoc)
     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsDeclaredCapabilities(long, java.lang.String, boolean)
     */
    public TabularData getRevisionsDeclaredCapabilities(long bundleId, String namespace) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(bundleContext, bundleId);
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);

        TabularData td = new TabularDataSupport(BundleWiringStateMBean.REVISIONS_CAPABILITIES_TYPE);
        for (BundleRevision revision : revisions.getRevisions()) {
            td.put(BundleWiringData.getRevisionCapabilities(
                    System.identityHashCode(revision),
                    revision.getDeclaredCapabilities(namespace)));
        }
        return td;
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRevisions

    /* (non-Javadoc)
     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getRevisionsWiring(long, java.lang.String)
     */
    public TabularData getRevisionsWiring(long bundleId, String namespace) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(bundleContext, bundleId);
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);

        TabularData td = new TabularDataSupport(BundleWiringStateMBean.BUNDLES_WIRING_TYPE);
        for (BundleRevision revision : revisions.getRevisions()) {
            Map<BundleRevision, Integer> revisionIDMap = getRevisionTransitiveClosure(revision, namespace);
            td.put(getRevisionWiring(revision, System.identityHashCode(revision), namespace, revisionIDMap));
        }
        return td;
    }
View Full Code Here

Examples of org.osgi.framework.wiring.BundleRevisions

    /* (non-Javadoc)
     * @see org.osgi.jmx.framework.BundleRevisionsStateMBean#getWiringClosure(long, java.lang.String)
     */
    public TabularData getRevisionsWiringClosure(long rootBundleId, String namespace) throws IOException {
        Bundle bundle = FrameworkUtils.resolveBundle(bundleContext, rootBundleId);
        BundleRevisions revisions = bundle.adapt(BundleRevisions.class);

        Map<BundleRevision, Integer> revisionIDMap = new HashMap<BundleRevision, Integer>();
        for (BundleRevision revision : revisions.getRevisions()) {
            populateTransitiveRevisions(namespace, revision, revisionIDMap);
        }

        // Set the root current revision ID to 0,
        // TODO check if there is already a revision with ID 0 and if so swap them. Quite a small chance that this will be needed
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.