net.sf.ehcache.distribution.jgroups
Class JGroupsCachePeer

java.lang.Object
  extended by net.sf.ehcache.distribution.jgroups.JGroupsCachePeer
All Implemented Interfaces:
java.rmi.Remote, net.sf.ehcache.distribution.CachePeer

public class JGroupsCachePeer
extends java.lang.Object
implements net.sf.ehcache.distribution.CachePeer

Handles CachePeerfunctions around a JGroups Channel and a CacheManager

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
JGroupsCachePeer(org.jgroups.Channel channel, java.lang.String clusterName)
          Create a new CachePeer
 
Method Summary
 void dispose()
          Shutdown the cache peer
 java.util.List<?> getElements(java.util.List keys)
          
 java.util.List<org.jgroups.Address> getGroupMembership()
           
 java.lang.String getGuid()
          
 java.util.List<?> getKeys()
          
 org.jgroups.Address getLocalAddress()
           
 java.lang.String getName()
          
 java.util.List<org.jgroups.Address> getOtherGroupMembers()
           
 net.sf.ehcache.Element getQuiet(java.io.Serializable key)
          
 java.lang.String getUrl()
          
 java.lang.String getUrlBase()
          
 void put(net.sf.ehcache.Element element)
          
 boolean remove(java.io.Serializable key)
          
 void removeAll()
          
 void send(org.jgroups.Address dest, java.util.List<JGroupEventMessage> eventMessages)
          Sends a list of JGroupEventMessages to the specified address, if no address is set the messages are sent to the entire group.
 void send(java.util.List eventMessages)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGroupsCachePeer

public JGroupsCachePeer(org.jgroups.Channel channel,
                        java.lang.String clusterName)
Create a new CachePeer

Method Detail

send

public void send(java.util.List eventMessages)
          throws java.rmi.RemoteException

Specified by:
send in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getGroupMembership

public java.util.List<org.jgroups.Address> getGroupMembership()
Returns:
Get the address of all members in the cluster

getOtherGroupMembers

public java.util.List<org.jgroups.Address> getOtherGroupMembers()
Returns:
Get the address of all members in the cluster other than this one

getLocalAddress

public org.jgroups.Address getLocalAddress()
Returns:
Get the address of this machine in the cluster

dispose

public void dispose()
Shutdown the cache peer


send

public void send(org.jgroups.Address dest,
                 java.util.List<JGroupEventMessage> eventMessages)
Sends a list of JGroupEventMessages to the specified address, if no address is set the messages are sent to the entire group.


getElements

public java.util.List<?> getElements(java.util.List keys)
                              throws java.rmi.RemoteException

Specified by:
getElements in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getGuid

public java.lang.String getGuid()
                         throws java.rmi.RemoteException

Specified by:
getGuid in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getKeys

public java.util.List<?> getKeys()
                          throws java.rmi.RemoteException

Specified by:
getKeys in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getName

public java.lang.String getName()
                         throws java.rmi.RemoteException

Specified by:
getName in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getQuiet

public net.sf.ehcache.Element getQuiet(java.io.Serializable key)
                                throws java.rmi.RemoteException

Specified by:
getQuiet in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getUrl

public java.lang.String getUrl()
                        throws java.rmi.RemoteException

Specified by:
getUrl in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

getUrlBase

public java.lang.String getUrlBase()
                            throws java.rmi.RemoteException

Specified by:
getUrlBase in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException

put

public void put(net.sf.ehcache.Element element)
         throws java.lang.IllegalArgumentException,
                java.lang.IllegalStateException,
                java.rmi.RemoteException

Specified by:
put in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
java.rmi.RemoteException

remove

public boolean remove(java.io.Serializable key)
               throws java.lang.IllegalStateException,
                      java.rmi.RemoteException

Specified by:
remove in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.lang.IllegalStateException
java.rmi.RemoteException

removeAll

public void removeAll()
               throws java.rmi.RemoteException,
                      java.lang.IllegalStateException

Specified by:
removeAll in interface net.sf.ehcache.distribution.CachePeer
Throws:
java.rmi.RemoteException
java.lang.IllegalStateException


Copyright © 2003-2010 Terracotta, Inc.. All Rights Reserved.