jp.go.aist.rtm.RTC.port
Class OutPortCorbaCdrProvider

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by OpenRTM.OutPortCdrPOA
          extended by jp.go.aist.rtm.RTC.port.OutPortCorbaCdrProvider
All Implemented Interfaces:
ObjectCreator<OutPortProvider>, ObjectDestructor, OutPortProvider, OutPortCdrOperations, org.omg.CORBA.portable.InvokeHandler

public class OutPortCorbaCdrProvider
extends OutPortCdrPOA
implements OutPortProvider, ObjectCreator<OutPortProvider>, ObjectDestructor

OutPortCorbaCdrProvider class

This is an implementation class of OutPort Provider that uses CORBA for mean of communication.


Field Summary
protected  NVListHolder m_properties
          接続プロフィールを保持するメンバ変数です。
 
Constructor Summary
OutPortCorbaCdrProvider()
           Constructor
 
Method Summary
 OutPortCdr _this()
           Gets CORBA object referense of this OpenRTM.OutPortCdr
protected  PortStatus convertReturn(ReturnCode status)
           Converts ReturnCode into PortStatus.
 OutPortProvider creator_()
           Creats OutPortCorbaCdrProvider
 void destructor_(java.lang.Object obj)
           Destructs OutPortCorbaCdrProvider
 PortStatus get(CdrDataHolder data)
           [CORBA interface] Get data from the buffer
 void init(Properties prop)
           Initializing configuration
static void OutPortCorbaCdrProviderInit()
           Module initialization
 boolean publishInterface(NVListHolder properties)
           Publish interface information
 void publishInterfaceProfile(NVListHolder properties)
           Publish InterfaceProfile information
 void setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           Setting outside buffer's pointer
 void setConnector(OutPortConnector connector)
           set Connector
protected  void setDataFlowType(java.lang.String dataFlowType)
           Sets data flow type of the interface profile
protected  void setDataType(java.lang.String dataType)
           Sets DataType of the interface profile
protected  void setInterfaceType(java.lang.String interfaceType)
           Sets interface Type of the interface profile
 void setListener(ConnectorBase.ConnectorInfo info, ConnectorListeners listeners)
           Set the listener.
protected  void setPortType(java.lang.String portType)
           Sets PortProfile of the interface profile
protected  void setSubscriptionType(java.lang.String subscriptionType)
           Sets subscription type of the interface profile
 
Methods inherited from class OpenRTM.OutPortCdrPOA
_all_interfaces, _invoke, _this
 
Methods inherited from class 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_properties

protected NVListHolder m_properties

接続プロフィールを保持するメンバ変数です。

Constructor Detail

OutPortCorbaCdrProvider

public OutPortCorbaCdrProvider()
Constructor

Method Detail

_this

public OutPortCdr _this()
Gets CORBA object referense of this OpenRTM.OutPortCdr

Overrides:
_this in class OutPortCdrPOA
Returns:
CORBA object referense of this OpenRTM.OutPortCdr

init

public void init(Properties prop)
Initializing configuration

This operation would be called to configure in initialization. In the concrete class, configuration should be performed getting appropriate information from the given Properties data. This function might be called right after instantiation and connection sequence respectivly. Therefore, this function should be implemented assuming multiple call.

Specified by:
init in interface OutPortProvider
Parameters:
prop - Configuration information

setBuffer

public void setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
Setting outside buffer's pointer

A pointer to a buffer from which OutPortProvider retrieve data. If already buffer is set, previous buffer's pointer will be overwritten by the given pointer to a buffer. Since OutPortProvider does not assume ownership of the buffer pointer, destructor of the buffer should be done by user.

Specified by:
setBuffer in interface OutPortProvider
Parameters:
buffer - A pointer to a data buffer to be used by OutPortProvider

get

public PortStatus get(CdrDataHolder data)
[CORBA interface] Get data from the buffer

Get data from the internal buffer.

Specified by:
get in interface OutPortCdrOperations
Parameters:
data - The buffer to get data.
Returns:
Prot status

convertReturn

protected PortStatus convertReturn(ReturnCode status)
Converts ReturnCode into PortStatus.

Parameters:
status - ReturnCode
Returns:
PortStatus

creator_

public OutPortProvider creator_()
Creats OutPortCorbaCdrProvider

Specified by:
creator_ in interface ObjectCreator<OutPortProvider>
Returns:
Object Created instances

destructor_

public void destructor_(java.lang.Object obj)
Destructs OutPortCorbaCdrProvider

Specified by:
destructor_ in interface ObjectDestructor
Parameters:
obj - The target instances for destruction

OutPortCorbaCdrProviderInit

public static void OutPortCorbaCdrProviderInit()
Module initialization

This initialization function registers OutPortCorbaCdrProvider's factory.


publishInterfaceProfile

public void publishInterfaceProfile(NVListHolder properties)
Publish InterfaceProfile information

Publish interfaceProfile information. Check the dataport.interface_type value of the NameValue object specified by an argument in property information and get information only when the interface type of the specified port is matched.

Specified by:
publishInterfaceProfile in interface OutPortProvider
Parameters:
properties - Properties to get InterfaceProfile information

publishInterface

public boolean publishInterface(NVListHolder properties)
Publish interface information

Publish interface information. Check the dataport.interface_type value of the NameValue object specified by an argument in the property information, and add the information to the NameValue if this port is not specified. This does not do anything if the same interface is already subscribed.

Specified by:
publishInterface in interface OutPortProvider
Parameters:
properties - Properties to receive interface information
Returns:
true: normal return

setConnector

public void setConnector(OutPortConnector connector)
set Connector

OutPort creates OutPortConnector object when it establishes connection between OutPort and InPort, and it calls this function with a pointer to the connector object. Since the OutPort has the ownership of this connector, OutPortProvider should not delete it.

Specified by:
setConnector in interface OutPortProvider
Parameters:
connector - OutPortConnector

setPortType

protected void setPortType(java.lang.String portType)
Sets PortProfile of the interface profile

Parameters:
portType - port type

setDataType

protected void setDataType(java.lang.String dataType)
Sets DataType of the interface profile

Parameters:
dataType - dataType

setInterfaceType

protected void setInterfaceType(java.lang.String interfaceType)
Sets interface Type of the interface profile

Parameters:
interfaceType - Intereface Type

setDataFlowType

protected void setDataFlowType(java.lang.String dataFlowType)
Sets data flow type of the interface profile

Parameters:
dataFlowType - Data flow type

setSubscriptionType

protected void setSubscriptionType(java.lang.String subscriptionType)
Sets subscription type of the interface profile

Parameters:
subscriptionType - Subscription type

setListener

public void setListener(ConnectorBase.ConnectorInfo info,
                        ConnectorListeners listeners)
Set the listener.

OutPort provides callback functionality that calls specific listener objects according to the events in the data publishing process. For details, see documentation of ConnectorDataListener class and ConnectorListener class in ConnectorListener.h. In this OutPortCorbaCdrProvider provides the following callbacks.

  1. - ON_BUFFER_READ
  2. - ON_SEND
  3. - ON_BUFFER_EMPTY
  4. - ON_BUFFER_READ_TIMEOUT
  5. - ON_SENDER_EMPTY
  6. - ON_SENDER_TIMEOUT
  7. - ON_SENDER_ERROR

Specified by:
setListener in interface OutPortProvider
Parameters:
info - @param info Connector information
listeners - Listener objects