Package org.osgi.framework.wiring

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


class JPAAnnotationScanner implements AnnotationScanner {

 
  public Collection<String> findJPAAnnotatedClasses(Bundle b) {
    BundleWiring bw = b.adapt(BundleWiring.class);
    Collection<String> resources = bw.listResources("/", "*.class",
        BundleWiring.LISTRESOURCES_LOCAL | BundleWiring.LISTRESOURCES_RECURSE);
   
    Collection<String> classes = new ArrayList<String>();
    ClassLoader cl = new TempBundleDelegatingClassLoader(b, this.getClass().getClassLoader());
    for(String s : resources) {
View Full Code Here


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

    protected void executeOnBundle(Bundle bundle) throws Exception {
        BundleWiring wiring = bundle.adapt(BundleWiring.class);
        if (wiring != null){
            Collection<String> resources;
            if (displayAllFiles){
                resources = wiring.listResources("/", null, BundleWiring.LISTRESOURCES_RECURSE);
            }else{
                resources = wiring.listResources("/", "*class", BundleWiring.LISTRESOURCES_RECURSE);
            }
            for (String resource:resources){
                System.out.println(resource);
View Full Code Here

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

                    name = "/" + name;
                }
                if (name.endsWith("/")) {
                    name = name.substring(0, name.length() - 1);
                }
                Collection<String> classes = wiring.listResources(name, "*.class", options);
                for (String className : classes) {
                    className = className.replace('/', '.').replace(".class", "");
                    inspectClass(bundle.loadClass(className));
                }
            }
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.