01: /**
02: * Copyright 2003-2007 Luck Consulting Pty Ltd
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */package net.sf.ehcache.distribution;
16:
17: import net.sf.ehcache.CacheException;
18: import net.sf.ehcache.Ehcache;
19:
20: import java.util.List;
21:
22: /**
23: * Provides a discovery service to locate {@link CachePeer} RMI listener peers for a Cache.
24: * @author Greg Luck
25: * @version $Id: CacheManagerPeerProvider.java 519 2007-07-27 07:11:45Z gregluck $
26: */
27: public interface CacheManagerPeerProvider {
28:
29: /**
30: * Register a new peer.
31: * @param rmiUrl
32: */
33: void registerPeer(String rmiUrl);
34:
35: /**
36: * Unregisters a peer.
37: *
38: * @param rmiUrl
39: */
40: void unregisterPeer(String rmiUrl);
41:
42: /**
43: * @return a list of {@link CachePeer} peers for the given cache, excluding the local peer.
44: */
45: List listRemoteCachePeers(Ehcache cache) throws CacheException;
46:
47: /**
48: * Notifies providers to initialise themselves.
49: * @throws CacheException
50: */
51: void init();
52:
53: /**
54: * Providers may be doing all sorts of exotic things and need to be able to clean up on dispose.
55: * @throws CacheException
56: */
57: void dispose() throws CacheException;
58:
59: /**
60: * Time for a cluster to form. This varies considerably, depending on the implementation.
61: * @return the time in ms, for a cluster to form
62: */
63: long getTimeForClusterToForm();
64: }
|