Package org.apache.tuscany.sca.osgi.runtime

Examples of org.apache.tuscany.sca.osgi.runtime.OSGiRuntime


     * Import model resolvers are matched to a specific contribution if a location uri is specified,
     *    otherwise it try to resolve agains all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here


     * Import model resolvers are matched to a specific contribution if a location uri is specified,
     *    otherwise it try to resolve agains all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here

     * Import model resolvers are matched to a specific contribution if a location URI is specified,
     *    otherwise it try to resolve against all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here

     * Import model resolvers are matched to a specific contribution if a location URI is specified,
     *    otherwise it try to resolve against all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here

     * Import model resolvers are matched to a specific contribution if a location uri is specified,
     *    otherwise it try to resolve agains all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here

     * Import model resolvers are matched to a specific contribution if a location uri is specified,
     *    otherwise it try to resolve agains all the other contributions
     */
    public void contributionAdded(ContributionRepository repository, Contribution contribution) {

        OSGiRuntime osgiRuntime = null;
        try {
            if (bundleProcessor.installContributionBundle(contribution) == null) {
                return;
            } else {
                osgiRuntime = OSGiRuntime.getRuntime();
            }
        } catch (Exception e) {
            return;
        }

        HashSet<Contribution> bundlesToInstall = new HashSet<Contribution>();
        // Initialize the contribution imports
        for (Import import_ : contribution.getImports()) {
            boolean initialized = false;

            if (import_ instanceof JavaImport) {
                JavaImport javaImport = (JavaImport)import_;
                String packageName = javaImport.getPackage();

                //Find a matching contribution
                if (javaImport.getLocation() != null) {
                    Contribution targetContribution = repository.getContribution(javaImport.getLocation());
                    if (targetContribution != null) {

                        // Find a matching contribution export
                        for (Export export : targetContribution.getExports()) {
                            if (export instanceof JavaExport) {
                                JavaExport javaExport = (JavaExport)export;
                                if (packageName.equals(javaExport.getPackage())) {

                                    if (osgiRuntime.findBundle(targetContribution.getLocation()) == null)
                                        bundlesToInstall.add(targetContribution);

                                    initialized = true;

                                }
                            }
                            if (initialized)
                                break;
                        }
                    }
                }
            }
            if (!initialized) {
                for (Contribution c : repository.getContributions()) {

                    // Go over all exports in the contribution
                    for (Export export : c.getExports()) {
                        // If the export matches our namespace, try to the resolve the model object
                        if (import_.match(export) && osgiRuntime.findBundle(c.getLocation()) == null) {
                            bundlesToInstall.add(c);
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.osgi.runtime.OSGiRuntime

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.