{
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)
{