Packagejp.co.fujitsu.reffi.client.flex.model.rpc
Classpublic class RPCControllerClientCore
InheritanceRPCControllerClientCore Inheritance RPCCore Inheritance BaseModel Inheritance flash.events.EventDispatcher

[概 要]

RemoteObjectによるリモートモジュール呼び出しをサポートする機能モデルクラスです.

[詳 細]

呼び出されるサーバモジュールがjp.co.fujitsu.reffi.server.flex.web.controller.RPCController、 若しくはRPCController継承クラスであることを想定したRPCクライアントクラスです。 このクラスをRPC呼び出しクライアントとして選択すると、呼び出し予定のモジュールが RPCController一クラスに限定される為、サーバ側RPCモジュール定義を簡略化することが出来ます。 接続するデフォルトdestination識別子は「remote-controller」です。 サーバ側のremoting-config.xmlに以下の定義を追加することでRPCControllerを起動することが出来ます。
        <!-- RPCControllerClientCoreが期待するdestination名で登録 -->
        <destination id="remote-controller">
            <properties>
                <!-- RPCController継承クラスでも可 -->
                <source>jp.co.fujitsu.reffi.server.flex.web.controller.RPCController</source>
                <scope>application</scope>
            </properties>
        </destination>
     
このクラスによって呼び出されたサーバ側RPCControllerオブジェクトは、 modelFQCNプロパティを元に業務ロジックが記述されたサーバ側モジュールをインスタンス化、 実行し、結果をRPCControllerClientCoreに返却します。

[備 考]

RPCControllerの詳細な説明はreff-server-flexのJavaDocを参照して下さい。

View the examples



Public Properties
 PropertyDefined By
 InheritedasyncToken : Object
[概 要] 非同期通信トークンです.
RPCCore
 Inheritedcache : Dictionary
[static] [概 要] static通信オブジェクトキャッシュプロパティです.
RPCCore
 InheritedcacheMode : Boolean
[概 要] 通信先が同じであれば各種通信オブジェクトをキャッシュします.
RPCCore
 Inheritedcontroller : BaseController
[概 要] このモデルを起動したコントローラインスタンスです.
BaseModel
 InheritedexecuteIndex : int
[概 要] 実行インデックス設定.
BaseModel
  modelFQCN : String
[概 要] サーバリモートの実行モデルFQCNです.
RPCControllerClientCore
 InheritedparameterMapping : ParameterMapping
[概 要] MVC各レイヤを伝播するパラメータオブジェクトです.
BaseModel
  remoteDestination : String
[概 要] RPCコントローラの宛先です.
RPCControllerClientCore
  rpcParameter : Object
[概 要] RPCメソッド呼び出し時のパラメータです.
RPCControllerClientCore
 Inheritedservice : IEventDispatcher
[概 要] 継承先で定義される、各種通信オブジェクトのI/Fです.
RPCCore
 Inheritedskip : Boolean
[概 要] このモデルを実行するか、コントローラが判断する為のフラグです.
BaseModel
 InheritedsuccessCount : int
[概 要] モデルインスタンス生存中に、何回モデル処理が成功したかを保持します.
BaseModel
Public Methods
 MethodDefined By
  
addRpcParameter(key:Object, value:Object):Object
[概 要] RPCメソッド呼び出し時のパラメータに新規パラメータを追加します.
RPCControllerClientCore
 Inherited
[概 要] モデル処理失敗イベントを発行するメソッドです.
BaseModel
 Inherited
[概 要] モデル処理完了イベントを発行するメソッドです.
BaseModel
 Inherited
[概 要] モデル処理成功イベントを発行するメソッドです.
BaseModel
 Inherited
[概 要] ModelProcessEvent.SUCCESS発行回数を1増加させます.
BaseModel
 Inherited
[static] [概 要] 通信オブジェクトキャッシュを全て削除します.
RPCCore
 Inherited
removeCache(cacheId:String):void
[static] [概 要] 通信オブジェクトキャッシュを削除します.
RPCCore
 Inherited
run():void
[概 要] コントローラにコールされるモデルの主幹メソッドです.
BaseModel
Protected Methods
 MethodDefined By
  
cacheId():String
[override] [概 要] キャッシュモード実行時、通信オブジェクトを識別する為のIDを返却します.
RPCControllerClientCore
  
createConcreteService():IEventDispatcher
[override] [概 要] 具象通信オブジェクトを生成します.
RPCControllerClientCore
 Inherited
faultHandler(event:FaultEvent):void
[概 要] 受信失敗ハンドラです.
RPCCore
 Inherited
[概 要] run()が終了したタイミングでテンプレートコールされるメソッドです.
BaseModel
  
[override] [概 要] 通信成功、失敗に関わらずコールされます.
RPCControllerClientCore
 Inherited
mainProc():void
[override] [概 要] メイン処理メソッドです.
RPCCore
 Inherited
onFailure(event:FaultEvent, parameterMapping:ParameterMapping):void
[概 要] 受信失敗処理用オーバーライドメソッドです.
RPCCore
 Inherited
onFinish(parameterMapping:ParameterMapping):void
[概 要] 通信終了処理実装メソッドです.
RPCCore
 Inherited
onSuccess(event:ResultEvent, parameterMapping:ParameterMapping):void
[概 要] 受信成功処理用オーバーライドメソッドです.
RPCCore
 Inherited
