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

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

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
 
フィールドの概要
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承されたフィールド
m_objref, m_profile
 
コンストラクタの概要
CorbaPort(java.lang.String name)
          コンストラクタです。
 
メソッドの概要
protected  ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
          Interface情報を公開します。
 boolean registerConsumer(java.lang.String instance_name, java.lang.String type_name, CorbaConsumerBase consumer)
          このPortが要求するサービスのプレースホルダとしてのコンシューマ(Consumer)を登録します。
 boolean registerProvider(java.lang.String instance_name, java.lang.String type_name, org.omg.PortableServer.Servant provider)
          このPortにおいて提供したいサーバントを登録します。
protected  ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
          Interfaceに接続します。
protected  void unsubscribeInterfaces(ConnectorProfile connector_profile)
          Interfaceへの接続を解除します。
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承されたメソッド
_this, addProperty, appendInterface, connect, connectNext, deleteInterface, disconnect_all, disconnect, disconnectNext, eraseConnectorProfile, findConnProfile, findConnProfileIndex, get_connector_profile, get_connector_profiles, get_port_profile, getPortProfile, getPortRef, getProfile, getUUID, isEmptyId, isExistingConnId, notify_connect, notify_disconnect, setName, setOwner, setPortRef, setUUID, updateConnectorProfile
 
クラス RTC.PortPOA から継承されたメソッド
_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
 

コンストラクタの詳細

CorbaPort

public CorbaPort(java.lang.String name)

コンストラクタです。

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

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

このPortにおいて提供したいサーバントを登録します。
引数で与えられるインスタンス名とタイプ名が、 サーバント自身のインスタンス名とタイプ名として関連付けられます。

パラメータ:
instance_name - インスタンス名
type_name - タイプ名
provider - 当該Portに登録するProviderサーバント
戻り値:
既に同名の 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)

このPortが要求するサービスのプレースホルダとしてのコンシューマ(Consumer)を登録します。
引数で指定されたインスタンス名とタイプ名が、指定されたコンシューマと関連付けられます。

Port間の接続時には、同一のインスタンス名とタイプ名を持つサービスが、 他のPortから提供(Provide)されている場合、そのサービスのCORBAオブジェクト参照が コンシューマ(Consumer)に設定されます。

パラメータ:
instance_name - インスタンス名
type_name - タイプ名
consumer - Consumerオブジェクト
戻り値:
既に同名の instance_name が登録されていれば false を返します。

publishInterfaces

protected ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)

Interface情報を公開します。このPortが所有しているプロバイダ(Provider)に関する情報を、 ConnectorProfile#propertiesに代入します。代入する情報は、NameValueのnameとvalueとして 以下のものが格納されます。

port.<type_name>.<instance_name>: <CORBA.Object>

ここで、
<type_name>: PortInterfaceProfile::type_name
<instance_name>: PortInterfaceProfile::instance_name
です。ConnectorProfile::propertiesでは、これらを .(ドット)表記で、 NameValue のキーとしています。したがって、

 PortInterfaceProfile
 {
     instance_name = "PA10_0";
     type_name = "Manipulator";
     polarity = PROVIDED;
 }
 
ならば、
 NameValue = { "port.Manipulator.PA10_0": <Object reference> }
 
といった値がConnectorProfile#propertiesに格納され、他のPortに対して伝達されます。 他のPortでこのインタフェースを使用するConsumerが存在すれば、 ConnectorProfileからオブジェクトリファレンスが取得され、何らかの形で使用されます。

定義:
クラス PortBase 内の publishInterfaces
パラメータ:
connector_profile - プロバイダ(Provider)に関する情報を受け取るホルダオブジェクト
戻り値:
ReturnCode_t.RTC_OK

subscribeInterfaces

protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)

Interfaceに接続します。Portが所有するConsumerに適合するProviderに関する情報を ConnectorProfile#propertiesから抽出し、ConsumerにCORBAオブジェクト参照を設定します。

たとえば、Consumerが

  PortInterfaceProfile
  {
      instance_name = "PA10_0";
      type_name = "Manipulator";
      polarity = REQUIRED;
  }
 
として登録されていれば、他のPortの
  PortInterfaceProfile
  {
      instance_name = "PA10_0";
      type_name = "Manipulator";
      polarity = PROVIDED;
  }
 
として登録されているSerivce ProviderのCORBAオブジェクト参照を探して、Consumerに設定します。

実際には、ConnectorProfile#propertiesに

 NameValue = { "port.Manipulator.PA10_0": <Object reference> }
 
として登録されているNameValueを探し、そのCORBAオブジェクト参照をConsumerに設定します。

定義:
クラス PortBase 内の subscribeInterfaces
パラメータ:
connector_profile - 接続プロファイルオブジェクト
戻り値:
ReturnCode_t.RTC_OK

unsubscribeInterfaces

protected void unsubscribeInterfaces(ConnectorProfile connector_profile)

Interfaceへの接続を解除します。 与えられたConnectorProfileに関連するConsumerに設定された全てのObjectを解放し接続を解除します。

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