Package org.osgi.framework.wiring

Examples of org.osgi.framework.wiring.BundleWiring.listResources()


        if (wiring != null) {
            Collection<String> resources = null;
            if (displayAllFiles) {
                resources = wiring.listResources("/", null, BundleWiring.LISTRESOURCES_RECURSE);
            } else {
                resources = wiring.listResources("/", "*class", BundleWiring.LISTRESOURCES_RECURSE);
            }
            if (resources.size() > 0) {
                System.out.println("\n" + Util.getBundleName(bundle));
            }
            for (String resource : resources) {
View Full Code Here


        Bundle[] bundles = bundleContext.getBundles();
        String filter = "*" + className + "*";
        for (Bundle bundle : bundles) {
            BundleWiring wiring = (BundleWiring) bundle.adapt(BundleWiring.class);
            if (wiring != null) {
                Collection<String> resources = wiring.listResources("/", filter, BundleWiring.LISTRESOURCES_RECURSE);
                if (resources.size() > 0) {
                    System.out.println("\n" + Util.getBundleName(bundle));
                }
                for (String resource:resources) {
                    System.out.println(resource);
View Full Code Here

    final Configuration configuration = new Configuration();
    configuration.getProperties().put( AvailableSettings.JTA_PLATFORM, osgiJtaPlatform );
   
    // Allow bundles to put the config file somewhere other than the root level.
    final BundleWiring bundleWiring = (BundleWiring) requestingBundle.adapt( BundleWiring.class );
    final Collection<String> cfgResources = bundleWiring.listResources( "/", "hibernate.cfg.xml",
        BundleWiring.LISTRESOURCES_RECURSE );
    if (cfgResources.size() == 0) {
      configuration.configure();
    }
    else {
View Full Code Here

    final Configuration configuration = new Configuration();
    configuration.getProperties().put( AvailableSettings.JTA_PLATFORM, osgiJtaPlatform );
   
    // Allow bundles to put the config file somewhere other than the root level.
    final BundleWiring bundleWiring = (BundleWiring) requestingBundle.adapt( BundleWiring.class );
    final Collection<String> cfgResources = bundleWiring.listResources( "/", "hibernate.cfg.xml",
        BundleWiring.LISTRESOURCES_RECURSE );
    if (cfgResources.size() == 0) {
      configuration.configure();
    }
    else {
View Full Code Here

        }
    }

    private void loadImplementationsInBundle(Test test, String packageName) {
        BundleWiring wiring = (BundleWiring)FrameworkUtil.getBundle(ResolverUtil.class).adapt(BundleWiring.class);
        Collection<String> list = wiring.listResources(packageName, "*.class", BundleWiring.LISTRESOURCES_RECURSE);
        for (String name : list) {
            addIfMatching(test, name);
        }
    }

View Full Code Here

        BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
        if (bundleWiring == null) {
            throw new IllegalArgumentException("cannot adapt to BundleWiring: " + bundle);
        }
        String resourcePrefix = "/" + packagePrefix.replace('.', '/') + "/";
        Collection<String> resources = bundleWiring.listResources(resourcePrefix, "*.class", LISTRESOURCES_RECURSE);
        return with(resources).convert(new Converter<String, Class<?>>() {

            @Override
            public Class<?> convert(String resource) {
                try {
View Full Code Here

    private void loadImplementationsInBundle(final Test test, final String packageName) {
        //Do not remove the cast on the next line as removing it will cause a compile error on Java 7.
        final BundleWiring wiring = (BundleWiring) FrameworkUtil.getBundle(
                ResolverUtil.class).adapt(BundleWiring.class);
        final Collection<String> list = wiring.listResources(packageName, "*.class",
            BundleWiring.LISTRESOURCES_RECURSE);
        for (final String name : list) {
            addIfMatching(test, name);
        }
    }
View Full Code Here

    Configuration configuration = new Configuration();
    configuration.getProperties().put( AvailableSettings.JTA_PLATFORM, osgiJtaPlatform );
   
    // Allow bundles to put the config file somewhere other than the root level.
    final BundleWiring bundleWiring = (BundleWiring) requestingBundle.adapt( BundleWiring.class );
    final Collection<String> cfgResources = bundleWiring.listResources( "/", "hibernate.cfg.xml",
        BundleWiring.LISTRESOURCES_RECURSE );
    if (cfgResources.size() == 0) {
      configuration.configure();
    }
    else {
View Full Code Here

    private void loadImplementationsInBundle(final Test test, final String packageName) {
        //Do not remove the cast on the next line as removing it will cause a compile error on Java 7.
        final BundleWiring wiring = (BundleWiring) FrameworkUtil.getBundle(
                ResolverUtil.class).adapt(BundleWiring.class);
        final Collection<String> list = wiring.listResources(packageName, "*.class",
            BundleWiring.LISTRESOURCES_RECURSE);
        for (final String name : list) {
            addIfMatching(test, name);
        }
    }
View Full Code Here

    final Configuration configuration = new Configuration();
    configuration.getProperties().put( AvailableSettings.JTA_PLATFORM, osgiJtaPlatform );
   
    // Allow bundles to put the config file somewhere other than the root level.
    final BundleWiring bundleWiring = (BundleWiring) requestingBundle.adapt( BundleWiring.class );
    final Collection<String> cfgResources = bundleWiring.listResources( "/", "hibernate.cfg.xml",
        BundleWiring.LISTRESOURCES_RECURSE );
    if (cfgResources.size() == 0) {
      configuration.configure();
    }
    else {
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.