org.jboss.cache
Class ReplicationQueue

java.lang.Object
  extended by org.jboss.cache.ReplicationQueue

public class ReplicationQueue
extends java.lang.Object

Periodically (or when certain size is exceeded) takes elements and replicates them.

Version:
$Revision: 1.15 $
Author:
Bela Ban May 24, 2003

Constructor Summary
ReplicationQueue()
           
ReplicationQueue(CacheImpl cache, long interval, long max_elements)
          Constructs a new ReplicationQueue.
 
Method Summary
 void add(MethodCall job)
          Adds a new method call.
 void flush()
          Flushes existing method calls.
 long getInterval()
          Returns the flush interval in milliseconds.
 long getMax_elements()
          Returns the maximum number of elements to hold.
 void setInterval(long interval)
          Sets the flush interval in milliseconds.
 void setMax_elements(long max_elements)
          Sets the maximum number of elements to hold.
 void start()
          Starts the asynchronous flush queue.
 void stop()
          Stops the asynchronous flush queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationQueue

public ReplicationQueue()

ReplicationQueue

public ReplicationQueue(CacheImpl cache,
                        long interval,
                        long max_elements)
Constructs a new ReplicationQueue.

Method Detail

getInterval

public long getInterval()
Returns the flush interval in milliseconds.


setInterval

public void setInterval(long interval)
Sets the flush interval in milliseconds.


getMax_elements

public long getMax_elements()
Returns the maximum number of elements to hold. If the maximum number is reached, flushes in the calling thread.


setMax_elements

public void setMax_elements(long max_elements)
Sets the maximum number of elements to hold.


start

public void start()
Starts the asynchronous flush queue.


stop

public void stop()
Stops the asynchronous flush queue.


add

public void add(MethodCall job)
Adds a new method call.


flush

public void flush()
Flushes existing method calls.