org.exolab.jms.messagemgr
Class MessageMgr

java.lang.Object
  |
  +--org.exolab.jms.service.Service
        |
        +--org.exolab.jms.messagemgr.MessageMgr
All Implemented Interfaces:
MessageManager, Serviceable

public class MessageMgr
extends Service
implements MessageManager

This is the active message handling component within the JMS server. Messages are passed in and added to the appropriate dispatchers for delivery to the clients.

Version:
$Revision: 1.5 $ $Date: 2005/11/12 12:27:40 $
Author:
Jim Mourikis, Tim Anderson

Constructor Summary
MessageMgr(DatabaseService database)
          Construct a new MessageMgr.
 
Method Summary
 void add(MessageImpl message)
          Add a message.
 void addEventListener(JmsDestination destination, MessageManagerEventListener listener)
          Register a listener for a specific destination, to be notified when messages for the destination arrive.
protected  void doStart()
          Start the service.
protected  void doStop()
          Stop the service.
 void prepare(MessageImpl message)
          Prepares a message prior to it being passed through the system.
 void removeEventListener(JmsDestination destination)
          Remove the listener for the specified destination.
 void setDestinationManager(DestinationManager manager)
          Sets the destination 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

MessageMgr

public MessageMgr(DatabaseService database)
Construct a new MessageMgr.
Parameters:
database - the database service
Method Detail

setDestinationManager

public void setDestinationManager(DestinationManager manager)
Sets the destination manager.
Parameters:
manager - the destination manager

prepare

public void prepare(MessageImpl message)
             throws javax.jms.JMSException
Prepares a message prior to it being passed through the system.
Specified by:
prepare in interface MessageManager
Parameters:
message - the message
Throws:
javax.jms.JMSException - if the message is invalid or cannot be prep'ed

add

public void add(MessageImpl message)
         throws javax.jms.JMSException
Add a message.
Specified by:
add in interface MessageManager
Parameters:
message - the message to add
Throws:
javax.jms.JMSException - if the message cannot be added

addEventListener

public void addEventListener(JmsDestination destination,
                             MessageManagerEventListener listener)
Register a listener for a specific destination, to be notified when messages for the destination arrive.
Specified by:
addEventListener in interface MessageManager
Parameters:
destination - the destination to register the listener for
listener - the listener to notify

removeEventListener

public void removeEventListener(JmsDestination destination)
Remove the listener for the specified destination.
Specified by:
removeEventListener in interface MessageManager
Parameters:
destination - the destination to remove the listener for

doStart

protected void doStart()
                throws ServiceException
Start the service.
Overrides:
doStart in class Service
Throws:
ServiceException - if the service fails to start

doStop

protected void doStop()
               throws ServiceException
Stop the service.
Overrides:
doStop in class Service
Throws:
ServiceException - if the service fails to stop


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