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.event.CacheManagerEventListener;
19:
20: import java.util.List;
21:
22: /**
23: * A listener for updates, which controls remote cache peers.
24: * @author Greg Luck
25: * @version $Id: CacheManagerPeerListener.java 519 2007-07-27 07:11:45Z gregluck $
26: */
27: public interface CacheManagerPeerListener extends
28: CacheManagerEventListener {
29:
30: /**
31: * All of the caches which are listenting for remote changes.
32: * @return a list of <code>CachePeer</code> objects
33: */
34: List getBoundCachePeers();
35:
36: /**
37: * A listener will normally have a resource that only one instance can use at the same time,
38: * such as a port. This identifier is used to tell if it is unique and will not conflict with an
39: * existing instance using the resource.
40: * @return a String identifier for the resource
41: */
42: String getUniqueResourceIdentifier();
43:
44: /**
45: * If a conflict is detected in unique resource use, this method signals the listener to attempt
46: * automatic resolution of the resource conflict.
47: * @throws IllegalStateException if the statis of the listener is not {@link net.sf.ehcache.Status#STATUS_UNINITIALISED}
48: */
49: void attemptResolutionOfUniqueResourceConflict()
50: throws IllegalStateException, CacheException;
51:
52: }
|