|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.context.support.ApplicationObjectSupport org.springframework.web.portlet.handler.AbstractHandlerMapping org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
public abstract class AbstractMapBasedHandlerMapping
Abstract base class for HandlerMapping implementations that rely on a map which caches handler objects per lookup key. Supports arbitrary lookup keys, and automatically resolves handler bean names into handler bean instances.
getLookupKey(javax.portlet.PortletRequest)
,
registerHandler(Object, Object)
Field Summary |
---|
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AbstractMapBasedHandlerMapping()
|
Method Summary | |
---|---|
protected Object |
getHandlerInternal(PortletRequest request)
Determines a handler for the computed lookup key for the given request. |
protected abstract Object |
getLookupKey(PortletRequest request)
Build a lookup key for the given request. |
protected void |
registerHandler(Object lookupKey,
Object handler)
Register the given handler instance for the given parameter value. |
protected void |
registerHandlers(Map handlerMap)
Register all handlers specified in the Portlet mode map for the corresponding modes. |
void |
setLazyInitHandlers(boolean lazyInitHandlers)
Set whether to lazily initialize handlers. |
Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping |
---|
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initApplicationContext, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, isContextRequired, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMapBasedHandlerMapping()
Method Detail |
---|
public void setLazyInitHandlers(boolean lazyInitHandlers)
If you want to allow your handlers to be lazily initialized, make them "lazy-init" and set this flag to true. Just making them "lazy-init" will not work, as they are initialized through the references from the handler mapping in this case.
protected Object getHandlerInternal(PortletRequest request) throws Exception
getHandlerInternal
in class AbstractHandlerMapping
request
- current portlet request
null
if none found
Exception
- if there is an internal errorgetLookupKey(javax.portlet.PortletRequest)
protected abstract Object getLookupKey(PortletRequest request) throws Exception
request
- current portlet request
null
)
Exception
- if key computation failedprotected void registerHandlers(Map handlerMap) throws BeansException
handlerMap
- Map with lookup keys as keys and handler beans or bean names as values
BeansException
- if the handler couldn't be registeredprotected void registerHandler(Object lookupKey, Object handler) throws BeansException, IllegalStateException
lookupKey
- the key to map the handler ontohandler
- the handler instance or handler bean name String
(a bean name will automatically be resolved into the corrresponding handler bean)
BeansException
- if the handler couldn't be registered
IllegalStateException
- if there is a conflicting handler registered
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |