ehcache

net.sf.ehcache.distribution
Class ManualRMICacheManagerPeerProvider

java.lang.Object
  extended by net.sf.ehcache.distribution.RMICacheManagerPeerProvider
      extended by net.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 5594 2012-05-07 16:04:31Z cdennis $
Author:
Greg Luck

Field Summary
 
Fields inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
cacheManager, peerUrls
 
Constructor Summary
ManualRMICacheManagerPeerProvider()
          Empty constructor.
 
Method Summary
 long getTimeForClusterToForm()
          Time for a cluster to form.
 void init()
          Notifies providers to initialise themselves.
 List listRemoteCachePeers(Ehcache cache)
           
 void registerPeer(String rmiUrl)
          Register a new peer.
protected  boolean stale(Date date)
          Whether the entry should be considered stale.
 
Methods inherited from class net.sf.ehcache.distribution.RMICacheManagerPeerProvider
dispose, getCacheManager, getScheme, 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

getTimeForClusterToForm

public long getTimeForClusterToForm()
Time for a cluster to form. This varies considerably, depending on the implementation.

Returns:
the time in ms, for a cluster to form

registerPeer

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

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

listRemoteCachePeers

public final List listRemoteCachePeers(Ehcache 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(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

Copyright 2001-2014, Terracotta, Inc.