jp.go.aist.rtm.RTC.port
クラス CorbaPort

java.lang.Object
  上位を拡張 org.omg.PortableServer.Servant
      上位を拡張 RTC.PortServicePOA
          上位を拡張 jp.go.aist.rtm.RTC.port.PortBase
              上位を拡張 jp.go.aist.rtm.RTC.port.CorbaPort
すべての実装されたインタフェース:
SDOServiceOperations, org.omg.CORBA.portable.InvokeHandler, PortServiceOperations

public class CorbaPort
extends PortBase

CORBAを通信手段とするPortクラスです。


入れ子のクラスの概要
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承された入れ子のクラス/インタフェース
PortBase.connect_func, PortBase.disconnect_all_func, PortBase.disconnect_func, PortBase.find_conn_id, PortBase.find_interface, PortBase.find_port_ref
 
フィールドの概要
(package private)  java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaConsumerHolder> m_consumers
           
protected  Properties m_properties
           Properties
(package private)  java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaProviderHolder> m_providers
          Provider の情報を格納する vector
protected  Logbuf rtcout
          Logging用フォーマットオブジェクト
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承されたフィールド
m_connectionLimit, m_connectorsMutex, m_objref, m_onConnected, m_onConnectionLost, m_onDisconnected, m_onPublishInterfaces, m_onSubscribeInterfaces, m_onUnsubscribeInterfaces, m_ownerInstanceName, m_portconnListeners, m_profile, m_profile_mutex
 
コンストラクタの概要
CorbaPort(java.lang.String name)
          コンストラクタです。
 
メソッドの概要
 void activateInterfaces()
          Port の全てのインターフェースを activates する Port に登録されている全てのインターフェースを activate する。
 void deactivateInterfaces()
          @brief 全ての Port のインターフェースを deactivates する Port に登録されている全てのインターフェースを deactivate する。
 void init(Properties prop)
           Initializing properties This operation initializes outport's properties.
