com.interface21.web.servlet.handler
Class AbstractHandlerMapping
java.lang.Object
|
+--com.interface21.context.support.ApplicationObjectSupport
|
+--com.interface21.web.servlet.handler.AbstractHandlerMapping
- All Implemented Interfaces:
- ApplicationContextAware, HandlerMapping, Ordered
- Direct Known Subclasses:
- AbstractUrlHandlerMapping
- public abstract class AbstractHandlerMapping
- extends ApplicationObjectSupport
- implements HandlerMapping, Ordered
Abstract base class for HandlerMapping implementations.
Provides the basic infrastructure and a handler initialization method that
cares about LocaleResolver. Supports a default handler.
- Since:
- 07.04.2003
- Author:
- Juergen Hoeller
- See Also:
getHandlerInternal(javax.servlet.http.HttpServletRequest)
|
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
|
Method Summary |
java.lang.Object |
getDefaultHandler()
Return the default handler. |
HandlerExecutionChain |
getHandler(javax.servlet.http.HttpServletRequest request)
Lookup a handler for the given request, falling back to the default
handler if no specific one is found. |
protected abstract java.lang.Object |
getHandlerInternal(javax.servlet.http.HttpServletRequest request)
Lookup a handler for the given request, returning null if no specific
one is found. |
int |
getOrder()
Return the order value of this object,
higher value meaning greater in terms of sorting.
|
void |
setDefaultHandler(java.lang.Object defaultHandler)
Set the default handler. |
void |
setInterceptors(java.util.List interceptors)
|
void |
setOrder(int order)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
AbstractHandlerMapping
public AbstractHandlerMapping()
setOrder
public void setOrder(int order)
getOrder
public int getOrder()
- Description copied from interface:
Ordered
- Return the order value of this object,
higher value meaning greater in terms of sorting.
Normally starting with 0 or 1, Integer.MAX_VALUE
indicating greatest.
Same order values will result in arbitrary positions
for the affected objects.
Higher value can be interpreted as lower priority,
consequently the first object has highest priority
(somewhat analogous to Servlet "load-on-startup" values).
- Specified by:
getOrder in interface Ordered
- Following copied from interface:
com.interface21.core.Ordered
- Returns:
- the order value
setDefaultHandler
public void setDefaultHandler(java.lang.Object defaultHandler)
- Set the default handler.
- Parameters:
defaultHandler - default handler instance, or null if none
getDefaultHandler
public java.lang.Object getDefaultHandler()
- Return the default handler.
- Returns:
- the default handler instance, or null if none
setInterceptors
public void setInterceptors(java.util.List interceptors)
getHandler
public final HandlerExecutionChain getHandler(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
- Lookup a handler for the given request, falling back to the default
handler if no specific one is found.
- Specified by:
getHandler in interface HandlerMapping
- Parameters:
request - current HTTP request- Returns:
- the looked up handler instance, or the default handler
getHandlerInternal
protected abstract java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
- Lookup a handler for the given request, returning null if no specific
one is found. This method is evaluated by getHandler, a null return
value will lead to the default handler, if one is set.
- Parameters:
request - current HTTP request- Returns:
- the looked up handler instance, or null
Rod Johnson and Spring contributors 2001-2003.