类 CachingDestinationResolverProxy<D>
- java.lang.Object
- org.springframework.messaging.core.CachingDestinationResolverProxy<D>
- 类型参数:
D
- the destination type
- 所有已实现的接口:
InitializingBean
,DestinationResolver<D>
public class CachingDestinationResolverProxy<D> extends Object implements DestinationResolver<D>, InitializingBean
DestinationResolver
implementation that proxies a target DestinationResolver, caching itsresolveDestination(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.- 从以下版本开始:
- 4.1
- 作者:
- Agim Emruli, Juergen Hoeller
- 另请参阅:
DestinationResolver.resolveDestination(java.lang.String)
构造器概要
构造器 构造器 说明 CachingDestinationResolverProxy()
Create a new CachingDestinationResolverProxy, setting the target DestinationResolver through thesetTargetDestinationResolver(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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,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.
构造器详细资料
CachingDestinationResolverProxy
public CachingDestinationResolverProxy()
Create a new CachingDestinationResolverProxy, setting the target DestinationResolver through thesetTargetDestinationResolver(org.springframework.messaging.core.DestinationResolver<D>)
bean property.
CachingDestinationResolverProxy
public CachingDestinationResolverProxy(DestinationResolver<D> targetDestinationResolver)
Create a new CachingDestinationResolverProxy using the given target DestinationResolver to actually resolve destinations.- 参数:
targetDestinationResolver
- the target DestinationResolver to delegate to
方法详细资料
setTargetDestinationResolver
public void setTargetDestinationResolver(DestinationResolver<D> targetDestinationResolver)
Set the target DestinationResolver to delegate to.
afterPropertiesSet
public void afterPropertiesSet()
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,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
在接口中InitializingBean
resolveDestination
public D resolveDestination(String name) throws DestinationResolutionException
Resolves and caches destinations if successfully resolved by the target DestinationResolver implementation.- 指定者:
resolveDestination
在接口中DestinationResolver<D>
- 参数:
name
- the destination name to be resolved- 返回:
- the currently resolved destination or an already cached destination
- 抛出:
DestinationResolutionException
- if the target DestinationResolver reports an error during destination resolution