View Javadoc
1   package org.apache.commons.jcs3.auxiliary.remote.behavior;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.commons.jcs3.auxiliary.AuxiliaryCache;
23  import org.apache.commons.jcs3.engine.behavior.ICacheServiceNonLocal;
24  
25  /**
26   * This defines the behavior expected of a remote cache client. This extends Auxiliary cache which
27   * in turn extends ICache.
28   * <p>
29   * I'd like generalize this a bit.
30   * </p>
31   */
32  public interface IRemoteCacheClient<K, V>
33      extends AuxiliaryCache<K, V>
34  {
35      /**
36       * Replaces the current remote cache service handle with the given handle. If the current remote
37       * is a Zombie, the propagate the events that may be queued to the restored service.
38       * <p>
39       * @param remote ICacheServiceNonLocal -- the remote server or proxy to the remote server
40       */
41      void fixCache( ICacheServiceNonLocal<?, ?> remote );
42  
43      /**
44       * Gets the listenerId attribute of the RemoteCacheListener object.
45       * <p>
46       * All requests to the remote cache must include a listener id. This allows the server to avoid
47       * sending updates the listener associated with this client.
48       * <p>
49       * @return The listenerId value
50       */
51      long getListenerId();
52  
53      /**
54       * This returns the listener associated with this remote cache. TODO we should try to get this
55       * out of the interface.
56       * <p>
57       * @return IRemoteCacheListener
58       */
59      IRemoteCacheListener<K, V> getListener();
60  }