org.exolab.jms.messagemgr
Interface DestinationManager

All Superinterfaces:
GarbageCollectable, MessageManagerEventListener
All Known Implementing Classes:
DestinationManagerImpl

public interface DestinationManager
extends MessageManagerEventListener, GarbageCollectable

DestinationManager is responsible for creating and managing the lifecycle of DestinationCache objects. The destination manager is also responsible for managing messages that are received by the message manager, which do not have any registered DestinationCache.

Version:
$Revision: 1.4 $ $Date: 2005/11/12 10:58:40 $
Author:
Tim Anderson

Method Summary
 void addDestinationEventListener(DestinationEventListener listener)
          Register an event listener to be notified when destinations are created and destroyed.
 void createDestination(JmsDestination destination)
          Create a destination.
 JmsDestination getDestination(java.lang.String name)
          Returns a destination given its name.
 DestinationCache getDestinationCache(JmsDestination destination)
          Returns the cache for the supplied destination.
 java.util.List getDestinations()
          Returns all destinations.
 java.util.Map getTopicDestinationCaches(JmsTopic topic)
          Returns a map of all destinations that match the specified topic.
 void removeDestination(JmsDestination destination)
          Remove a destination.
 void removeDestinationEventListener(DestinationEventListener listener)
          Remove an event listener.
 
Methods inherited from interface org.exolab.jms.messagemgr.MessageManagerEventListener
messageAdded, persistentMessageAdded
 
Methods inherited from interface org.exolab.jms.gc.GarbageCollectable
collectGarbage
 

Method Detail

getDestinationCache

public DestinationCache getDestinationCache(JmsDestination destination)
                                     throws javax.jms.JMSException
Returns the cache for the supplied destination.

If the cache doesn't exist, it will be created, and any registered DestinationEventListeners will be notified.

Parameters:
destination - the destination of the cache to return
Returns:
the cache associated with destination
Throws:
javax.jms.InvalidDestinationException - if destination doesn't exist
javax.jms.JMSException - if the cache can't be created

getDestination

public JmsDestination getDestination(java.lang.String name)
Returns a destination given its name.
Parameters:
name - the name of the destination
Returns:
the destination corresponding to name or null if none exists

createDestination

public void createDestination(JmsDestination destination)
                       throws javax.jms.JMSException
Create a destination.

Any registered DestinationEventListeners will be notified.

Parameters:
destination - the destination to create
Throws:
javax.jms.InvalidDestinationException - if the destination already exists or is a wildcard destination
javax.jms.JMSException - if the destination can't be created

removeDestination

public void removeDestination(JmsDestination destination)
                       throws javax.jms.JMSException
Remove a destination.

All messages and durable consumers will be removed. Any registered DestinationEventListeners will be notified.

Parameters:
destination - the destination to remove
Throws:
javax.jms.InvalidDestinationException - if the destination is invalid.
javax.jms.JMSException - if the destination can't be removed

getDestinations

public java.util.List getDestinations()
                               throws javax.jms.JMSException
Returns all destinations.
Returns:
a list of JmsDestination instances.
Throws:
javax.jms.JMSException - for any JMS error

getTopicDestinationCaches

public java.util.Map getTopicDestinationCaches(JmsTopic topic)
Returns a map of all destinations that match the specified topic.

If the topic represents a wildcard then it may match none, one or more destinations.

Parameters:
topic - the topic
Returns:
a map of topics to DestinationCache instances

addDestinationEventListener

public void addDestinationEventListener(DestinationEventListener listener)
Register an event listener to be notified when destinations are created and destroyed.
Parameters:
listener - the listener to add

removeDestinationEventListener

public void removeDestinationEventListener(DestinationEventListener listener)
Remove an event listener.
Parameters:
listener - the listener to remove


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.