View Javadoc

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