org.jboss.messaging.core.contract
Interface Replicator

All Known Implementing Classes:
MessagingPostOffice

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: 2868 $ $Id: Replicator.java 2868 2007-07-10 20:22:16Z timfox $
Author:
Tim Fox, Ovidiu Feodorov

Field Summary
static java.lang.String CF_PREFIX
           
static java.lang.String JVM_ID_KEY
           
 
Method Summary
 java.util.Map get(java.io.Serializable key)
          Return a node-mapped replicated data.
 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.
 boolean remove(java.io.Serializable key)
          Updates the replication maps across the cluster by removing the data corresponding to the give key.
 

Field Detail

CF_PREFIX

static final java.lang.String CF_PREFIX
See Also:
Constant Field Values

JVM_ID_KEY

static final java.lang.String JVM_ID_KEY
See Also:
Constant Field Values
Method Detail

put

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

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

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


Copyright © 2006 JBoss Inc. All Rights Reserved.