|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2010 the original author or authors. |
|
|
|
* Copyright 2002-2011 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -29,6 +29,7 @@ import java.util.LinkedHashMap; |
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import javax.portlet.ActionRequest; |
|
|
|
import javax.portlet.ActionRequest; |
|
|
|
import javax.portlet.ActionResponse; |
|
|
|
import javax.portlet.ActionResponse; |
|
|
|
import javax.portlet.ClientDataRequest; |
|
|
|
import javax.portlet.ClientDataRequest; |
|
|
|
@ -150,7 +151,7 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator |
|
|
|
private BeanExpressionContext expressionContext; |
|
|
|
private BeanExpressionContext expressionContext; |
|
|
|
|
|
|
|
|
|
|
|
private final Map<Class<?>, PortletHandlerMethodResolver> methodResolverCache = |
|
|
|
private final Map<Class<?>, PortletHandlerMethodResolver> methodResolverCache = |
|
|
|
new HashMap<Class<?>, PortletHandlerMethodResolver>(); |
|
|
|
new ConcurrentHashMap<Class<?>, PortletHandlerMethodResolver>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
@ -300,6 +301,7 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ModelAndView doHandle(PortletRequest request, PortletResponse response, Object handler) throws Exception { |
|
|
|
protected ModelAndView doHandle(PortletRequest request, PortletResponse response, Object handler) throws Exception { |
|
|
|
ExtendedModelMap implicitModel = null; |
|
|
|
ExtendedModelMap implicitModel = null; |
|
|
|
|
|
|
|
|
|
|
|
@ -391,17 +393,19 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private PortletHandlerMethodResolver getMethodResolver(Object handler) { |
|
|
|
private PortletHandlerMethodResolver getMethodResolver(Object handler) { |
|
|
|
Class handlerClass = ClassUtils.getUserClass(handler); |
|
|
|
Class handlerClass = ClassUtils.getUserClass(handler); |
|
|
|
synchronized (this.methodResolverCache) { |
|
|
|
PortletHandlerMethodResolver resolver = this.methodResolverCache.get(handlerClass); |
|
|
|
PortletHandlerMethodResolver resolver = this.methodResolverCache.get(handlerClass); |
|
|
|
if (resolver == null) { |
|
|
|
if (resolver == null) { |
|
|
|
synchronized (this.methodResolverCache) { |
|
|
|
resolver = new PortletHandlerMethodResolver(handlerClass); |
|
|
|
resolver = this.methodResolverCache.get(handlerClass); |
|
|
|
this.methodResolverCache.put(handlerClass, resolver); |
|
|
|
if (resolver == null) { |
|
|
|
|
|
|
|
resolver = new PortletHandlerMethodResolver(handlerClass); |
|
|
|
|
|
|
|
this.methodResolverCache.put(handlerClass, resolver); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return resolver; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return resolver; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Template method for creating a new PortletRequestDataBinder instance. |
|
|
|
* Template method for creating a new PortletRequestDataBinder instance. |
|
|
|
* <p>The default implementation creates a standard PortletRequestDataBinder. |
|
|
|
* <p>The default implementation creates a standard PortletRequestDataBinder. |
|
|
|
@ -413,11 +417,8 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator |
|
|
|
* @return the PortletRequestDataBinder instance to use |
|
|
|
* @return the PortletRequestDataBinder instance to use |
|
|
|
* @throws Exception in case of invalid state or arguments |
|
|
|
* @throws Exception in case of invalid state or arguments |
|
|
|
* @see PortletRequestDataBinder#bind(javax.portlet.PortletRequest) |
|
|
|
* @see PortletRequestDataBinder#bind(javax.portlet.PortletRequest) |
|
|
|
* @see PortletRequestDataBinder#convertIfNecessary(Object, Class, MethodParameter) |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected PortletRequestDataBinder createBinder( |
|
|
|
protected PortletRequestDataBinder createBinder(PortletRequest request, Object target, String objectName) throws Exception { |
|
|
|
PortletRequest request, Object target, String objectName) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new PortletRequestDataBinder(target, objectName); |
|
|
|
return new PortletRequestDataBinder(target, objectName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|