org.infinispan.remoting
Class ReplicationQueueImpl

java.lang.Object
  extended by org.infinispan.remoting.ReplicationQueueImpl
All Implemented Interfaces:
Lifecycle, ReplicationQueue

public class ReplicationQueueImpl
extends Object
implements ReplicationQueue

A default implementation of the ReplicationQueue interface.

Version:
4.2
Author:
Manik Surtani

Constructor Summary
ReplicationQueueImpl()
           
 
Method Summary
 void add(ReplicableCommand job)
          Adds a new command to the replication queue.
protected  List<ReplicableCommand> drainReplQueue()
           
 int flush()
          Flushes existing jobs in the replication queue, and returns the number of jobs flushed.
 int getElementsCount()
           
 void injectDependencies(ScheduledExecutorService executor, RpcManager rpcManager, Configuration configuration, CommandsFactory commandsFactory)
           
 boolean isEnabled()
           
 void reset()
          Resets the replication queue, typically used when a cache is restarted.
 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

ReplicationQueueImpl

public ReplicationQueueImpl()
Method Detail

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface ReplicationQueue
Returns:
true if this replication queue is enabled, false otherwise.

injectDependencies

public void injectDependencies(ScheduledExecutorService executor,
                               RpcManager rpcManager,
                               Configuration configuration,
                               CommandsFactory commandsFactory)

start

public void start()
Starts the asynchronous flush queue.

Specified by:
start in interface Lifecycle

stop

public void stop()
Stops the asynchronous flush queue.

Specified by:
stop in interface Lifecycle

add

public void add(ReplicableCommand job)
Description copied from interface: ReplicationQueue
Adds a new command to the replication queue.

Specified by:
add in interface ReplicationQueue
Parameters:
job - command to add to the queue

flush

public int flush()
Description copied from interface: ReplicationQueue
Flushes existing jobs in the replication queue, and returns the number of jobs flushed.

Specified by:
flush in interface ReplicationQueue
Returns:
the number of jobs flushed

drainReplQueue

protected List<ReplicableCommand> drainReplQueue()

getElementsCount

public int getElementsCount()
Specified by:
getElementsCount in interface ReplicationQueue
Returns:
the number of elements in the replication queue.

reset

public void reset()
Description copied from interface: ReplicationQueue
Resets the replication queue, typically used when a cache is restarted.

Specified by:
reset in interface ReplicationQueue


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