View Javadoc

1   /*
2      Copyright 2008 Ramon Servadei
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
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   */
16  package fulmine.rpc;
17  
18  /**
19   * Receives notifications when an RPC is published or unpublished by a remote
20   * context.
21   * 
22   * @see IRpcManager#addRpcPublicationListener(String, IRpcPublicationListener)
23   * @see IRpcManager#removeRpcPublicationListener(String,
24   *      IRpcPublicationListener)
25   * @author Ramon Servadei
26   */
27  public interface IRpcPublicationListener
28  {
29      /**
30       * Executed when the local context can invoke the named RPC in the
31       * identified remote context.
32       * 
33       * @param remoteContextIdentity
34       *            the remote context that has published the procedure, when
35       *            calling the procedure, this remote context will handle it
36       * @param rpcDefinition
37       *            the RPC definition
38       */
39      void procedureAvailable(String remoteContextIdentity,
40          IRpcDefinition rpcDefinition);
41  
42      /**
43       * Executed when a remote context unpublishes (removes) the named RPC. The
44       * RPC is no longer available for invocation.
45       * 
46       * @param remoteContextIdentity
47       *            the remote context that has unpublished the RPC
48       * @param rpcDefinition
49       *            the RPC definition that has been removed
50       */
51      void procedureUnavailable(String remoteContextIdentity,
52          IRpcDefinition rpcDefinition);
53  }