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());