org.jboss.messaging.core.plugin.contract
Interface Replicator

All Known Implementing Classes:
DefaultClusteredPostOffice

public interface Replicator

A Replicator This is used for replicating arbitrary data across a cluster. Data is structured as follows: There is an arbitrary key to identify the data, e.g. the connection factory name Then, for that key, there is an entry for each node id.

Version:
$Revision: 1917 $ $Id: Replicator.java 1917 2007-01-08 20:26:12Z clebert.suconic@jboss.com $
Author:
Tim Fox, Ovidiu Feodorov

Method Summary
 java.util.Map get(java.io.Serializable key)
          Return a node-mapped replicated data.
 FailoverMapper getFailoverMapper()
          TODO - this method doesn't belong here...
 void put(java.io.Serializable key, java.io.Serializable data)
          Broadcast data across the cluster, updating replication maps on all nodes, including the local node.
 void registerListener(ReplicationListener listener)
           
 boolean remove(java.io.Serializable key)
          Updates the replication maps across the cluster by removing the data corresponding to the give key.
 void unregisterListener(ReplicationListener listener)
           
 

Method Detail

put

public void put(java.io.Serializable key,
                java.io.Serializable data)
         throws java.lang.Exception
Broadcast data across the cluster, updating replication maps on all nodes, including the local node.

Throws:
java.lang.Exception

get

public java.util.Map get(java.io.Serializable key)
                  throws java.lang.Exception
Return a node-mapped replicated data.

Returns:
a Map. Returns an empty map if no replicants are found for 'key', but never null.
Throws:
java.lang.Exception

remove

public boolean remove(java.io.Serializable key)
               throws java.lang.Exception
Updates the replication maps across the cluster by removing the data corresponding to the give key. Only the data corresponding to the current node is removed.

Throws:
java.lang.Exception

registerListener

public void registerListener(ReplicationListener listener)

unregisterListener

public void unregisterListener(ReplicationListener listener)

getFailoverMapper

public FailoverMapper getFailoverMapper()
TODO - this method doesn't belong here... We should have POJOized containers updating dependencies between ConnectionFActoryJNDIMapper and DefaultClusteredPostOffice



Copyright © 2006 JBoss Inc. All Rights Reserved.