Packagejp.co.fujitsu.reffi.client.flex.manager
Classpublic class ConsumerCoreManager
InheritanceConsumerCoreManager Inheritance Object

[概 要]

コンシューマを内包するConsumerCoreを管理するマネージャクラスです.

[詳 細]

destination名をキーにしたマッププロパティ「destinations」に、 購読を行うConsumerインスタンスと、 イベントハンドリングを行うConsumerCoreのインスタンスを保持します。 destinationsプロパティの構造は以下のようになります。
	 destinations:Dictionary
	     "destination名1" = consumerMap:Dictionary
	                            "consumer" = Consumer
	                            "coreList" = consumerCoreList:Array
	                                             [0] = ConsumerCore
	                                             [1] = ConsumerCore
	                                             [2] = ConsumerCore
	     "destination名2" = consumerMap:Dictionary
	                            "consumer" = Consumer
	                            "coreList" = consumerCoreList:Array
	                                             [0] = ConsumerCore
	     "destination名3" = consumerMap:Dictionary
	         :
	         :
	 
1 destination購読につき、1個のConsumerと、n個のConsumerCoreが保持されます。 既に購読中のdestinationをsubscribeした場合、登録済みのConsumerに対して 新規ConsumerCoreのresultHandlerメソッドとfaultHandlerメソッドがaddEventListenerされます。

[備 考]

ConsumerCoreをsubscribeモードfalseで実行させることでsubscribeの停止が行えますが、 ConsumerManager#unsubscribeを使用すると、任意のタイミングでのsubscribe停止が行えます。

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

See also

jp.co.fujitsu.reffi.client.flex.model.messaging.ConsumerCore


Public Properties
 PropertyDefined By
  destinations : Dictionary
[概 要] destinationとConsumer、ConsumerCoreのマッピング情報を管理するオブジェクトです.
ConsumerCoreManager
Public Methods
 MethodDefined By
  
ConsumerCoreManager(blocker:ConsumerBlocker)
[概 要] コンストラクタです.
ConsumerCoreManager
  
[static] [概 要] コンシューママネージャインスタンスを取得します.
ConsumerCoreManager
  
[概 要] 現在購読中のdestination名の配列を返却します.
ConsumerCoreManager
  
isSubscribing(destination:String):Boolean
[概 要] 引数destinationを現在購読しているか確認します.
ConsumerCoreManager
  
subscribe(destination:String, consumerCore:ConsumerCore, channelSet:ChannelSet = null):void
[概 要] destinationの購読を開始します.
ConsumerCoreManager
  
unsubscribe(destination:String, identifier:String = null):void
[概 要] destinationの購読を中止します.
ConsumerCoreManager
Property Detail
destinationsproperty
destinations:Dictionary

[概 要]

destinationとConsumer、ConsumerCoreのマッピング情報を管理するオブジェクトです.

[詳 細]

現在購読中のdestinationと、実際に購読処理を行うConsumer、 Consumerの購読結果を受信する為のイベントハンドラを持つConsumerCore をマッピング管理します。

[備 考]


Implementation
    public function get destinations():Dictionary
    public function set destinations(value:Dictionary):void
Constructor Detail
ConsumerCoreManager()Constructor
public function ConsumerCoreManager(blocker:ConsumerBlocker)

[概 要]

コンストラクタです.

[詳 細]

本クラスはシングルトンクラスのため外部からの呼び出しは行えません。

[備 考]

ConsumerManagerのインスタンスを取得する場合は、getInstance()を使用してください。

Parameters
blocker:ConsumerBlocker — シングルトン生成用ブロックインスタンス

See also

Method Detail
getInstance()method
public static function getInstance():ConsumerCoreManager

[概 要]

コンシューママネージャインスタンスを取得します.

[詳 細]

シングルトンコンシューママネージャインスタンスを取得して返却します。

[備 考]

Returns
ConsumerCoreManager — コンシューママネージャインスタンス
getSubscribingDestinationNames()method 
public function getSubscribingDestinationNames():Array

[概 要]

現在購読中のdestination名の配列を返却します.

[詳 細]

Consumer管理プロパティ「destinations」内のキー名配列を返却します。

[備 考]

Returns
Array — 現在購読中のdestination名配列
isSubscribing()method 
public function isSubscribing(destination:String):Boolean

[概 要]

引数destinationを現在購読しているか確認します.

[詳 細]

Consumer管理オブジェクト「destinations」から、引数destinationが 登録されているかどうか調べます。 destinationを購読しているConsumerCoreが一つでも有った場合はtrue を返却します。

[備 考]

Parameters

destination:String — 購読されているかどうか調べるdestination名

Returns
Boolean — 購読されている場合はtrue、それ以外はfalse
subscribe()method 
public function subscribe(destination:String, consumerCore:ConsumerCore, channelSet:ChannelSet = null):void

[概 要]

destinationの購読を開始します.

[詳 細]

指定されたdestinationが既に購読状態であった場合、購読中のConsumerに consumerCoreのresultHandlerとfaultHandlerをイベントリスナ追加します。 未読状態であった場合は新規にConsumerインスタンスを生成して同様にconsumerCore のresultHandlerとfaultHandlerをイベントリスナに追加します。

[備 考]

Parameters

destination:String — 購読を開始するdestination
 
consumerCore:ConsumerCore — このマネージャに管理されるConsumerCoreインスタンス
 
channelSet:ChannelSet (default = null) — 任意設定可能なチャンネル設定

unsubscribe()method 
public function unsubscribe(destination:String, identifier:String = null):void

[概 要]

destinationの購読を中止します.

[詳 細]

引数destinationを購読中のConsumerを停止します。 引数identifierが指定されている場合、購読イベントをハンドリング中のConsumerCore の中から、同じidentifierをもつものだけハンドリングを停止します。 destination購読イベントをハンドリング中のConsumerCoreが全て無くなった場合、 Consumerはunsubscribeを行います。

[備 考]

Parameters

destination:String — 購読を中止するdestination
 
identifier:String (default = null) — destinationを購読している複数ConsumerCoreを識別する為の文字列