spring-framework / org.springframework.messaging.core / CachingDestinationResolverProxy

CachingDestinationResolverProxy

open class CachingDestinationResolverProxy<D : Any> : DestinationResolver<D>, InitializingBean

DestinationResolver implementation that proxies a target DestinationResolver, caching its #resolveDestination 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.

Author
Agim Emruli

Author
Juergen Hoeller

Since
4.1

See Also
DestinationResolver#resolveDestination

Constructors

<init>

CachingDestinationResolverProxy()

Create a new CachingDestinationResolverProxy, setting the target DestinationResolver through the #setTargetDestinationResolver bean property.

CachingDestinationResolverProxy(targetDestinationResolver: DestinationResolver<D>)

Create a new CachingDestinationResolverProxy using the given target DestinationResolver to actually resolve destinations.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

resolveDestination

open fun resolveDestination(name: String): D

Resolves and caches destinations if successfully resolved by the target DestinationResolver implementation.

setTargetDestinationResolver

open fun setTargetDestinationResolver(targetDestinationResolver: DestinationResolver<D>): Unit

Set the target DestinationResolver to delegate to.