DestinationResolver implementation which interprets destination names
as JNDI locations (with a configurable fallback strategy).
Allows for customizing the JNDI environment if necessary, for example specifying appropriate JNDI environment properties.
Dynamic queues and topics get cached by destination name. As a consequence,
you need to use unique destination names across both queues and topics.
Caching can be turned off through the "cache" flag.
Note that the fallback to resolution of dynamic destinations
is turned off by default. Switch the
"fallbackToDynamicDestination"
flag on to enable this functionality.
setJndiTemplate, setJndiEnvironment, setCache, setFallbackToDynamicDestination
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final Map | |
| private DestinationResolver | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | clearCache()
Implements org. Clear the entire destination cache. |
| public void | removeFromCache(String
the name of the destination destinationName)Implements org. Remove the destination with the given name from the cache (if cached by this resolver in the first place). |
| public Destination | resolveDestinationName(Session
the current JMS Session
(may be session, String null if the resolver implementation is able to work without it)the name of the destination destinationName, boolean true if the domain is pub-sub, false if P2PImplements org. Resolve the given destination name, either as located resource or as dynamic destination. |
| public void | |
| public void | setDynamicDestinationResolver(DestinationResolver dynamicDestinationResolver)
Set the |
| public void | setFallbackToDynamicDestination(boolean fallbackToDynamicDestination)
Set whether this resolver is supposed to create dynamic destinations if the destination name is not found in JNDI. |
| protected void | validateDestination(Destination
the Destination object to validate destination, String the name of the destination destinationName, boolean true if a Topic is expected,
false in case of a QueueValidate the given Destination object, checking whether it matches the expected type. |
| cache | back to summary |
|---|---|
| private boolean cache | |
| destinationCache | back to summary |
|---|---|
| private final Map<String, Destination> destinationCache | |
| dynamicDestinationResolver | back to summary |
|---|---|
| private DestinationResolver dynamicDestinationResolver | |
| fallbackToDynamicDestination | back to summary |
|---|---|
| private boolean fallbackToDynamicDestination | |
| JndiDestinationResolver | back to summary |
|---|---|
| public JndiDestinationResolver() | |
| clearCache | back to summary |
|---|---|
| public void clearCache() Implements org. Doc from org. Clear the entire destination cache. To be called in case of general JMS provider failure.
| |
| removeFromCache | back to summary |
|---|---|
| public void removeFromCache(String destinationName) Implements org. Doc from org. Remove the destination with the given name from the cache (if cached by this resolver in the first place). To be called if access to the specified destination failed, assuming that the JMS Destination object might have become invalid. | |
| resolveDestinationName | back to summary |
|---|---|
| public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException Implements org. Doc from org. Resolve the given destination name, either as located resource or as dynamic destination.
| |
| setCache | back to summary |
|---|---|
| public void setCache(boolean cache) Set whether to cache resolved destinations. Default is "true". This flag can be turned off to re-lookup a destination for each operation, which allows for hot restarting of destinations. This is mainly useful during development. Note that dynamic queues and topics get cached by destination name. As a consequence, you need to use unique destination names across both queues and topics. | |
| setDynamicDestinationResolver | back to summary |
|---|---|
| public void setDynamicDestinationResolver(DestinationResolver dynamicDestinationResolver) Set the The default is Spring's standard | |
| setFallbackToDynamicDestination | back to summary |
|---|---|
| public void setFallbackToDynamicDestination(boolean fallbackToDynamicDestination) Set whether this resolver is supposed to create dynamic destinations if the destination name is not found in JNDI. Default is "false". Turn this flag on to enable transparent fallback to dynamic destinations.
| |
| validateDestination | back to summary |
|---|---|
| protected void validateDestination(Destination destination, String destinationName, boolean pubSubDomain) Validate the given Destination object, checking whether it matches the expected type.
| |