View Javadoc
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.remote.server.behavior.RemoteType;
23  import org.apache.commons.jcs.engine.behavior.ICacheListener;
24  
25  import java.io.IOException;
26  import java.rmi.Remote;
27  
28  /**
29   * Listens for remote cache event notification ( rmi callback ).
30   */
31  public interface IRemoteCacheListener<K, V>
32      extends ICacheListener<K, V>, Remote
33  {
34      /**
35       * Get the id to be used by this manager.
36       * <p>
37       * @return long
38       * @throws IOException
39       */
40      @Override
41      long getListenerId()
42          throws IOException;
43  
44      /**
45       * Set the id to be used by this manager. The remote cache server identifies clients by this id.
46       * The value will be set by the server through the remote cache listener.
47       * <p>
48       * @param id
49       * @throws IOException
50       */
51      @Override
52      void setListenerId( long id )
53          throws IOException;
54  
55      /**
56       * Gets the remoteType attribute of the IRemoteCacheListener object
57       * <p>
58       * @return The remoteType value
59       * @throws IOException
60       */
61      RemoteType getRemoteType()
62          throws IOException;
63  
64      /**
65       * This is for debugging. It allows the remote cache server to log the address of any listeners
66       * that register.
67       * <p>
68       * @return the local host address.
69       * @throws IOException
70       */
71      String getLocalHostAddress()
72          throws IOException;
73  
74      /**
75       * Deregisters itself.
76       * <p>
77       * @throws IOException
78       */
79      void dispose()
80          throws IOException;
81  }