|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.exolab.jms.service.Service
|
+--org.exolab.jms.messagemgr.DestinationManagerImpl
The destination manager 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.
| Constructor Summary | |
DestinationManagerImpl(MessageManager messages,
DestinationCacheFactory factory,
DatabaseService database,
GarbageCollectionService collector)
Construct a new DestinationManagerImpl. |
|
| Method Summary | |
void |
addDestinationEventListener(DestinationEventListener listener)
Register an event listener to be notified when destinations are created and destroyed. |
void |
collectGarbage(boolean aggressive)
Perform any garbage collection on this resource. |
void |
createDestination(JmsDestination destination)
Create a destination. |
protected void |
destroyDestinationCache(DestinationCache cache)
Delete the specfied destination. |
protected void |
destroyDestinationCache(JmsDestination dest)
Delete the specfied destination. |
protected void |
doStart()
Start the service. |
protected void |
doStop()
Stop the service. |
protected boolean |
exists(java.lang.String name)
Determines if a destination exists. |
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. |
protected void |
init()
Initialises the destination manager. |
void |
messageAdded(JmsDestination destination,
MessageImpl message)
Invoked when the MessageManager receives a non-persistent
message. |
void |
persistentMessageAdded(JmsDestination destination,
MessageImpl message)
Invoked when the MessageManager receives a persistent message. |
void |
removeDestination(JmsDestination destination)
Remove a destination. |
void |
removeDestinationEventListener(DestinationEventListener listener)
Remove an event listener. |
void |
setConsumerManager(ConsumerManager consumers)
Sets the consumer manager. |
| Methods inherited from class org.exolab.jms.service.Service |
getName, isStarted, restart, start, stop, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public DestinationManagerImpl(MessageManager messages,
DestinationCacheFactory factory,
DatabaseService database,
GarbageCollectionService collector)
DestinationManagerImpl.messages - the message managerfactory - the destination cache factorydatabase - the database servicecollector - the garbage collection service| Method Detail |
public void setConsumerManager(ConsumerManager consumers)
consumers - the consumer manager
public DestinationCache getDestinationCache(JmsDestination destination)
throws javax.jms.JMSException
DestinationEventListeners will be notified.getDestinationCache in interface DestinationManagerdestination - the destination of the cache to returndestinationjavax.jms.InvalidDestinationException - if destination doesn't
existjavax.jms.JMSException - if the cache can't be createdpublic JmsDestination getDestination(java.lang.String name)
getDestination in interface DestinationManagername - the name of the destinationname or
null if none existspublic void addDestinationEventListener(DestinationEventListener listener)
addDestinationEventListener in interface DestinationManagerlistener - the listener to addpublic void removeDestinationEventListener(DestinationEventListener listener)
removeDestinationEventListener in interface DestinationManagerlistener - the listener to remove
public void createDestination(JmsDestination destination)
throws javax.jms.JMSException
DestinationEventListeners will be notified.createDestination in interface DestinationManagerdestination - the destination to createjavax.jms.InvalidDestinationException - if the destination already exists or
is a wildcard destinationjavax.jms.JMSException - if the destination can't be created
public void removeDestination(JmsDestination destination)
throws javax.jms.JMSException
DestinationEventListeners will be notified.removeDestination in interface DestinationManagerdestination - the destination to removejavax.jms.InvalidDestinationException - if the destination is invalidjavax.jms.JMSException - if the destination can't be removed
public void messageAdded(JmsDestination destination,
MessageImpl message)
throws javax.jms.JMSException
MessageManager receives a non-persistent
message.messageAdded in interface MessageManagerEventListenerdestination - the message's destinationmessage - the messagejavax.jms.JMSException - if the listener fails to handle the message
public void persistentMessageAdded(JmsDestination destination,
MessageImpl message)
throws javax.jms.JMSException,
PersistenceException
MessageManager receives a persistent message.persistentMessageAdded in interface MessageManagerEventListenerdestination - the message's destinationmessage - the messagejavax.jms.JMSException - if the listener fails to handle the messagePersistenceException - if there is a persistence related problem
public java.util.List getDestinations()
throws javax.jms.JMSException
getDestinations in interface DestinationManagerjavax.jms.JMSException - for any JMS errorpublic java.util.Map getTopicDestinationCaches(JmsTopic topic)
getTopicDestinationCaches in interface DestinationManagertopic - the topicpublic void collectGarbage(boolean aggressive)
collectGarbage in interface GarbageCollectableaggressive - true for aggressive garbage collection
protected void doStart()
throws ServiceException
doStart in class ServiceServiceException - if the service fails to start
protected void doStop()
throws ServiceException
doStop in class ServiceServiceException - if the service fails to stop
protected void init()
throws ServiceException
ServiceException - if the service cannot be initialisedprotected boolean exists(java.lang.String name)
name - the destination nametrue if the destination exists, otherwise
falseprotected void destroyDestinationCache(DestinationCache cache)
cache - the destination to destroyprotected void destroyDestinationCache(JmsDestination dest)
dest - the destination to destroy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||