Known Direct Subclasses
|
Class Overview
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.
Summary
Nested Classes |
interface |
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate |
Predicate interface for determining a match with a given request. |
Public Methods |
void
|
setLazyInitHandlers(boolean lazyInitHandlers)
Set whether to lazily initialize handlers.
|
Public Constructors
public
AbstractMapBasedHandlerMapping
()
Public Methods
public
void
setLazyInitHandlers
(boolean lazyInitHandlers)
Set whether to lazily initialize handlers. Only applicable to
singleton handlers, as prototypes are always lazily initialized.
Default is false, as eager initialization allows for more efficiency
through referencing the handler objects directly.
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 Methods
protected
Object
getHandlerInternal
(PortletRequest request)
Determines a handler for the computed lookup key for the given request.
Parameters
request
| current portlet request |
Returns
- the corresponding handler instance, or
null
if none found
protected
abstract
K
getLookupKey
(PortletRequest request)
Build a lookup key for the given request.
Parameters
request
| current portlet request |
Returns
- the lookup key (never
null
)
Register the given handler instance for the given parameter value.
Parameters
lookupKey
| the key to map the handler onto |
handler
| the handler instance or handler bean name String
(a bean name will automatically be resolved into the corresponding handler bean) |
predicate
| a predicate object for this handler (may be null ),
determining a match with the primary lookup key |
protected
void
registerHandler
(K lookupKey, Object handler)
Register the given handler instance for the given parameter value.
Parameters
lookupKey
| the key to map the handler onto |
handler
| the handler instance or handler bean name String
(a bean name will automatically be resolved into the corresponding handler bean) |
protected
void
registerHandlers
(Map<K, ?> handlerMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.
Parameters
handlerMap
| Map with lookup keys as keys and handler beans or bean names as values |