ehcache

net.sf.ehcache.distribution
Interface CacheManagerPeerProvider

All Known Subinterfaces:
ManagedCacheManagerPeerProvider
All Known Implementing Classes:
ManualRMICacheManagerPeerProvider, MulticastRMICacheManagerPeerProvider, RMICacheManagerPeerProvider

public interface CacheManagerPeerProvider

Provides a discovery service to locate CachePeer listener peers for a Cache.

Version:
$Id: CacheManagerPeerProvider.java 5594 2012-05-07 16:04:31Z cdennis $
Author:
Greg Luck

Method Summary
 void dispose()
          Providers may be doing all sorts of exotic things and need to be able to clean up on dispose.
 String getScheme()
          The replication scheme.
 long getTimeForClusterToForm()
          Time for a cluster to form.
 void init()
          Notifies providers to initialise themselves.
 List listRemoteCachePeers(Ehcache cache)
           
 void registerPeer(String nodeId)
          Register a new peer.
 void unregisterPeer(String nodeId)
          Unregisters a peer.
 

Method Detail

registerPeer

void registerPeer(String nodeId)
Register a new peer.

Parameters:
nodeId - Identifies a node in this replication scheme (ex: RMI URL)

unregisterPeer

void unregisterPeer(String nodeId)
Unregisters a peer.

Parameters:
nodeId - Identifies a node in this replication scheme (ex: RMI URL)

listRemoteCachePeers

List listRemoteCachePeers(Ehcache cache)
                          throws CacheException
Returns:
a list of CachePeer peers for the given cache, excluding the local peer.
Throws:
CacheException

init

void init()
Notifies providers to initialise themselves.

Throws:
CacheException

dispose

void dispose()
             throws CacheException
Providers may be doing all sorts of exotic things and need to be able to clean up on dispose.

Throws:
CacheException

getTimeForClusterToForm

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

getScheme

String getScheme()
The replication scheme. Each peer provider has a scheme name, which can be used to specify the scheme for replication and bootstrap purposes. Each CacheReplicator should lookup the provider for its scheme type during replication. Similarly a BootstrapCacheLoader should also look up the provider for its scheme.

Returns:
the well-known scheme name, which is determined by the replication provider author.
Since:
1.6 introduced to permit multiple distribution schemes to be used in the same CacheManager

ehcache

Copyright 2001-2014, Terracotta, Inc.