ehcache

net.sf.ehcache.distribution
Class ManualRMICacheManagerPeerProvider

java.lang.Object
  extended bynet.sf.ehcache.distribution.RMICacheManagerPeerProvider
      extended bynet.sf.ehcache.distribution.ManualRMICacheManagerPeerProvider
All Implemented Interfaces:
CacheManagerPeerProvider

public final class ManualRMICacheManagerPeerProvider
extends RMICacheManagerPeerProvider

A provider of Peer RMI addresses based off manual configuration.

Because there is no monitoring of whether a peer is actually there, the list of peers is dynamically looked up and verified each time a lookup request is made.

Version:
$Id: ManualRMICacheManagerPeerProvider.java 52 2006-04-24 14:50:03Z gregluck $
Author:
Greg Luck

Field Summary
 
Fields inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
peerUrls
 
Constructor Summary
ManualRMICacheManagerPeerProvider()
          Empty constructor.
 
Method Summary
 void init()
          Notifies providers to initialise themselves.
 java.util.List listRemoteCachePeers(Cache cache)
           
 void registerPeer(java.lang.String rmiUrl)
          Register a new peer.
protected  boolean stale(java.util.Date date)
          Whether the entry should be considered stale.
 
Methods inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
dispose, getCacheManager, lookupRemoteCachePeer, unregisterPeer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManualRMICacheManagerPeerProvider

public ManualRMICacheManagerPeerProvider()
Empty constructor.

Method Detail

init

public final void init()
Notifies providers to initialise themselves.

Specified by:
init in interface CacheManagerPeerProvider
Specified by:
init in class RMICacheManagerPeerProvider

registerPeer

public final void registerPeer(java.lang.String rmiUrl)
Register a new peer.

Specified by:
registerPeer in interface CacheManagerPeerProvider
Specified by:
registerPeer in class RMICacheManagerPeerProvider
Parameters:
rmiUrl -

listRemoteCachePeers

public final java.util.List listRemoteCachePeers(Cache cache)
                                          throws CacheException
Specified by:
listRemoteCachePeers in interface CacheManagerPeerProvider
Specified by:
listRemoteCachePeers in class RMICacheManagerPeerProvider
Returns:
a list of CachePeer peers, excluding the local peer.
Throws:
CacheException

stale

protected final boolean stale(java.util.Date date)
Whether the entry should be considered stale.

Manual RMICacheManagerProviders use a static list of urls and are therefore never stale.

Specified by:
stale in class RMICacheManagerPeerProvider
Parameters:
date - the date the entry was created
Returns:
true if stale

ehcache

true