Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit45fa50821a, reversing changes made toa312d900f8.
This commit is contained in:
@@ -421,7 +421,6 @@ 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,7 +174,6 @@ 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;
|
||||
@@ -185,7 +184,6 @@ 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,22 +104,18 @@ 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) {
|
||||
@@ -127,12 +123,10 @@ 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) {
|
||||
@@ -140,7 +134,6 @@ public abstract class AbstractRefreshablePortletApplicationContext extends Abstr
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return this.namespace;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,6 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class RequestObjectFactory implements ObjectFactory<PortletRequest>, Serializable {
|
||||
|
||||
@Override
|
||||
public PortletRequest getObject() {
|
||||
return currentRequestAttributes().getRequest();
|
||||
}
|
||||
@@ -262,7 +261,6 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class SessionObjectFactory implements ObjectFactory<PortletSession>, Serializable {
|
||||
|
||||
@Override
|
||||
public PortletSession getObject() {
|
||||
return currentRequestAttributes().getRequest().getPortletSession();
|
||||
}
|
||||
@@ -280,7 +278,6 @@ public abstract class PortletApplicationContextUtils {
|
||||
@SuppressWarnings("serial")
|
||||
private static class WebRequestObjectFactory implements ObjectFactory<WebRequest>, Serializable {
|
||||
|
||||
@Override
|
||||
public WebRequest getObject() {
|
||||
return new PortletWebRequest(currentRequestAttributes().getRequest());
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ public abstract class PortletApplicationObjectSupport extends ApplicationObjectS
|
||||
private PortletContext portletContext;
|
||||
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@ 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);
|
||||
@@ -80,7 +79,6 @@ public class PortletContextAwareProcessor implements BeanPostProcessor {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ 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) {
|
||||
@@ -189,12 +188,10 @@ 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,7 +62,6 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object get(String name, ObjectFactory<?> objectFactory) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject == null) {
|
||||
@@ -72,7 +71,6 @@ public class PortletContextScope implements Scope, DisposableBean {
|
||||
return scopedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object remove(String name) {
|
||||
Object scopedObject = this.portletContext.getAttribute(name);
|
||||
if (scopedObject != null) {
|
||||
@@ -85,17 +83,14 @@ 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;
|
||||
}
|
||||
@@ -106,7 +101,6 @@ 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,7 +100,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getAttribute(String name, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -137,7 +136,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAttribute(String name, Object value, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -163,7 +161,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAttribute(String name, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (isRequestActive()) {
|
||||
@@ -190,7 +187,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getAttributeNames(int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
if (!isRequestActive()) {
|
||||
@@ -215,7 +211,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerDestructionCallback(String name, Runnable callback, int scope) {
|
||||
if (scope == SCOPE_REQUEST) {
|
||||
registerRequestDestructionCallback(name, callback);
|
||||
@@ -225,7 +220,6 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resolveReference(String key) {
|
||||
if (REFERENCE_REQUEST.equals(key)) {
|
||||
return this.request;
|
||||
@@ -238,12 +232,10 @@ public class PortletRequestAttributes extends AbstractRequestAttributes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSessionId() {
|
||||
return getSession(true).getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSessionMutex() {
|
||||
return PortletUtils.getSessionMutex(getSession(true));
|
||||
}
|
||||
|
||||
@@ -68,91 +68,74 @@ 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();
|
||||
}
|
||||
@@ -161,7 +144,6 @@ 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;
|
||||
}
|
||||
@@ -170,12 +152,10 @@ 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,22 +101,18 @@ 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) {
|
||||
@@ -124,12 +120,10 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PortletConfig getPortletConfig() {
|
||||
return this.portletConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNamespace(String namespace) {
|
||||
this.namespace = namespace;
|
||||
if (namespace != null) {
|
||||
@@ -137,7 +131,6 @@ public class StaticPortletApplicationContext extends StaticApplicationContext
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return this.namespace;
|
||||
}
|
||||
@@ -146,7 +139,6 @@ 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");
|
||||
@@ -157,14 +149,12 @@ 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,7 +61,6 @@ public abstract class AbstractHandlerExceptionResolver implements HandlerExcepti
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
@@ -125,7 +124,6 @@ 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);
|
||||
@@ -135,7 +133,6 @@ 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,7 +63,6 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport im
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
@@ -202,7 +201,6 @@ 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,7 +43,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleAction(ActionRequest request, ActionResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -53,7 +52,6 @@ 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 {
|
||||
@@ -65,7 +63,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -75,7 +72,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation is empty.
|
||||
*/
|
||||
@Override
|
||||
public void postHandleRender(
|
||||
RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
@@ -84,7 +80,6 @@ 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 {
|
||||
@@ -96,7 +91,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -106,7 +100,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation is empty.
|
||||
*/
|
||||
@Override
|
||||
public void postHandleResource(
|
||||
ResourceRequest request, ResourceResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
@@ -115,7 +108,6 @@ 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 {
|
||||
@@ -127,7 +119,6 @@ public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
/**
|
||||
* This implementation delegates to {@link #preHandle}.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandleEvent(EventRequest request, EventResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -137,7 +128,6 @@ 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,25 +63,21 @@ 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 {
|
||||
|
||||
@@ -89,7 +85,6 @@ public class SimplePortletHandlerAdapter implements HandlerAdapter, PortletConte
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler)
|
||||
throws Exception {
|
||||
|
||||
@@ -103,7 +98,6 @@ 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,23 +92,19 @@ 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;
|
||||
@@ -125,7 +121,6 @@ public class SimplePortletPostProcessor
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
|
||||
if (bean instanceof Portlet) {
|
||||
((Portlet) bean).destroy();
|
||||
@@ -151,57 +146,46 @@ 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,7 +76,6 @@ 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));
|
||||
@@ -84,7 +83,6 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterActionCompletion(
|
||||
ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception {
|
||||
|
||||
@@ -93,13 +91,11 @@ 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 {
|
||||
|
||||
@@ -107,14 +103,12 @@ 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 {
|
||||
|
||||
@@ -122,7 +116,6 @@ public class WebRequestHandlerInterceptorAdapter implements HandlerInterceptor {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandleResource(ResourceRequest request, ResourceResponse response, Object handler, ModelAndView modelAndView)
|
||||
throws Exception {
|
||||
|
||||
@@ -130,20 +123,17 @@ 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,7 +106,6 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
|
||||
return new PortletFileUpload(fileItemFactory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletContext(PortletContext portletContext) {
|
||||
if (!isUploadTempDirSpecified()) {
|
||||
getFileItemFactory().setRepository(PortletUtils.getTempDir(portletContext));
|
||||
@@ -114,12 +113,10 @@ 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) {
|
||||
@@ -180,7 +177,6 @@ public class CommonsPortletMultipartResolver extends CommonsFileUploadSupport
|
||||
return encoding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanupMultipart(MultipartActionRequest request) {
|
||||
if (request != null) {
|
||||
try {
|
||||
|
||||
@@ -74,17 +74,14 @@ 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) {
|
||||
@@ -96,12 +93,10 @@ public class DefaultMultipartActionRequest extends ActionRequestWrapper implemen
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, MultipartFile> getFileMap() {
|
||||
return getMultipartFiles().toSingleValueMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiValueMap<String, MultipartFile> getMultiFileMap() {
|
||||
return getMultipartFiles();
|
||||
}
|
||||
@@ -143,7 +138,6 @@ public class DefaultMultipartActionRequest extends ActionRequestWrapper implemen
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMultipartContentType(String paramOrFileName) {
|
||||
MultipartFile file = getFile(paramOrFileName);
|
||||
if (file != null) {
|
||||
|
||||
@@ -180,7 +180,6 @@ 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);
|
||||
@@ -200,7 +199,6 @@ 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,12 +40,10 @@ 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,7 +117,6 @@ public class PortletWrappingController extends AbstractController
|
||||
this.portletContext = portletContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPortletConfig(PortletConfig portletConfig) {
|
||||
this.portletConfig = portletConfig;
|
||||
}
|
||||
@@ -147,13 +146,11 @@ 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");
|
||||
@@ -189,7 +186,6 @@ public class PortletWrappingController extends AbstractController
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView handleResourceRequest(
|
||||
ResourceRequest request, ResourceResponse response) throws Exception {
|
||||
|
||||
@@ -218,7 +214,6 @@ public class PortletWrappingController extends AbstractController
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEventRequest(
|
||||
EventRequest request, EventResponse response) throws Exception {
|
||||
|
||||
@@ -247,7 +242,6 @@ public class PortletWrappingController extends AbstractController
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.portletInstance.destroy();
|
||||
}
|
||||
@@ -261,57 +255,46 @@ 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,32 +49,27 @@ 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 {
|
||||
|
||||
@@ -88,7 +83,6 @@ 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,12 +263,10 @@ 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;
|
||||
@@ -277,12 +275,10 @@ 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) {
|
||||
@@ -290,19 +286,16 @@ 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,7 +153,6 @@ 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,7 +148,6 @@ 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];
|
||||
@@ -230,7 +229,6 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean match(PortletRequest request) {
|
||||
return PortletAnnotationMappingUtils.checkParameters(this.params, request);
|
||||
}
|
||||
@@ -264,7 +262,6 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(PortletRequest request) throws PortletException {
|
||||
if (!PortletAnnotationMappingUtils.checkHeaders(this.headers, request)) {
|
||||
throw new PortletRequestBindingException("Header conditions \"" +
|
||||
@@ -282,7 +279,6 @@ public class DefaultAnnotationHandlerMapping extends AbstractMapBasedHandlerMapp
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
return (other instanceof SpecialRequestTypePredicate ? -1 : compareParams(other));
|
||||
}
|
||||
@@ -295,11 +291,9 @@ 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));
|
||||
}
|
||||
@@ -322,11 +316,9 @@ 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;
|
||||
@@ -366,11 +358,9 @@ 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;
|
||||
@@ -402,17 +392,14 @@ 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);
|
||||
@@ -437,7 +424,6 @@ 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;
|
||||
@@ -449,11 +435,9 @@ 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