Package org.directwebremoting.annotations

Examples of org.directwebremoting.annotations.GlobalFilter


        try
        {
            Class<?> beanDefinitionClass = ClassUtils.forName(definitionHolder.getBeanDefinition().getBeanClassName(), getClass().getClassLoader());
            RemoteProxy proxy = beanDefinitionClass.getAnnotation(RemoteProxy.class);
            DataTransferObject converter = beanDefinitionClass.getAnnotation(DataTransferObject.class);
            GlobalFilter globalFilter = beanDefinitionClass.getAnnotation(GlobalFilter.class);
            if (proxy != null)
            {
                super.registerBeanDefinition(definitionHolder, registry);
                String javascript = proxy.name();
                if (!StringUtils.hasText(javascript))
                {
                    javascript = beanDefinitionClass.getSimpleName();
                }
                if (log.isInfoEnabled())
                {
                    log.info("Dwr classpath scanning detected candidate bean [" + definitionHolder.getBeanName() + "]. Remoting using " + javascript);
                }
                CreatorParserHelper.registerCreator(definitionHolder, registry, beanDefinitionClass, javascript);
            }
            else if (converter != null)
            {
                if (log.isInfoEnabled())
                {
                    log.info("Dwr classpath scanning detected candidate DTO [" + beanDefinitionClass.getName() + "] processed by converter type [" + converter.type() + "]");
                }
                ConverterConfig converterConfig = new ConverterConfig();
                converterConfig.setType(converter.type());
                setIncludes(beanDefinitionClass, converterConfig);
                String javascript = converter.javascript();
                if (StringUtils.hasText(javascript))
                {
                    converterConfig.setJavascriptClassName(javascript);
                }
                Param[] params = converter.params();
                if ((params != null) && (params.length > 0))
                {
                    Map<String, String> parameters = new HashMap<String, String>();
                    for (Param param : params)
                    {
                        parameters.put(param.name(), param.value());
                    }
                    converterConfig.setParams(parameters);
                }
                ConverterParserHelper.lookupConverters(registry).put(beanDefinitionClass.getName(), converterConfig);
            }
            else if (globalFilter != null)
            {
                if (log.isInfoEnabled())
                {
                    log.info("Dwr classpath scanning detected candidate global filter [" + beanDefinitionClass + "]");
                }
                BeanDefinition springConfigurator = ConfigurationParser.registerConfigurationIfNecessary(registry);
                ManagedList filters = (ManagedList) springConfigurator.getPropertyValues().getPropertyValue("filters").getValue();
                Param[] params = globalFilter.params();
                if (params != null)
                {
                    for (Param param : params)
                    {
                        definitionHolder.getBeanDefinition().getPropertyValues().addPropertyValue(param.name(), param.value());
View Full Code Here


                    {
                        log.info("Detected candidate bean [" + beanName + "]. Remoting using " + javascript);
                    }
                    registerCreator(beanDefinitionHolder, beanDefinitionRegistry, beanDefinitionClass, javascript);
                }
                GlobalFilter globalFilter = beanDefinitionClass.getAnnotation(GlobalFilter.class);
                if (globalFilter != null)
                {
                    if (log.isInfoEnabled())
                    {
                        log.info("Detected global filter [" + beanDefinitionClass + "].");
                    }
                    ManagedList filters = (ManagedList) springConfigurator.getPropertyValues().getPropertyValue("filters").getValue();
                    Param[] params = globalFilter.params();
                    if (params != null)
                    {
                        for (Param param : params)
                        {
                            beanDefinitionHolder.getBeanDefinition().getPropertyValues().addPropertyValue(param.name(), param.value());
View Full Code Here

TOP

Related Classes of org.directwebremoting.annotations.GlobalFilter

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.