public class CorbaPort extends PortBase
CORBAを通信手段とするPortクラスです。
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用フォーマットオブジェクト
|
m_connectionLimit, m_connectorsMutex, m_objref, m_onConnected, m_onConnectionLost, m_onConnectionLost_mutex, 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 を解放し接続を解除する。
|
_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
_all_interfaces, _invoke, _this
java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaProviderHolder> m_providers
java.util.Vector<jp.go.aist.rtm.RTC.port.CorbaPort.CorbaConsumerHolder> m_consumers
protected Logbuf rtcout
Logging用フォーマットオブジェクト
protected Properties m_properties
Properties
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 CorbaPortpublic 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 において提供したいサーバントをこの Port に対して登録す る。サーバントは、引数で与えられる instance_name, type_name を、 サーバント自身のインスタンス名およびタイプ名として、サーバントに 関連付けられる。この関数により、サーバントは CorbaPort 内部に保 持されるとともに、PortInterfaceProfile にRTC::PROVIDED インター フェースとして登録される。
instance_name
- サーバントのインスタンス名
type_name
- サーバントのタイプ名
provider
- CORBA サーバント
org.omg.PortableServer.POAPackage.ServantAlreadyActive
org.omg.PortableServer.POAPackage.WrongPolicy
org.omg.PortableServer.POAPackage.ObjectNotActive
public boolean registerConsumer(java.lang.String instance_name, java.lang.String type_name, CorbaConsumerBase consumer)
public void activateInterfaces()
Port に登録されている全てのインターフェースを activate する。
activateInterfaces
クラス内 PortBase
public void deactivateInterfaces()
Port に登録されている全てのインターフェースを deactivate する。
deactivateInterfaces
クラス内 PortBase
protected ReturnCode_t publishInterfaces(ConnectorProfileHolder connector_profile)
この Port が所有する Provider インターフェースに関する情報を ConnectorProfile::properties に代入し他の Port に対して公開する。 今、RTCのインスタンス名等の情報が以下の通りであるとして、
publishInterfaces
クラス内 PortBase
connector_profile
- コネクタプロファイル
protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder connector_profile)
この 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 を表すインターフェース指定子は以下のよう
に表される。
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 にセットする。
subscribeInterfaces
クラス内 PortBase
connector_profile
- コネクタプロファイル
protected void unsubscribeInterfaces(ConnectorProfile connector_profile)
与えられた ConnectorProfile に関連する Consumer にセットされた すべての Object を解放し接続を解除する。
unsubscribeInterfaces
クラス内 PortBase
connector_profile
- コネクタプロファイルオブジェクト