1 package org.apache.commons.jcs.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.jcs.auxiliary.AuxiliaryCache; 23 import org.apache.commons.jcs.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 * @author Aaron Smuts 32 */ 33 public interface IRemoteCacheClient<K, V> 34 extends AuxiliaryCache<K, V> 35 { 36 /** 37 * Replaces the current remote cache service handle with the given handle. If the current remote 38 * is a Zombie, the propagate the events that may be queued to the restored service. 39 * <p> 40 * @param remote ICacheServiceNonLocal -- the remote server or proxy to the remote server 41 */ 42 void fixCache( ICacheServiceNonLocal<?, ?> remote ); 43 44 /** 45 * Gets the listenerId attribute of the RemoteCacheListener object. 46 * <p> 47 * All requests to the remote cache must include a listener id. This allows the server to avoid 48 * sending updates the the listener associated with this client. 49 * <p> 50 * @return The listenerId value 51 */ 52 long getListenerId(); 53 54 /** 55 * This returns the listener associated with this remote cache. TODO we should try to get this 56 * out of the interface. 57 * <p> 58 * @return IRemoteCacheListener 59 */ 60 IRemoteCacheListener<K, V> getListener(); 61 }