protected  ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
          Provider Interface 情報を公開する {@.ja この Port が所有する Provider インターフェースに関する情報を ConnectorProfile::properties に代入し他の Port に対して公開する。
 boolean registerConsumer(java.lang.String instance_name, java.lang.String type_name, CorbaConsumerBase consumer)
           
 boolean registerProvider(java.lang.String instance_name, java.lang.String type_name, org.omg.PortableServer.Servant provider)
          @brief Provider を登録する {@.ja この Port において提供したいサーバントをこの Port に対して登録す る。
protected  ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
          Provider Interface 情報を取得する {@.ja この Portが所有する Consumer Interface に適合する Provider Interface に関する情報をConnectorProfile::properties から抽出し Consumer Interface にオブジェクト参照をセットする。
protected  void unsubscribeInterfaces(ConnectorProfile connector_profile)
          Interface への接続を解除する 与えられた ConnectorProfile に関連する Consumer にセットされた すべての Object を解放し接続を解除する。
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承されたメソッド
_publishInterfaces, _this, addProperty, appendInterface, appendProperty, checkPorts, connect, connectNext, deleteInterface, disconnect_all, disconnect, disconnectNext, eraseConnectorProfile, findConnProfile, findConnProfileIndex, get_connector_profile, get_connector_profiles, get_port_profile, getName, getPortProfile, getPortRef, getProfile, getUUID, isEmptyId, isExistingConnId, notify_connect, notify_disconnect, onConnected, onConnectNextport, onDisconnected, onDisconnectNextport, onNotifyConnect, onNotifyDisconnect, onPublishInterfaces, onSubscribeInterfaces, onUnsubscribeInterfaces, setConnectionLimit, setName, setOnConnected, setOnConnectionLost, setOnDisconnected, setOnPublishInterfaces, setOnSubscribeInterfaces, setOnUnsubscribeInterfaces, setOwner, setPortConnectListenerHolder, setPortRef, setUUID, updateConnectorProfile, updateConnectors
 
クラス RTC.PortServicePOA から継承されたメソッド
_all_interfaces, _invoke, _this
 
クラス org.omg.PortableServer.Servant から継承されたメソッド
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

m_providers

java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaProviderHolder> m_providers
Provider の情報を格納する vector


m_consumers

java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaConsumerHolder> m_consumers

rtcout

protected Logbuf rtcout

Logging用フォーマットオブジェクト


m_properties

protected Properties m_properties

Properties

コンストラクタの詳細

CorbaPort

public CorbaPort(java.lang.String name)

コンストラクタです。

パラメータ:
name - Port名称
メソッドの詳細

init

public void init(Properties prop)

Initializing properties

This operation initializes outport's properties. If a property "connection_limit" is set and appropriate value is set to this property value, the number of maximum connection is set as this value. If the property does not exist or invalid value is set to this property, the maximum number of connection will be set unlimited.

パラメータ:
prop - properties of the CorbaPort

registerProvider

public boolean registerProvider(java.lang.String instance_name,
                                java.lang.String type_name,
                                org.omg.PortableServer.Servant provider)
                         throws org.omg.PortableServer.POAPackage.ServantAlreadyActive,
                                org.omg.PortableServer.POAPackage.WrongPolicy,
                                org.omg.PortableServer.POAPackage.ObjectNotActive
@brief Provider を登録する

この Port において提供したいサーバントをこの Port に対して登録す る。サーバントは、引数で与えられる instance_name, type_name を、 サーバント自身のインスタンス名およびタイプ名として、サーバントに 関連付けられる。この関数により、サーバントは CorbaPort 内部に保 持されるとともに、PortInterfaceProfile にRTC::PROVIDED インター フェースとして登録される。

パラメータ:
instance_name - サーバントのインスタンス名
type_name - サーバントのタイプ名
provider - CORBA サーバント
戻り値:
既に同名の instance_name が登録されていれば false を返す。
例外:
org.omg.PortableServer.POAPackage.ServantAlreadyActive
org.omg.PortableServer.POAPackage.WrongPolicy
org.omg.PortableServer.POAPackage.ObjectNotActive

registerConsumer

public boolean registerConsumer(java.lang.String instance_name,
                                java.lang.String type_name,
                                CorbaConsumerBase consumer)

activateInterfaces

public void activateInterfaces()
Port の全てのインターフェースを activates する

Port に登録されている全てのインターフェースを activate する。

定義:
クラス PortBase 内の activateInterfaces

deactivateInterfaces

public void deactivateInterfaces()
@brief 全ての Port のインターフェースを deactivates する

Port に登録されている全てのインターフェースを deactivate する。

定義:
クラス PortBase 内の deactivateInterfaces

publishInterfaces

protected ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
Provider Interface 情報を公開する

この Port が所有する Provider インターフェースに関する情報を ConnectorProfile::properties に代入し他の Port に対して公開する。 今、RTCのインスタンス名等の情報が以下の通りであるとして、

NameValue 型の ConnectorProfile::properties の name と value として 以下のものが格納される。 なお、旧バージョンとの互換性のため以下の表記の NameValue も同時 に格納されるが、将来のバージョンでは削除される可能性がある。 これらの値は ConnectorProfile::properties に格納され、他のポートに対して 伝達される。他の Port でこのインターフェースを使用する Consumer が 存在すれば、ConnectorProfile からこのキーからオブジェクトリファレンスを 取得し何らかの形で使用される。

定義:
クラス PortBase 内の publishInterfaces
パラメータ:
connector_profile - コネクタプロファイル
戻り値:
ReturnCode_t 型のリターンコード

subscribeInterfaces

protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
Provider Interface 情報を取得する

この Portが所有する Consumer Interface に適合する Provider Interface に関する情報をConnectorProfile::properties から抽出し Consumer Interface にオブジェクト参照をセットする。 今、RTC のインスタンス名や Consumer Interface 等の情報が以下のと おりであると仮定すると、 - RTCインスタンス名: rtc_iname - ポート名: port_name - インターフェース極性: if_polarity - インターフェース型名: if_tname - インターフェースインスタンス名: if_iname この Consumer Interface を表すインターフェース指定子は以下のよう に表される。 .port..required.. この関数は、まず引数 ConnectorProfile::properties に上記インター フェース指定子をキーとして格納されている Provider Interface 指定 子を探し出す。さらに、その Provider Interface 指定子をキーとして 格納されている Provider Interface の参照を表す IOR 文字列を取得 し、Consumer Interface にセットする。 今、仮に、Provider を prov(n), その参照をIOR(n) さらに Consumer をcons(n) のように記述し、これらすべてのインターフェースの型が同 一であり、ConnectorProfile に以下の値が設定されているとする。

 ConnectorProfile::properties =
 {
   prov0: IOR0,
   prov1: IOR1,
   prov2: IOR2,
   cons0: prov2,
   cons1: prov1,
   cons2: prov0
 }
 
このとき、cons(0..2) にはそれぞれ、参照が以下のようにセットされる。
   cons0 = IOR2
   cons1 = IOR1
   cons2 = IOR0
 
なお、旧バージョンとの互換性のため、 ConnectorProfile::properties に Consumer Interface をキーとした 値がセットされていない場合でも、次のルールが適用される。 今、仮に Consumer Interface が
  PortInterfaceProfile
  {
    instance_name = "PA10_0";
    type_name     = "Manipulator";
    polarity      = REQUIRED;
  }
 
として登録されていれば、他の Port の
  PortInterfaceProfile
  {
    instance_name = "PA10_0";
    type_name     = "Manipulator";
    polarity      = PROVIDED;
  }
 
として登録されている Serivce Provider のオブジェクト参照を探し、 Consumer にセットする。実際には、ConnectorProfile::properties に
 NameValue = { "port.Manipulator.PA10_0":  }
 

 として登録されている NameValue を探し、そのオブジェクト参照を
 Consumer にセットする。
 
 

定義:
クラス PortBase 内の subscribeInterfaces
パラメータ:
connector_profile - コネクタプロファイル
戻り値:
ReturnCode_t 型のリターンコード

unsubscribeInterfaces

protected void unsubscribeInterfaces(ConnectorProfile connector_profile)
Interface への接続を解除する

与えられた ConnectorProfile に関連する Consumer にセットされた すべての Object を解放し接続を解除する。

定義:
クラス PortBase 内の unsubscribeInterfaces
パラメータ:
connector_profile - コネクタプロファイルオブジェクト