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

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

public abstract class InPortBase
extends PortBase

InPortBase

Port for InPort

This is an implementation class for the data input 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
 
フィールドの概要
protected  java.util.Vector<InPortConnector> m_connectors
           
protected  java.util.Vector<java.lang.String> m_consumerTypes
           
protected  ConnectorListeners m_listeners
           
protected  Properties m_properties
           
protected  java.util.Vector<java.lang.String> m_providerTypes
           
protected  boolean m_singlebuffer
           
protected  BufferBase<org.omg.CORBA.portable.OutputStream> m_thebuffer
           
 
クラス 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_profile, m_profile_mutex, rtcout
 
コンストラクタの概要
InPortBase(java.lang.String name, java.lang.String data_type)
           Constructor
 
メソッドの概要
 void activateInterfaces()
           Activate all Port interfaces This operation activate all interfaces that is registered in the ports.
 void addConnectorDataListener(int type, ConnectorDataListenerT listener)
           
 void addConnectorDataListener(int type, ConnectorDataListenerT listener, boolean autoclean)
          ConnectorDataListener リスナを追加する {@.ja バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。
 void addConnectorListener(int type, ConnectorListener listener)
           
 void addConnectorListener(int type, ConnectorListener listener, boolean autoclean)
          ConnectorListener リスナを追加する {@.ja バッファ書き込みまたは読み出しイベントに関連する各種リスナを 設定する。
 ReturnCode_t connect(ConnectorProfileHolder connector_profile)
           Connect the Port This operation establishes connection according to the given ConnectionProfile inforamtion.
 java.util.Vector<InPortConnector> connectors()
          Connector を取得 現在所有しているコネクタを取得する。
protected  InPortConnector createConnector(ConnectorProfileHolder cprof, Properties prop, InPortProvider provider)
           InPortPushConnector creation Connector is created, preserves it in m_connectors.
protected  InPortConnector createConnector(ConnectorProfileHolder cprof, Properties prop, OutPortConsumer consumer)
           InPortPullConnector creation Connector is created, preserves it in m_connectors.
protected  OutPortConsumer createConsumer(ConnectorProfileHolder cprof, Properties prop)
           InPort provider creation OutPortConsumer is created.
protected  InPortProvider createProvider(ConnectorProfileHolder cprof, Properties prop)
           InPort provider creation InPortProvider is created, and information is published to ConnectorProfile.
 void deactivateInterfaces()
           Deactivate all Port interfaces This operation deactivate all interfaces that is registered in the ports.
 InPortConnector getConnectorById(java.lang.String id)
           Getting ConnectorProfile by ID This operation returns Connector specified by ID.
 InPortConnector getConnectorByName(java.lang.String name)
           Getting Connector by name This operation returns Connector specified by name.
 java.util.Vector<java.lang.String> getConnectorIds()
           ConnectorId list This operation returns ConnectorId list
 java.util.Vector<java.lang.String> getConnectorNames()
           Connector name list This operation returns Connector name list
 boolean getConnectorProfileById(java.lang.String id, ConnectorBase.ConnectorInfoHolder prof)
           Getting ConnectorProfile by name This operation returns ConnectorProfile specified by name
 boolean getConnectorProfileByName(java.lang.String name, ConnectorBase.ConnectorInfoHolder prof)
           Getting ConnectorProfile by name This operation returns ConnectorProfile specified by name
 java.util.Vector<ConnectorBase.ConnectorInfo> getConnectorProfiles()
          ConnectorProfile を取得 現在所有しているコネクタのProfileを取得する。
 void init(Properties prop)
           Initializing properties This method initializes the port in the specified property.
protected  void initConsumers()
           OutPort consumer initialization
protected  void initProviders()
           InPort provider initialization
 boolean isLittleEndian()
           
 Properties properties()
           Get properties This method gets properties in the port.
protected  ReturnCode_t publishInterfaces(ConnectorProfileHolder cprof)
          Interface情報を公開する [@.en Publish interface information} Interface情報を公開する。
abstract  boolean read()
          RTObject_impl::readAll()から呼ばれる仮想関数
 void removeConnectorDataListener(int type, ConnectorDataListenerT listener)
          ConnectorDataListener リスナを削除する 設定した各種リスナを削除する。
 void removeConnectorListener(int type, ConnectorListener listener)
          ConnectorDataListener リスナを削除する 設定した各種リスナを削除する。
protected  ReturnCode_t subscribeInterfaces(ConnectorProfileHolder cprof)
          Interfaceに接続する {@.ja Interfaceに接続する。
protected  void unsubscribeInterfaces(ConnectorProfile connector_profile)
           Disconnect the interface connection Disconnect the interface connection.
 
クラス jp.go.aist.rtm.RTC.port.PortBase から継承されたメソッド
_publishInterfaces, _this, addProperty, appendInterface, appendProperty, checkPorts, 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, setConnectionLimit, setName, setOnConnected, setOnConnectionLost, setOnDisconnected, setOnPublishInterfaces, setOnSubscribeInterfaces, setOnUnsubscribeInterfaces, setOwner, 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_singlebuffer

protected boolean m_singlebuffer

m_thebuffer

protected BufferBase<org.omg.CORBA.portable.OutputStream> m_thebuffer

m_properties

protected Properties m_properties

m_providerTypes

protected java.util.Vector<java.lang.String> m_providerTypes

m_consumerTypes

protected java.util.Vector<java.lang.String> m_consumerTypes

m_connectors

protected java.util.Vector<InPortConnector> m_connectors

m_listeners

protected ConnectorListeners m_listeners
コンストラクタの詳細

InPortBase

public InPortBase(java.lang.String name,
                  java.lang.String data_type)

Constructor

パラメータ:
name - Port name
data_type - Specify the data type used in the InPort object.
メソッドの詳細

properties

public Properties properties()

Get properties

This method gets properties in the port.

戻り値:
Properties Properties

connectors

public final java.util.Vector<InPortConnector> connectors()
Connector を取得

現在所有しているコネクタを取得する。

戻り値:
connector のリスト

getConnectorProfiles

public java.util.Vector<ConnectorBase.ConnectorInfo> getConnectorProfiles()
ConnectorProfile を取得

現在所有しているコネクタのProfileを取得する。

戻り値:
ConnectorProfile のリスト

getConnectorIds

public java.util.Vector<java.lang.String> getConnectorIds()

ConnectorId list

This operation returns ConnectorId list

戻り値:
Vector connector list

getConnectorNames

public java.util.Vector<java.lang.String> getConnectorNames()

Connector name list

This operation returns Connector name list

戻り値:
Vector connector name list

getConnectorById

public InPortConnector getConnectorById(java.lang.String id)

Getting ConnectorProfile by ID

This operation returns Connector specified by ID.

パラメータ:
id - Connector ID
戻り値:
InPortConnector connector

getConnectorByName

public InPortConnector getConnectorByName(java.lang.String name)

Getting Connector by name

This operation returns Connector specified by name.

パラメータ:
name - Connector ID
戻り値:
InPortConnector connector

getConnectorProfileById

public boolean getConnectorProfileById(java.lang.String id,
                                       ConnectorBase.ConnectorInfoHolder prof)

Getting ConnectorProfile by name

This operation returns ConnectorProfile specified by name

パラメータ:
id - Connector ID
prof - ConnectorProfileHolder
戻り値:
boolean false specified ID does not exist

getConnectorProfileByName

public boolean getConnectorProfileByName(java.lang.String name,
                                         ConnectorBase.ConnectorInfoHolder prof)

Getting ConnectorProfile by name

This operation returns ConnectorProfile specified by name

パラメータ:
name - Connector ID
prof - ConnectorProfile
戻り値:
boolean false specified name does not exist

init

public void init(Properties prop)

Initializing properties

This method initializes the port in the specified property.

パラメータ:
prop - Property for setting ports

read

public abstract boolean read()
RTObject_impl::readAll()から呼ばれる仮想関数

DataPort からデータを読み出す

戻り値:
true:成功,false:失敗

activateInterfaces

public void activateInterfaces()

Activate all Port interfaces

This operation activate all interfaces that is registered in the

ports.

定義:
クラス PortBase 内の activateInterfaces

deactivateInterfaces

public void deactivateInterfaces()

Deactivate all Port interfaces

This operation deactivate all interfaces that is registered in the

ports.

定義:
クラス PortBase 内の deactivateInterfaces

connect

public ReturnCode_t connect(ConnectorProfileHolder connector_profile)

Connect the Port

This operation establishes connection according to the given ConnectionProfile inforamtion. This function is premised on calling from mainly application program or tools.

To establish the connection among Ports of RT-Components, application programs must call this operation giving ConnectorProfile with valid values as an argument.

Out of ConnectorProfile member variables, "name", "ports" and "properties" members shall be set valid data. "connector_id" shall be set as empty string value or valid string UUID value.

ConnectorProfile::name that is connection identifier shall be any valid CORBA::string.

ConnectorProfile::connector_id shall be set unique identifier (usually UUID is used) for all connections. Since UUID string value is usually set in the connect() function, caller should just set empty string. If the connect() is called with the same UUID as existing connection, this function returns PRECONDITION_NOT_MET error. However, in order to update the existing connection profile, the "connect()" operation with existing connector ID might be used as valid method by future extension

ConnectorProfile::ports, which is sequence of RTC::PortService references, shall store usually two or more ports' references. As exceptions, the "connect()" operation might be called with only one reference in ConnectorProfile, in case of just getting interfaces information from the port, or connecting a special port (i.e. the peer port except RTC::PortService on CORBA).

ConnectorProfile::properties might be used to give certain properties to the service interfaces associated with the port. The properties is a sequence variable with a pair of key string and Any type value. Although the A variable can store any type of values, it is not recommended except string.

The following is the summary of the ConnectorProfile member to be set when this operation is called.

connect() operation will call the first port in the sequence of the ConnectorProfile.

"noify_connect()"s perform cascaded call to the ports stored in the ConnectorProfile::ports by order. Even if errors are raised by intermediate notify_connect() operation, as long as ports' object references are valid, it is guaranteed that this cascaded call is completed in all the ports. If invalid or dead ports exist in the port's sequence, the ports are skipped and notify_connect() is called for the next valid port.

connect() function returns RTC_OK if all the notify_connect() return RTC_OK. At this time the connection is completed. If notify_connect()s return except RTC_OK, connect() calls disconnect() operation with the connector_id to destruct the connection, and then it returns error code from notify_connect().

The ConnectorProfile argument of the connect() operation returns ConnectorProfile::connector_id and various information about service interfaces that is published by publishInterfaces() in the halfway ports. The connect() and halfway notify_connect() functions never change ConnectorProfile::{name, ports}.

定義:
インタフェース PortServiceOperations 内の connect
オーバーライド:
クラス PortBase 内の connect
パラメータ:
connector_profile - The ConnectorProfile.
戻り値:
ReturnCode_t The return code of ReturnCode_t type.

publishInterfaces

protected ReturnCode_t publishInterfaces(ConnectorProfileHolder cprof)
Interface情報を公開する [@.en Publish interface information}

Interface情報を公開する。 引数の ConnectorProfile に格納されている dataflow_type が push 型 の場合は、指定された interface_type の InPortProvider に関する情報 を ConnectorProfile::properties に書込み呼び出し側に戻す。 [@.en Publish interface information. Assign the Provider information that owned by this port to ConnectorProfile#properties}


  dataport.dataflow_type
 

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

subscribeInterfaces

protected ReturnCode_t subscribeInterfaces(ConnectorProfileHolder cprof)
Interfaceに接続する

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

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

unsubscribeInterfaces

protected void unsubscribeInterfaces(ConnectorProfile connector_profile)

Disconnect the interface connection

Disconnect the interface connection.

Release all objects set in Consumer associated with

given ConnectorProfile and unscribe the interface.

定義:
クラス PortBase 内の unsubscribeInterfaces
パラメータ:
connector_profile - The connector profile

addConnectorDataListener

public void addConnectorDataListener(int type,
                                     ConnectorDataListenerT listener,
                                     boolean autoclean)
ConnectorDataListener リスナを追加する

バッファ書き込みまたは読み出しイベントに関連する各種リスナを設定する。 設定できるリスナのタイプとコールバックイベントは以下の通り

リスナは ConnectorDataListener を継承し、以下のシグニチャを持つ operator() を実装している必要がある。

 ConnectorDataListener::
         operator()(const ConnectorProfile&, const cdrStream&)
 
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は OutPortに移り、OutPort解体時もしくは、 removeConnectorDataListener() により削除時に自動的に解体される。 リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引 数に false を指定し、自動的な解体を抑制することができる。

パラメータ:
type - リスナタイプ
listener - リスナオブジェクトへのポインタ
autoclean - リスナオブジェクトの自動的解体を行うかどうかのフラグ

addConnectorDataListener

public void addConnectorDataListener(int type,
                                     ConnectorDataListenerT listener)

removeConnectorDataListener

public void removeConnectorDataListener(int type,
                                        ConnectorDataListenerT listener)
ConnectorDataListener リスナを削除する

設定した各種リスナを削除する。 [@.en This operation removes a specified listener.}

パラメータ:
type - リスナタイプ
listener - リスナオブジェクトへのポインタ

addConnectorListener

public void addConnectorListener(int type,
                                 ConnectorListener listener,
                                 boolean autoclean)
ConnectorListener リスナを追加する

バッファ書き込みまたは読み出しイベントに関連する各種リスナを 設定する。 設定できるリスナのタイプは

リスナは以下のシグニチャを持つ operator() を実装している必要がある。

 ConnectorListener::operator()(const ConnectorProfile&)
 
デフォルトでは、この関数に与えたリスナオブジェクトの所有権は OutPortに移り、OutPort解体時もしくは、 removeConnectorListener() により削除時に自動的に解体される。 リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引 数に false を指定し、自動的な解体を抑制することができる。

パラメータ:
type - リスナタイプ
listener - リスナオブジェクトへのポインタ
autoclean - リスナオブジェクトの自動的解体を行うかどうかのフラグ

addConnectorListener

public void addConnectorListener(int type,
                                 ConnectorListener listener)

removeConnectorListener

public void removeConnectorListener(int type,
                                    ConnectorListener listener)
ConnectorDataListener リスナを削除する

設定した各種リスナを削除する。

パラメータ:
type - リスナタイプ
listener - リスナオブジェクトへのポインタ

initProviders

protected void initProviders()

InPort provider initialization


initConsumers

protected void initConsumers()

OutPort consumer initialization


createProvider

protected InPortProvider createProvider(ConnectorProfileHolder cprof,
                                        Properties prop)

InPort provider creation

InPortProvider is created,

and information is published to ConnectorProfile.

null is returned if failing in creation.


createConsumer

protected OutPortConsumer createConsumer(ConnectorProfileHolder cprof,
                                         Properties prop)

InPort provider creation

OutPortConsumer is created.

null is returned if failing in creation.


createConnector

protected InPortConnector createConnector(ConnectorProfileHolder cprof,
                                          Properties prop,
                                          InPortProvider provider)

InPortPushConnector creation

Connector is created,

preserves it in m_connectors.

null is returned if failing in creation.


createConnector

protected InPortConnector createConnector(ConnectorProfileHolder cprof,
                                          Properties prop,
                                          OutPortConsumer consumer)

InPortPullConnector creation

Connector is created,

preserves it in m_connectors.

0 is returned if failing in creation.


isLittleEndian

public boolean isLittleEndian()