postProc():void
[概 要] 後処理テンプレートメソッドです.
BaseModel
 Inherited
preProc():Boolean
[概 要] 前処理テンプレートメソッドです.
BaseModel
 Inherited
resultHandler(event:ResultEvent):void
[概 要] 受信成功ハンドラです.
RPCCore
  
send(dispatcher:IEventDispatcher):Object
[override] [概 要] RPCリクエストを行います.
RPCControllerClientCore
 Inherited
trap(e:Error):Error
[override] [概 要] 非同期通信開始前のエラーをハンドリングします.
RPCCore
Public Constants
 ConstantDefined By
  DEFAULT_DESTINATION : String = remote-controller
[static]
RPCControllerClientCore
 InheritedE4X : String = e4x
[static] レスポンス返却フォーマット「e4x」を示す定数です.
RPCCore
 InheritedOBJECT : String = object
[static] レスポンス返却フォーマット「object」を示す定数です.
RPCCore
 InheritedXML : String = xml
[static] レスポンス返却フォーマット「xml」を示す定数です.
RPCCore
Property Detail
modelFQCNproperty
modelFQCN:String

[概 要]

サーバリモートの実行モデルFQCNです.

[詳 細]

RPCControllerに実行される、業務ロジックが記述されたモデルクラスです。 業務ロジッククラスはjp.co.fujitsu.reffi.server.model.AbstractModelを継承したクラスです。

[備 考]


Implementation
    public function get modelFQCN():String
    public function set modelFQCN(value:String):void
remoteDestinationproperty 
remoteDestination:String

[概 要]

RPCコントローラの宛先です.

[詳 細]

remoting-config.xmlで設定されているRPCコントローラの宛先を文字列で設定します。

[備 考]

The default value is remote-controller.


Implementation
    public function get remoteDestination():String
    public function set remoteDestination(value:String):void
rpcParameterproperty 
rpcParameter:Object

[概 要]

RPCメソッド呼び出し時のパラメータです.

[詳 細]

サーバ側ではMap<Object, Object>に型変換されます。 設定された値は、サーバ側AbstractModel継承業務ロジッククラス内で getRequest()、getRequestParameter(Object key)メソッドによって取得出来ます。

[備 考]


Implementation
    public function get rpcParameter():Object
    public function set rpcParameter(value:Object):void
Method Detail
addRpcParameter()method
public function addRpcParameter(key:Object, value:Object):Object

[概 要]

RPCメソッド呼び出し時のパラメータに新規パラメータを追加します.

[詳 細]

設定された値は、サーバ側AbstractModel継承業務ロジッククラス内で getRequest()、getRequestParameter(Object key)メソッドによって取得出来ます。

[備 考]

Parameters

key:Object — パラメータキー
 
value:Object — パラメータ値

Returns
Object
cacheId()method 
override protected function cacheId():String

[概 要]

キャッシュモード実行時、通信オブジェクトを識別する為のIDを返却します.

[詳 細]

remoteDestinationプロパティを返却します。 cacheIdはcacheModeプロパティがtrueの場合のみ使用されます。

[備 考]

Returns
String — 通信オブジェクトを識別する為のキャッシュID
createConcreteService()method 
override protected function createConcreteService():IEventDispatcher

[概 要]

具象通信オブジェクトを生成します.

[詳 細]

RemoteObjectオブジェクトを、destination = "remote-controller"で生成します。

[備 考]

Returns
IEventDispatcher — RemoteObjectオブジェクト
finishConnect()method 
override protected final function finishConnect():void

[概 要]

通信成功、失敗に関わらずコールされます.

[詳 細]

処理は有りません。

[備 考]

通信終了処理実装はonFinishをオーバーライドしてください。

send()method 
override protected function send(dispatcher:IEventDispatcher):Object

[概 要]

RPCリクエストを行います.

[詳 細]

指定されたChannelSet、サーバ側業務ロジッククラス、パラメータマップで、 サーバ側で待機しているRPCController(デフォルトdestination:remote-controller)を呼び出します。

[備 考]

Parameters

dispatcher:IEventDispatcher

Returns
Object
Constant Detail
DEFAULT_DESTINATIONConstant
public static const DEFAULT_DESTINATION:String = remote-controller

Examples
都道府県コンボボックスを選択してサーバからデータを取得する
        public class WardListChangeAction extends BaseAction {
            
            override protected function reserveModels(models:Array):void {
                models.push(Class(RPCControllerClientCore));
            }
    
            override public function nextModel(index:int, prev:ModelProcessEvent, next:BaseModel):Boolean {
                switch (index) {
                    case 0:
                        var postalCombo:ComboBox = getComponentByName("wardList") as ComboBox;
    
                        RPCControllerClientCore(next).modelFQCN = "demo.rpc.model.FetchPostalDataModel";
                        RPCControllerClientCore(next).addRpcParameter("selectedWard", postalCombo.selectedLabel);
                        break;                
                }
                return true;
            }
            
            override public function successForward(index:int, model:BaseModel, resultEvent:Event):void {
                switch (index) {
                    case 0:
                        var postalTable:DataGrid = getComponentByName("postaltable") as DataGrid;
                        postalTable.dataProvider = ResultEvent(resultEvent).result;
                        break;                    
                }
            }
        }
     

Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.