リモート関数

フォーム REMOTE_<svc> のプレフィックスとローカル名を指定すると、マッパーは、Flex リモート宛先の操作名に対応する関数インスタンスを返します。必要なリモート設定は、コンパイル時に適切な services-config.xml を提供することで、アプリケーションで実装されます。RemoteFunctions のサンプル実装を次に示します。
public interface IRemoteFunctions { 
 
    @ServiceMethod(familyId="Long") 
    long add(long a, long b); 
 
    @ServiceMethod(displayName = "randomInt", familyId="Int", description = "Return a random integer") 
    int random();    
} 
 
 
public class RemoteFunctionsImpl implements IRemoteFunctions { 
 
    public long add(long a, long b) { 
        return a + b; 
    }  
    
    public int random() { 
        return new Random().nextInt(); 
    } 
}