Add @Override annotations to main sources
Issue: SPR-10130
This commit is contained in:
@@ -421,6 +421,7 @@ public abstract class FrameworkPortlet extends GenericPortletBean
|
||||
* triggering a refresh of this servlet's context-dependent state.
|
||||
* @param event the incoming ApplicationContext event
|
||||
*/
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
this.refreshEventReceived = true;
|
||||
onRefresh(event.getApplicationContext());
|
||||
|
||||
@@ -174,6 +174,7 @@ public abstract class GenericPortletBean extends GenericPortlet
|
||||
* @throws IllegalArgumentException if environment is not assignable to
|
||||
* {@code ConfigurableEnvironment}.
|
||||
*/
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
Assert.isInstanceOf(ConfigurableEnvironment.class, environment);
|
||||
this.environment = (ConfigurableEnvironment)environment;
|
||||
@@ -184,6 +185,7 @@ public abstract class GenericPortletBean extends GenericPortlet
|
||||
* <p>If {@code null}, a new environment will be initialized via
|
||||
* {@link #createEnvironment()}.
|
||||
*/
|
||||
@Override
|
||||
public ConfigurableEnvironment getEnvironment() {
|
||||
if (this.environment == null) {
|
||||
this.environment = this.createEnvironment();
|
||||
|
||||
@@ -104,18 +104,22 @@ public abstract class AbstractRefreshablePortletApplicationContext extends Abstr
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletContext getServletContext() {
|
||||
return this.servletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletContext getPortletContext() {
|
||||
return this.portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletConfig(PortletConfig portletConfig) {
|
||||
this.portletConfig = portletConfig;
|
||||
if (portletConfig != null && this.portletContext == null) {
|
||||
@@ -123,10 +127,12 @@ public abstract class AbstractRefreshablePortletApplicationContext extends Abstr
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletConfig getPortletConfig() {
|
||||
return this.portletConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
if (namespace != null) {
|
||||
@@ -134,6 +140,7 @@ public abstract class AbstractRefreshablePortletApplicationContext extends Abstr
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return this.namespace;
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class RequestObjectFactory implements ObjectFactory<PortletRequest>, Serializable {
|
||||
|
||||
@Override
|
||||
public PortletRequest getObject() {
|
||||
return currentRequestAttributes().getRequest();
|
||||
}
|
||||
@@ -261,6 +262,7 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class SessionObjectFactory implements ObjectFactory<PortletSession>, Serializable {
|
||||
|
||||
@Override
|
||||
public PortletSession getObject() {
|
||||
return currentRequestAttributes().getRequest().getPortletSession();
|
||||
}
|
||||
@@ -278,6 +280,7 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class WebRequestObjectFactory implements ObjectFactory<WebRequest>, Serializable {
|
||||
|
||||
@Override
|
||||
public WebRequest getObject() {
|
||||
return new PortletWebRequest(currentRequestAttributes().getRequest());
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ public abstract class PortletApplicationObjectSupport extends ApplicationObjectS
|
||||
private PortletContext portletContext;
|
||||
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public class PortletContextAwareProcessor implements BeanPostProcessor {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (this.portletContext != null && bean instanceof PortletContextAware) {
|
||||
((PortletContextAware) bean).setPortletContext(this.portletContext);
|
||||
@@ -79,6 +80,7 @@ public class PortletContextAwareProcessor implements BeanPostProcessor {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ public class PortletContextResource extends AbstractFileResolvingResource implem
|
||||
* but throws a FileNotFoundException if not found.
|
||||
* @see javax.portlet.PortletContext#getResourceAsStream(String)
|
||||
*/
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
InputStream is = this.portletContext.getResourceAsStream(this.path);
|
||||
if (is == null) {
|
||||
@@ -188,10 +189,12 @@ public class PortletContextResource extends AbstractFileResolvingResource implem
|
||||
return StringUtils.getFilename(this.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "PortletContext resource [" + this.path + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPathWithinContext() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object get(String name, ObjectFactory<?> objectFactory) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject == null) {
|
||||
@@ -71,6 +72,7 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
return scopedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object remove(String name) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject != null) {
|
||||
@@ -83,14 +85,17 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDestructionCallback(String name, Runnable callback) {
|
||||
this.destructionCallbacks.put(name, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolveContextualObject(String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConversationId() {
|
||||
return null;
|
||||
}
|
||||
@@ -101,6 +106,7 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
* To be called on ServletContext shutdown.
|
||||
* @see org.springframework.web.context.ContextCleanupListener
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
for (Runnable runnable : this.destructionCallbacks.values()) {
|
||||
runnable.run();
|
||||
|
||||
@@ -100,6 +100,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -136,6 +137,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String name, Object value, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -161,6 +163,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAttribute(String name, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (isRequestActive()) {
|
||||
@@ -187,6 +190,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAttributeNames(int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -211,6 +215,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDestructionCallback(String name, Runnable callback, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
registerRequestDestructionCallback(name, callback);
|
||||
@@ -220,6 +225,7 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolveReference(String key) {
|
||||
if (REFERENCE_REQUEST.equals(key)) {
|
||||
return this.request;
|
||||
@@ -232,10 +238,12 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSessionId() {
|
||||
return getSession(true).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSessionMutex() {
|
||||
return PortletUtils.getSessionMutex(getSession(true));
|
||||
}
|
||||
|
||||
@@ -68,74 +68,91 @@ public class PortletWebRequest extends PortletRequestAttributes implements Nativ
|
||||
return this.response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getNativeRequest() {
|
||||
return getRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getNativeResponse() {
|
||||
return getResponse();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getNativeRequest(Class<T> requiredType) {
|
||||
return PortletUtils.getNativeRequest(getRequest(), requiredType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getNativeResponse(Class<T> requiredType) {
|
||||
return PortletUtils.getNativeResponse(getResponse(), requiredType);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getHeader(String headerName) {
|
||||
return getRequest().getProperty(headerName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getHeaderValues(String headerName) {
|
||||
String[] headerValues = StringUtils.toStringArray(getRequest().getProperties(headerName));
|
||||
return (!ObjectUtils.isEmpty(headerValues) ? headerValues : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<String> getHeaderNames() {
|
||||
return CollectionUtils.toIterator(getRequest().getPropertyNames());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String paramName) {
|
||||
return getRequest().getParameter(paramName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParameterValues(String paramName) {
|
||||
return getRequest().getParameterValues(paramName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<String> getParameterNames() {
|
||||
return CollectionUtils.toIterator(getRequest().getParameterNames());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
return getRequest().getParameterMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
return getRequest().getLocale();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContextPath() {
|
||||
return getRequest().getContextPath();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRemoteUser() {
|
||||
return getRequest().getRemoteUser();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Principal getUserPrincipal() {
|
||||
return getRequest().getUserPrincipal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUserInRole(String role) {
|
||||
return getRequest().isUserInRole(role);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecure() {
|
||||
return getRequest().isSecure();
|
||||
}
|
||||
@@ -144,6 +161,7 @@ public class PortletWebRequest extends PortletRequestAttributes implements Nativ
|
||||
* Last-modified handling not supported for portlet requests:
|
||||
* As a consequence, this method always returns {@code false}.
|
||||
*/
|
||||
@Override
|
||||
public boolean checkNotModified(long lastModifiedTimestamp) {
|
||||
return false;
|
||||
}
|
||||
@@ -152,10 +170,12 @@ public class PortletWebRequest extends PortletRequestAttributes implements Nativ
|
||||
* Last-modified handling not supported for portlet requests:
|
||||
* As a consequence, this method always returns {@code false}.
|
||||
*/
|
||||
@Override
|
||||
public boolean checkNotModified(String eTag) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription(boolean includeClientInfo) {
|
||||
PortletRequest request = getRequest();
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
@@ -101,18 +101,22 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletContext getServletContext() {
|
||||
return this.servletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletContext getPortletContext() {
|
||||
return this.portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletConfig(PortletConfig portletConfig) {
|
||||
this.portletConfig = portletConfig;
|
||||
if (portletConfig != null && this.portletContext == null) {
|
||||
@@ -120,10 +124,12 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletConfig getPortletConfig() {
|
||||
return this.portletConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
if (namespace != null) {
|
||||
@@ -131,6 +137,7 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return this.namespace;
|
||||
}
|
||||
@@ -139,6 +146,7 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
* The {@link StaticPortletApplicationContext} class does not support this method.
|
||||
* @throws UnsupportedOperationException <b>always</b>
|
||||
*/
|
||||
@Override
|
||||
public void setConfigLocation(String configLocation) {
|
||||
if (configLocation != null) {
|
||||
throw new UnsupportedOperationException("StaticPortletApplicationContext does not support config locations");
|
||||
@@ -149,12 +157,14 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
* The {@link StaticPortletApplicationContext} class does not support this method.
|
||||
* @throws UnsupportedOperationException <b>always</b>
|
||||
*/
|
||||
@Override
|
||||
public void setConfigLocations(String[] configLocations) {
|
||||
if (configLocations != null) {
|
||||
throw new UnsupportedOperationException("StaticPortletApplicationContext does not support config locations");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getConfigLocations() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public abstract class AbstractHandlerExceptionResolver implements HandlerExcepti
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
@@ -124,6 +125,7 @@ public abstract class AbstractHandlerExceptionResolver implements HandlerExcepti
|
||||
* matches in case of "mappedHandlers" having been specified), then
|
||||
* delegates to the {@link #doResolveException} template method.
|
||||
*/
|
||||
@Override
|
||||
public ModelAndView resolveException(RenderRequest request, RenderResponse response, Object handler, Exception ex) {
|
||||
if (shouldApplyTo(request, handler)) {
|
||||
return doResolveException(request, response, handler, ex);
|
||||
@@ -133,6 +135,7 @@ public abstract class AbstractHandlerExceptionResolver implements HandlerExcepti
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView resolveException(ResourceRequest request, ResourceResponse response, Object handler, Exception ex) {
|
||||
if (shouldApplyTo(request, handler)) {
|
||||
return doResolveException(request, response, handler, ex);
|
||||
|
||||
@@ -63,6 +63,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
@@ -201,6 +202,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
|
||||
* @return the corresponding handler instance, or the default handler
|
||||
* @see #getHandlerInternal
|
||||
*/
|
||||
@Override
|
||||
public final HandlerExecutionChain getHandler(PortletRequest request) throws Exception {
|
||||
Object handler = getHandlerInternal(request);
|
||||
if (handler == null) {
|
||||
|
||||
@@ -43,6 +43,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -52,6 +53,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #afterCompletion}.
|
||||
*/
|
||||
@Override
|
||||
public void afterActionCompletion(
|
||||
ActionRequest request, ActionResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
@@ -63,6 +65,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -72,6 +75,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation is empty.
|
||||
*/
|
||||
@Override
|
||||
public void postHandleRender(
|
||||
RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
@@ -80,6 +84,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #afterCompletion}.
|
||||
*/
|
||||
@Override
|
||||
public void afterRenderCompletion(
|
||||
RenderRequest request, RenderResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
@@ -91,6 +96,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -100,6 +106,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation is empty.
|
||||
*/
|
||||
@Override
|
||||
public void postHandleResource(
|
||||
ResourceRequest request, ResourceResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
@@ -108,6 +115,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #afterCompletion}.
|
||||
*/
|
||||
@Override
|
||||
public void afterResourceCompletion(
|
||||
ResourceRequest request, ResourceResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
@@ -119,6 +127,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleEvent(EventRequest request, EventResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -128,6 +137,7 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #afterCompletion}.
|
||||
*/
|
||||
@Override
|
||||
public void afterEventCompletion(
|
||||
EventRequest request, EventResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
|
||||
@@ -63,21 +63,25 @@ public class SimplePortletHandlerAdapter implements HandlerAdapter, PortletConte
|
||||
private PortletContext portletContext;
|
||||
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supports(Object handler) {
|
||||
return (handler instanceof Portlet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleAction(ActionRequest request, ActionResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
((Portlet) handler).processAction(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -85,6 +89,7 @@ public class SimplePortletHandlerAdapter implements HandlerAdapter, PortletConte
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -98,6 +103,7 @@ public class SimplePortletHandlerAdapter implements HandlerAdapter, PortletConte
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception {
|
||||
if (handler instanceof EventPortlet) {
|
||||
((EventPortlet) handler).processEvent(request, response);
|
||||
|
||||
@@ -92,19 +92,23 @@ public class SimplePortletPostProcessor
|
||||
this.useSharedPortletConfig = useSharedPortletConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletConfig(PortletConfig portletConfig) {
|
||||
this.portletConfig = portletConfig;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof Portlet) {
|
||||
PortletConfig config = this.portletConfig;
|
||||
@@ -121,6 +125,7 @@ public class SimplePortletPostProcessor
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof Portlet) {
|
||||
((Portlet) bean).destroy();
|
||||
@@ -146,46 +151,57 @@ public class SimplePortletPostProcessor
|
||||
this.portletConfig = portletConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPortletName() {
|
||||
return this.portletName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletContext getPortletContext() {
|
||||
return this.portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInitParameter(String paramName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getInitParameterNames() {
|
||||
return Collections.enumeration(new HashSet<String>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceBundle getResourceBundle(Locale locale) {
|
||||
return (this.portletConfig != null ? this.portletConfig.getResourceBundle(locale) : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getPublicRenderParameterNames() {
|
||||
return Collections.enumeration(new HashSet<String>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultNamespace() {
|
||||
return XMLConstants.NULL_NS_URI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<QName> getPublishingEventQNames() {
|
||||
return Collections.enumeration(new HashSet<QName>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<QName> getProcessingEventQNames() {
|
||||
return Collections.enumeration(new HashSet<QName>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<Locale> getSupportedLocales() {
|
||||
return Collections.enumeration(new HashSet<Locale>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getContainerRuntimeOptions() {
|
||||
return (this.portletConfig != null ? this.portletConfig.getContainerRuntimeOptions() : null);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler) throws Exception {
|
||||
if (!this.renderPhaseOnly) {
|
||||
this.requestInterceptor.preHandle(new PortletWebRequest(request));
|
||||
@@ -83,6 +84,7 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterActionCompletion(
|
||||
ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception {
|
||||
|
||||
@@ -91,11 +93,13 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler) throws Exception {
|
||||
this.requestInterceptor.preHandle(new PortletWebRequest(request));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandleRender(
|
||||
RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
||||
|
||||
@@ -103,12 +107,14 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
(modelAndView != null && !modelAndView.wasCleared() ? modelAndView.getModelMap() : null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterRenderCompletion(
|
||||
RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception {
|
||||
|
||||
this.requestInterceptor.afterCompletion(new PortletWebRequest(request), ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -116,6 +122,7 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandleResource(ResourceRequest request, ResourceResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
|
||||
@@ -123,17 +130,20 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
(modelAndView != null ? modelAndView.getModelMap() : null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterResourceCompletion(ResourceRequest request, ResourceResponse response, Object handler,
|
||||
Exception ex) throws Exception {
|
||||
|
||||
this.requestInterceptor.afterCompletion(new PortletWebRequest(request), ex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean preHandleEvent(EventRequest request, EventResponse response, Object handler) throws Exception {
|
||||
this.requestInterceptor.preHandle(new PortletWebRequest(request));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterEventCompletion(EventRequest request, EventResponse response, Object handler, Exception ex)
|
||||
throws Exception {
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
|
||||
return new PortletFileUpload(fileItemFactory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
if (!isUploadTempDirSpecified()) {
|
||||
getFileItemFactory().setRepository(PortletUtils.getTempDir(portletContext));
|
||||
@@ -113,10 +114,12 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isMultipart(ActionRequest request) {
|
||||
return (request != null && PortletFileUpload.isMultipartContent(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultipartActionRequest resolveMultipart(final ActionRequest request) throws MultipartException {
|
||||
Assert.notNull(request, "Request must not be null");
|
||||
if (this.resolveLazily) {
|
||||
@@ -177,6 +180,7 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
|
||||
return encoding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanupMultipart(MultipartActionRequest request) {
|
||||
if (request != null) {
|
||||
try {
|
||||
|
||||
@@ -74,14 +74,17 @@ public class DefaultMultipartActionRequest extends ActionRequestWrapper implemen
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Iterator<String> getFileNames() {
|
||||
return getMultipartFiles().keySet().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultipartFile getFile(String name) {
|
||||
return getMultipartFiles().getFirst(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MultipartFile> getFiles(String name) {
|
||||
List<MultipartFile> multipartFiles = getMultipartFiles().get(name);
|
||||
if (multipartFiles != null) {
|
||||
@@ -93,10 +96,12 @@ public class DefaultMultipartActionRequest extends ActionRequestWrapper implemen
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, MultipartFile> getFileMap() {
|
||||
return getMultipartFiles().toSingleValueMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiValueMap<String, MultipartFile> getMultiFileMap() {
|
||||
return getMultipartFiles();
|
||||
}
|
||||
@@ -138,6 +143,7 @@ public class DefaultMultipartActionRequest extends ActionRequestWrapper implemen
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMultipartContentType(String paramOrFileName) {
|
||||
MultipartFile file = getFile(paramOrFileName);
|
||||
if (file != null) {
|
||||
|
||||
@@ -180,6 +180,7 @@ public abstract class AbstractController extends PortletContentGenerator impleme
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleActionRequest(ActionRequest request, ActionResponse response) throws Exception {
|
||||
// Delegate to PortletContentGenerator for checking and preparing.
|
||||
check(request, response);
|
||||
@@ -199,6 +200,7 @@ public abstract class AbstractController extends PortletContentGenerator impleme
|
||||
handleActionRequestInternal(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) throws Exception {
|
||||
// If the portlet is minimized and we don't want to render then return null.
|
||||
if (WindowState.MINIMIZED.equals(request.getWindowState()) && !this.renderWhenMinimized) {
|
||||
|
||||
@@ -40,10 +40,12 @@ import org.springframework.web.portlet.ModelAndView;
|
||||
*/
|
||||
public class PortletModeNameViewController implements Controller {
|
||||
|
||||
@Override
|
||||
public void handleActionRequest(ActionRequest request, ActionResponse response) throws Exception {
|
||||
throw new PortletException("PortletModeNameViewController does not handle action requests");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRenderRequest(RenderRequest request, RenderResponse response) {
|
||||
return new ModelAndView(request.getPortletMode().toString());
|
||||
}
|
||||
|
||||
@@ -117,6 +117,7 @@ public class PortletWrappingController extends AbstractController
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletConfig(PortletConfig portletConfig) {
|
||||
this.portletConfig = portletConfig;
|
||||
}
|
||||
@@ -146,11 +147,13 @@ public class PortletWrappingController extends AbstractController
|
||||
this.initParameters = initParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanName(String name) {
|
||||
this.beanName = name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (this.portletClass == null) {
|
||||
throw new IllegalArgumentException("portletClass is required");
|
||||
@@ -186,6 +189,7 @@ public class PortletWrappingController extends AbstractController
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResourceRequest(
|
||||
ResourceRequest request, ResourceResponse response) throws Exception {
|
||||
|
||||
@@ -214,6 +218,7 @@ public class PortletWrappingController extends AbstractController
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEventRequest(
|
||||
EventRequest request, EventResponse response) throws Exception {
|
||||
|
||||
@@ -242,6 +247,7 @@ public class PortletWrappingController extends AbstractController
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.portletInstance.destroy();
|
||||
}
|
||||
@@ -255,46 +261,57 @@ public class PortletWrappingController extends AbstractController
|
||||
*/
|
||||
private class DelegatingPortletConfig implements PortletConfig {
|
||||
|
||||
@Override
|
||||
public String getPortletName() {
|
||||
return portletName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletContext getPortletContext() {
|
||||
return portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInitParameter(String paramName) {
|
||||
return initParameters.get(paramName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getInitParameterNames() {
|
||||
return Collections.enumeration(initParameters.keySet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceBundle getResourceBundle(Locale locale) {
|
||||
return (portletConfig != null ? portletConfig.getResourceBundle(locale) : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<String> getPublicRenderParameterNames() {
|
||||
return Collections.enumeration(new HashSet<String>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultNamespace() {
|
||||
return XMLConstants.NULL_NS_URI;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<QName> getPublishingEventQNames() {
|
||||
return Collections.enumeration(new HashSet<QName>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<QName> getProcessingEventQNames() {
|
||||
return Collections.enumeration(new HashSet<QName>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enumeration<Locale> getSupportedLocales() {
|
||||
return Collections.enumeration(new HashSet<Locale>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String[]> getContainerRuntimeOptions() {
|
||||
return (portletConfig != null ? portletConfig.getContainerRuntimeOptions() : null);
|
||||
}
|
||||
|
||||
@@ -49,27 +49,32 @@ public class SimpleControllerHandlerAdapter implements HandlerAdapter, PortletCo
|
||||
private PortletContext portletContext;
|
||||
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supports(Object handler) {
|
||||
return (handler instanceof Controller);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleAction(ActionRequest request, ActionResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
((Controller) handler).handleActionRequest(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
return ((Controller) handler).handleRenderRequest(request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -83,6 +88,7 @@ public class SimpleControllerHandlerAdapter implements HandlerAdapter, PortletCo
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception {
|
||||
if (handler instanceof EventAwareController) {
|
||||
((EventAwareController) handler).handleEventRequest(request, response);
|
||||
|
||||
@@ -263,10 +263,12 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (beanFactory instanceof ConfigurableBeanFactory) {
|
||||
this.beanFactory = (ConfigurableBeanFactory) beanFactory;
|
||||
@@ -275,10 +277,12 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean supports(Object handler) {
|
||||
return getMethodResolver(handler).hasHandlerMethods();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleAction(ActionRequest request, ActionResponse response, Object handler) throws Exception {
|
||||
Object returnValue = doHandle(request, response, handler);
|
||||
if (returnValue != null) {
|
||||
@@ -286,16 +290,19 @@ public class AnnotationMethodHandlerAdapter extends PortletContentGenerator
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler) throws Exception {
|
||||
checkAndPrepare(request, response);
|
||||
return doHandle(request, response, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler) throws Exception {
|
||||
checkAndPrepare(request, response);
|
||||
return doHandle(request, response, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception {
|
||||
Object returnValue = doHandle(request, response, handler);
|
||||
if (returnValue != null) {
|
||||
|
||||
@@ -153,6 +153,7 @@ public class AnnotationMethodHandlerExceptionResolver extends AbstractHandlerExc
|
||||
final Map<Class<? extends Throwable>, Method> matchedHandlers = new HashMap<Class<? extends Throwable>, Method>();
|
||||
|
||||
ReflectionUtils.doWithMethods(handlerType, new ReflectionUtils.MethodCallback() {
|
||||
@Override
|
||||
public void doWith(Method method) {
|
||||
method = ClassUtils.getMostSpecificMethod(method, handlerType);
|
||||
List<Class<? extends Throwable>> handledExceptions = getHandledExceptions(method);
|
||||
|
||||
@@ -148,6 +148,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
handlerTypes.addAll(Arrays.asList(handlerType.getInterfaces()));
|
||||
for (Class<?> currentHandlerType : handlerTypes) {
|
||||
ReflectionUtils.doWithMethods(currentHandlerType, new ReflectionUtils.MethodCallback() {
|
||||
@Override
|
||||
public void doWith(Method method) {
|
||||
PortletRequestMappingPredicate predicate = null;
|
||||
String[] modeKeys = new String[0];
|
||||
@@ -229,6 +230,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(PortletRequest request) {
|
||||
return PortletAnnotationMappingUtils.checkParameters(this.params, request);
|
||||
}
|
||||
@@ -262,6 +264,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) throws PortletException {
|
||||
if (!PortletAnnotationMappingUtils.checkHeaders(this.headers, request)) {
|
||||
throw new PortletRequestBindingException("Header conditions \"" +
|
||||
@@ -279,6 +282,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
return (other instanceof SpecialRequestTypePredicate ? -1 : compareParams(other));
|
||||
}
|
||||
@@ -291,9 +295,11 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
super(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) throws PortletException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
return (other instanceof SpecialRequestTypePredicate ? 1 : compareParams(other));
|
||||
}
|
||||
@@ -316,9 +322,11 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
super.match(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
if (other instanceof TypeLevelMappingPredicate) {
|
||||
return 1;
|
||||
@@ -358,9 +366,11 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
super.match(request));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
if (other instanceof TypeLevelMappingPredicate) {
|
||||
return 1;
|
||||
@@ -392,14 +402,17 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(PortletRequest request) {
|
||||
return (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
|
||||
("".equals(this.resourceId) || this.resourceId.equals(((ResourceRequest) request).getResourceID())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
if (other instanceof ResourceMappingPredicate) {
|
||||
boolean hasResourceId = !"".equals(this.resourceId);
|
||||
@@ -424,6 +437,7 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
this.eventName = eventName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(PortletRequest request) {
|
||||
if (!PortletRequest.EVENT_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE))) {
|
||||
return false;
|
||||
@@ -435,9 +449,11 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
return (this.eventName.equals(event.getName()) || this.eventName.equals(event.getQName().toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
if (other instanceof EventMappingPredicate) {
|
||||
boolean hasEventName = !"".equals(this.eventName);
|
||||
|
||||
Reference in New Issue
Block a user