Package org.apache.cxf.configuration

Examples of org.apache.cxf.configuration.ConfiguredBeanLocator


    }

    public final <T> T getExtension(Class<T> extensionType) {
        Object obj = extensions.get(extensionType);
        if (obj == null) {
            ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
            if (loc == null) {
                loc = createConfiguredBeanLocator();
            }
            if (loc != null) {
                //force loading
                Collection<?> objs = loc.getBeansOfType(extensionType);
                if (objs != null) {
                    for (Object o : objs) {
                        extensions.put(extensionType, o);
                    }
                }
View Full Code Here


        }
        return null;
    }
   
    protected synchronized ConfiguredBeanLocator createConfiguredBeanLocator() {
        ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
        if (loc == null) {
            loc = new ConfiguredBeanLocator() {
                public List<String> getBeanNamesOfType(Class<?> type) {
                    return null;
                }
                public <T> Collection<? extends T> getBeansOfType(Class<T> type) {
                    return null;
View Full Code Here

    }

    public final <T> T getExtension(Class<T> extensionType) {
        Object obj = extensions.get(extensionType);
        if (obj == null) {
            ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
            if (loc == null) {
                loc = createConfiguredBeanLocator();
            }
            if (loc != null) {
                //force loading
                Collection<?> objs = loc.getBeansOfType(extensionType);
                if (objs != null) {
                    for (Object o : objs) {
                        extensions.put(extensionType, o);
                    }
                }
View Full Code Here

        for (Class<?> c : extensions.keySet()) {
            if (name.equals(c.getName())) {
                return true;
            }
        }
        ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
        if (loc == null) {
            loc = createConfiguredBeanLocator();
        }
        if (loc != null) {
            return loc.hasBeanOfName(name);
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }
   
    protected synchronized ConfiguredBeanLocator createConfiguredBeanLocator() {
        ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
        if (loc == null) {
            loc = new ConfiguredBeanLocator() {
                public List<String> getBeanNamesOfType(Class<?> type) {
                    return null;
                }
                public <T> Collection<? extends T> getBeansOfType(Class<T> type) {
                    return null;
View Full Code Here

                             listener);
       
        return bindingFactories.get(namespace);
    }
    private BindingFactory loadActivationNamespace(final String namespace) {
        final ConfiguredBeanLocator locator = bus.getExtension(ConfiguredBeanLocator.class);
       
        //Second attempt will be to examine the factory class
        //for a DEFAULT_NAMESPACES field and if it doesn't exist, try
        //using the older activation ns things.  This will then load most
        //of the "older" things
        ConfiguredBeanLocator.BeanLoaderListener<BindingFactory> listener
            = new ConfiguredBeanLocator.BeanLoaderListener<BindingFactory>() {
                public boolean beanLoaded(String name, BindingFactory bean) {
                    loaded.add(name);
                    return bindingFactories.containsKey(namespace);
                }

                public boolean loadBean(String name, Class<? extends BindingFactory> type) {
                    if (loaded.contains(name)) {
                        return false;
                    }
                    try {
                        type.getField("DEFAULT_NAMESPACES");
                        return false;
                    } catch (Exception ex) {
                        //ignore
                    }
                    return locator.hasConfiguredPropertyValue(name, "activationNamespaces", namespace);
                }
            };               
        locator.loadBeansOfType(BindingFactory.class,
                                listener);
       
        return bindingFactories.get(namespace);
    }
View Full Code Here

                    imanager.register(new WorkQueueManagerImplMBeanWrapper(this));
                } catch (JMException jmex) {
                    LOG.log(Level.WARNING , jmex.getMessage(), jmex);
                }
            }
            ConfiguredBeanLocator locator = bus.getExtension(ConfiguredBeanLocator.class);
            Collection<? extends AutomaticWorkQueue> q = locator
                    .getBeansOfType(AutomaticWorkQueue.class);
            if (q != null) {
                for (AutomaticWorkQueue awq : q) {
                    addNamedWorkQueue(awq.getName(), awq);
                }
            }
           
            if (!namedQueues.containsKey("default")) {
                AutomaticWorkQueue defaultQueue
                    = locator.getBeanOfType("cxf.default.workqueue", AutomaticWorkQueue.class);
                if (defaultQueue != null) {
                    addNamedWorkQueue("default", defaultQueue);
                }
            }
           
View Full Code Here

       
        ResourceManager m = getExtension(ResourceManager.class);
        m.addResourceResolver(new BusApplicationContextResourceResolver(applicationContext));
       
        setExtension(applicationContext, ApplicationContext.class);
        ConfiguredBeanLocator loc = getExtension(ConfiguredBeanLocator.class);
        if (!(loc instanceof SpringBeanLocator)) {
            setExtension(new SpringBeanLocator(applicationContext, this), ConfiguredBeanLocator.class);
        }
    }
View Full Code Here

    }

    public final <T> T getExtension(Class<T> extensionType) {
        Object obj = extensions.get(extensionType);
        if (obj == null) {
            ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
            if (loc == null) {
                loc = createConfiguredBeanLocator();
            }
            if (loc != null) {
                //force loading
                Collection<?> objs = loc.getBeansOfType(extensionType);
                if (objs != null) {
                    for (Object o : objs) {
                        extensions.put(extensionType, o);
                    }
                }
View Full Code Here

        for (Class<?> c : extensions.keySet()) {
            if (name.equals(c.getName())) {
                return true;
            }
        }
        ConfiguredBeanLocator loc = (ConfiguredBeanLocator)extensions.get(ConfiguredBeanLocator.class);
        if (loc == null) {
            loc = createConfiguredBeanLocator();
        }
        if (loc != null) {
            return loc.hasBeanOfName(name);
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.configuration.ConfiguredBeanLocator

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.