D
- the destination typepublic class CachingDestinationResolverProxy<D> extends Object implements DestinationResolver<D>, InitializingBean
DestinationResolver
implementation that proxies a target DestinationResolver,
caching its resolveDestination(java.lang.String)
results. Such caching is particularly useful
if the destination resolving process is expensive (e.g. the destination has to be
resolved through an external system) and the resolution results are stable anyway.DestinationResolver.resolveDestination(java.lang.String)
Constructor and Description |
---|
CachingDestinationResolverProxy()
Create a new CachingDestinationResolverProxy, setting the target DestinationResolver
through the
setTargetDestinationResolver(org.springframework.messaging.core.DestinationResolver<D>) bean property. |
CachingDestinationResolverProxy(DestinationResolver<D> targetDestinationResolver)
Create a new CachingDestinationResolverProxy using the given target
DestinationResolver to actually resolve destinations.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware , ApplicationContextAware etc. |
D |
resolveDestination(String name)
Resolves and caches destinations if successfully resolved by the target
DestinationResolver implementation.
|
void |
setTargetDestinationResolver(DestinationResolver<D> targetDestinationResolver)
Set the target DestinationResolver to delegate to.
|
public CachingDestinationResolverProxy()
setTargetDestinationResolver(org.springframework.messaging.core.DestinationResolver<D>)
bean property.public CachingDestinationResolverProxy(DestinationResolver<D> targetDestinationResolver)
targetDestinationResolver
- the target DestinationResolver to delegate topublic void setTargetDestinationResolver(DestinationResolver<D> targetDestinationResolver)
public void afterPropertiesSet()
InitializingBean
BeanFactory
after it has set all bean properties
and satisfied BeanFactoryAware
, ApplicationContextAware
etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
afterPropertiesSet
in interface InitializingBean
public D resolveDestination(String name) throws DestinationResolutionException
resolveDestination
in interface DestinationResolver<D>
name
- the destination name to be resolvedDestinationResolutionException
- if the target DestinationResolver
reports an error during destination resolution