OSMQ
v2.0.1

osmq.broker
Class SlaveRouterProcessor

java.lang.Object
  extended byosmq.broker.SlaveRouterProcessor

public class SlaveRouterProcessor
extends java.lang.Object

A class that attaches to a Message Router as a subscriber, subscribing to all topics, and saves subscribed messages to a Queue. The Queue can be later copied to another Queue, or saved to an external file.


Constructor Summary
SlaveRouterProcessor()
           
 
Method Summary
 void close()
          Disconnect the connection to the Message Broker and closes the Queue.
 void closeConnection()
          Closes the connection to the Message Broker.
 java.lang.String getServiceName()
           
 long getSlaveQueueCount()
           
 boolean isFlushOnClose()
          Returns true if calling close will result in messages being lost.
 void run()
           
 void saveSlaveQueue()
          Saves the data on the slave Queue to a permenant file.
 void setFlushOnClose(boolean b)
          Defines whether the messages will be discarded when the broker is closed.
 void setServiceName(java.lang.String servicename)
           
 MQue writeSlaveToQueue(PersistableMQue target)
          Takes the data that has been written and transfers it to the target Queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlaveRouterProcessor

public SlaveRouterProcessor()
Method Detail

setServiceName

public void setServiceName(java.lang.String servicename)

getServiceName

public java.lang.String getServiceName()

getSlaveQueueCount

public long getSlaveQueueCount()

isFlushOnClose

public boolean isFlushOnClose()
Returns true if calling close will result in messages being lost. Returns false if closing will result in messages being writtten to a text file.


setFlushOnClose

public void setFlushOnClose(boolean b)
Defines whether the messages will be discarded when the broker is closed.


writeSlaveToQueue

public MQue writeSlaveToQueue(PersistableMQue target)
                       throws java.io.IOException
Takes the data that has been written and transfers it to the target Queue.

Throws:
java.io.IOException

closeConnection

public void closeConnection()
Closes the connection to the Message Broker.


saveSlaveQueue

public void saveSlaveQueue()
Saves the data on the slave Queue to a permenant file.


close

public void close()
Disconnect the connection to the Message Broker and closes the Queue. Data on the Queue will be saved or lost depending on the state of isFlushOnClose().

See Also:
isFlushOnClose()

run

public void run()
         throws java.io.IOException
Throws:
java.io.IOException

(c) 2000 - 2003 MQue Systems
All Rights Reserved