Package org.apache.commons.discovery

Examples of org.apache.commons.discovery.ResourceNameIterator


            classLoader = this.getClass().getClassLoader();
        }
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(classLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(ANNOTATION_PROVIDER);
        return getApplicationObject(FaceletConfigResourceProvider.class, iter, new DefaultFaceletConfigResourceProvider());
    }
View Full Code Here


            classLoader = this.getClass().getClassLoader();
        }
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(classLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(ANNOTATION_PROVIDER);
        return getApplicationObject(FacesConfigResourceProvider.class, iter, new DefaultFacesConfigResourceProvider());
    }
View Full Code Here

            classLoader = this.getClass().getClassLoader();
        }
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(classLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(ANNOTATION_PROVIDER);
        return getApplicationObject(AnnotationProvider.class, iter, new DefaultAnnotationProvider());
    }
View Full Code Here

        }
        return nameDiscoverer;
    }
   
    public static ResourceClassIterator getResourceClassIterator(Class spi) {
        ResourceNameIterator it = getNameDiscoverer().findResourceNames(spi.getName());
        return new DiscoverClasses(loaders).findResourceClasses(it);
    }
View Full Code Here

        }
        return nameDiscoverer;
    }

    public static ResourceClassIterator getResourceClassIterator(Class spi) {
        ResourceNameIterator it = getNameDiscoverer().findResourceNames(spi.getName());
        return new DiscoverClasses(loaders).findResourceClasses(it);
    }
View Full Code Here

    private static void loadPluggableProviders() {
        ClassLoader clzLoader = WSDDProvider.class.getClassLoader();
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(clzLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(PLUGABLE_PROVIDER_FILENAME);
        while (iter.hasNext()) {
            String className = iter.nextResourceName();
            try {
                Object o = Class.forName(className).newInstance();
                if (o instanceof WSDDProvider) {
                    WSDDProvider provider = (WSDDProvider) o;
                    String providerName = provider.getName();
View Full Code Here

    private static void loadPluggableEncoders() {
        ClassLoader clzLoader = XMLEncoder.class.getClassLoader();
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(clzLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(PLUGABLE_PROVIDER_FILENAME);
        while (iter.hasNext()) {
            String className = iter.nextResourceName();
            try {
                Object o = Class.forName(className).newInstance();
                if (o instanceof XMLEncoder) {
                    XMLEncoder encoder = (XMLEncoder) o;
                    encoderMap.put(encoder.getEncoding(), encoder);
View Full Code Here

                                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                                ClassLoaders loaders = new ClassLoaders();
                                loaders.put(classLoader);
                                loaders.put(this.getClass().getClassLoader());
                                DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
                                ResourceNameIterator iter = dsn.findResourceNames(LIFECYCLE_PROVIDER);
                                while (iter.hasNext())
                                {
                                    String className = iter.nextResourceName();
                                    Object obj = createClass(className,extContext);
                                    if (DiscoverableLifecycleProvider.class.isAssignableFrom(obj.getClass()))
                                    {
                                        DiscoverableLifecycleProvider discoverableLifecycleProvider = (DiscoverableLifecycleProvider) obj;
                                        if (discoverableLifecycleProvider.isAvailable())
                                        {
                                            LIFECYCLE_PROVIDER_INSTANCE = discoverableLifecycleProvider;
                                            return (Boolean) true;
                                        }
                                    }
                                }
                                return (Boolean) false;
                            }
                        });
            }
            else
            {
                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                ClassLoaders loaders = new ClassLoaders();
                loaders.put(classLoader);
                loaders.put(this.getClass().getClassLoader());
                DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
                ResourceNameIterator iter = dsn.findResourceNames(LIFECYCLE_PROVIDER);
                while (iter.hasNext())
                {
                    String className = iter.nextResourceName();
                    Object obj = createClass(className, externalContext);
                    if (DiscoverableLifecycleProvider.class.isAssignableFrom(obj.getClass()))
                    {
                        DiscoverableLifecycleProvider discoverableLifecycleProvider = (DiscoverableLifecycleProvider) obj;
                        if (discoverableLifecycleProvider.isAvailable())
View Full Code Here

                                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                                ClassLoaders loaders = new ClassLoaders();
                                loaders.put(classLoader);
                                loaders.put(this.getClass().getClassLoader());
                                DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
                                ResourceNameIterator iter = dsn.findResourceNames(LIFECYCLE_PROVIDER);
                                while (iter.hasNext())
                                {
                                    String className = iter.nextResourceName();
                                    Object obj = createClass(className,extContext);
                                    if (DiscoverableLifecycleProvider.class.isAssignableFrom(obj.getClass()))
                                    {
                                        DiscoverableLifecycleProvider discoverableLifecycleProvider = (DiscoverableLifecycleProvider) obj;
                                        if (discoverableLifecycleProvider.isAvailable())
                                        {
                                            LIFECYCLE_PROVIDER_INSTANCE = discoverableLifecycleProvider;
                                            return (Boolean) true;
                                        }
                                    }
                                }
                                return (Boolean) false;
                            }
                        });
            }
            else
            {
                ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                ClassLoaders loaders = new ClassLoaders();
                loaders.put(classLoader);
                loaders.put(this.getClass().getClassLoader());
                DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
                ResourceNameIterator iter = dsn.findResourceNames(LIFECYCLE_PROVIDER);
                while (iter.hasNext())
                {
                    String className = iter.nextResourceName();
                    Object obj = createClass(className, externalContext);
                    if (DiscoverableLifecycleProvider.class.isAssignableFrom(obj.getClass()))
                    {
                        DiscoverableLifecycleProvider discoverableLifecycleProvider = (DiscoverableLifecycleProvider) obj;
                        if (discoverableLifecycleProvider.isAvailable())
View Full Code Here

TOP

Related Classes of org.apache.commons.discovery.ResourceNameIterator

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.