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 import fulmine.model.field.IField; 19 20 /** 21 * Expresses a specific Remote Procedure Call definition. Procedures can be 22 * overloaded (have different arguments) but the result type cannot be 23 * overloaded. The 'void' result type is not supported. 24 * <p> 25 * <b>Definitions are compared for equality based on their name and argument 26 * types only.</b> 27 * 28 * @see IRpcManager 29 * @see IRpcRegistry#publishProdedure(IRpcHandler, IRpcDefinition) 30 * @author Ramon Servadei 31 */ 32 public interface IRpcDefinition 33 { 34 /** 35 * Get the identity of the remote context that this RPC can be invoked in. 36 * 37 * @return the identity of the remote context that this RPC can be invoked 38 * in 39 */ 40 String getRemoteContextIdentity(); 41 42 /** 43 * Get the name of the RPC 44 * 45 * @return the name of the RPC 46 */ 47 String getName(); 48 49 /** 50 * Get the argument types, in order, that are required by the RPC 51 * 52 * @return the argument types, in order, that are required by the RPC 53 */ 54 Class<? extends IField>[] getArgumentTypes(); 55 56 /** 57 * Get the result type for this RPC 58 * 59 * @return the result type for this RPC 60 */ 61 Class<? extends IField> getResultType(); 62 }