|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjp.co.fujitsu.reffi.client.android.action.AbstractAction
jp.co.fujitsu.reffi.client.android.action.FlexibleAction
public class FlexibleAction
[概 要]
アクションの処理フローを実装する、アクション基底クラスです。[詳 細]
継承クラスはexecute(ParameterMapping)メソッドを実装して処理を実装します。[備 考]
使用例)
public class TestAction extends FlexibleAction {
@Override
public void execute(ParameterMapping parameterMapping) throws Exception{
// xalを同期要求
HTTPRequestCore xalRequester = new HTTPRequestCore();
xalRequester.setRequestUrl("webcontroller");
xalRequester.addUrlParameters("forward.page", "/pages/serverpush.xal");
xalRequester.setRenderResponse(true);
runModel(xalRequester);
// サーバロジック(パブリッシュ開始)を非同期要求
HTTPRequestCore publishRequester = new HTTPRequestCore();
publishRequester.setRequestUrl("webcontroller");
publishRequester.addUrlParameters("model.fqcn", "demo.server.model.ServerPushStartModel");
publishRequester.addUrlParameters("publishSpan", "2000");
publishRequester.setAsync(true);
runModel(publishRequester);
// サブスクライブ開始を非同期実行
SubscribeCore subscriber = new SubscribeCore();
subscriber.setTopic("serverPushDemo");
subscriber.setSubscribe(true);
runModelWithProcessListener(subscriber, new ModelProcessListener(){
@Override
public void modelSuccess(ModelProcessEvent evt) {
ObjectDataSource odc = getObjectDataSourceById("hostDataSource");
odc.setSource(evt.getResult());
}
@Override
public void modelFailure(ModelProcessEvent evt) {
evt.getExeption().printStackTrace();
}
});
// 取得したxalを操作
Element serverPushWindow =
getWindowsByCommunicateId(xalRequester.getCommunicateId()).get(0);
Element lblStatus =
getElementByNameFromWindow(serverPushWindow, "serverPush.lblStatus");
lblStatus.setAttribute("text", "serverでpublish、clientでsubscribeが開始されました。");
// イベントソースコンポーネントを無効化
Element eventSourceElement = parameterMapping.getEventSourceElement();
eventSourceElement.setAttribute("disabled", "true");
}
}
[環 境] JDK 6.0 Update 11
Copyright (c) 2008-2009 FUJITSU Japan All rights reserved.
| コンストラクタの概要 | |
|---|---|
FlexibleAction()
|
|
| メソッドの概要 | |
|---|---|
protected void |
execute(ParameterMapping parameterMapping)
[概 要] アクション処理を実装するメソッドです。 |
ParameterMapping |
run(ParameterMapping parameterMapping)
[概 要] コントローラから呼び出されるアクションの基幹メソッドです。 |
| クラス jp.co.fujitsu.reffi.client.android.action.AbstractAction から継承されたメソッド |
|---|
addPermanent, findViewById, finishActivity, finishActivity, getActivity, getComponent, getComponentName, getComponentName, getComponentValue, getComponentValueAsString, getComponentValues, getController, getParameterMapping, getPermanent, getPermanent, getSharedPreferences, removePermanent, setActivity, setController, setEventHandlerReturn, setParameterMapping, showToast, showToast, startActivity, startActivity, startActivityForResult, startActivityForResult |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public FlexibleAction()
| メソッドの詳細 |
|---|
public ParameterMapping run(ParameterMapping parameterMapping)
throws java.lang.Exception
[概 要]
コントローラから呼び出されるアクションの基幹メソッドです。[詳 細]
アクション処理を実装する為の唯一のメソッドexecute(ParameterMapping)
をテンプレートコールします。
FlexibleActionにおけるrunメソッドは必ずnullを返却します。nullを返却されたコントローラは、
以降の処理を行いません。
FlexibleAction継承アクションでは、execute(ParameterMapping)
の処理でイベント処理が完結します。
[備 考]
Action 内の runAbstractAction 内の runparameterMapping - MVC各レイヤを伝播するパラメータオブジェクト
java.lang.Exception - アクション実行例外
protected void execute(ParameterMapping parameterMapping)
throws java.lang.Exception
[概 要]
アクション処理を実装するメソッドです。[詳 細]
FlexibleAction継承アクションは、このメソッドをオーバーライドして、 バリデーション、モデル実行、エレメント編集等の処理を任意に実装します。[備 考]
parameterMapping - MVC各レイヤを伝播するパラメータオブジェクト
java.lang.Exception
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||