org.infinispan.remoting
Interface ReplicationQueue

All Superinterfaces:
Lifecycle
All Known Implementing Classes:
ReplicationQueueImpl

public interface ReplicationQueue
extends Lifecycle

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

Since:
4.0
Author:
Bela Ban, Mircea.Markus@jboss.com

Method Summary
 void add(ReplicableCommand job)
          Adds a new command to the replication queue.
 int flush()
          Flushes existing jobs in the replication queue, and returns the number of jobs flushed.
 int getElementsCount()
           
 boolean isEnabled()
           
 void reset()
          Resets the replication queue, typically used when a cache is restarted.
 
Methods inherited from interface org.infinispan.lifecycle.Lifecycle
start, stop
 

Method Detail

isEnabled

boolean isEnabled()
Returns:
true if this replication queue is enabled, false otherwise.

add

void add(ReplicableCommand job)
Adds a new command to the replication queue.

Parameters:
job - command to add to the queue

flush

int flush()
Flushes existing jobs in the replication queue, and returns the number of jobs flushed.

Returns:
the number of jobs flushed

getElementsCount

int getElementsCount()
Returns:
the number of elements in the replication queue.

reset

void reset()
Resets the replication queue, typically used when a cache is restarted.



Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.