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

java.lang.Object
  extended by jp.go.aist.rtm.RTC.port.CorbaConsumerBase
      extended by jp.go.aist.rtm.RTC.port.CorbaConsumer<OutPortCdr>
          extended by jp.go.aist.rtm.RTC.port.OutPortCorbaCdrConsumer
All Implemented Interfaces:
ObjectCreator<OutPortConsumer>, ObjectDestructor, OutPortConsumer

public class OutPortCorbaCdrConsumer
extends CorbaConsumer<OutPortCdr>
implements OutPortConsumer, ObjectCreator<OutPortConsumer>, ObjectDestructor

OutPortCorbaCdrConsumer class

This is an implementation class of the output Consumer that uses CORBA for means of communication.


Field Summary
 
Fields inherited from class jp.go.aist.rtm.RTC.port.CorbaConsumer
m_var
 
Fields inherited from class jp.go.aist.rtm.RTC.port.CorbaConsumerBase
m_objref
 
Constructor Summary
OutPortCorbaCdrConsumer()
           Constructor
 
Method Summary
protected  ReturnCode convertReturn(PortStatus status)
           Return codes conversion
 OutPortConsumer creator_()
           Creats OutPortCorbaCdrConsumer
 void destructor_(java.lang.Object obj)
           Destructs Object
 ReturnCode get(org.omg.CORBA.portable.OutputStream data)
           Reads data
 void init(Properties prop)
           Initializing configuration
static void OutPortCorbaCdrConsumerInit()
           Module initialization
 void setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           Setting outside buffer's pointer
 void setConnector(InPortConnector connector)
           set Connector
 void setListener(ConnectorBase.ConnectorInfo info, ConnectorListeners listeners)
           Set the listener.
 boolean subscribeInterface(NVListHolder properties)
           Subscribe the data receive notification
 void unsubscribeInterface(NVListHolder properties)
           Unsubscribe the data receive notification
 
Methods inherited from class jp.go.aist.rtm.RTC.port.CorbaConsumer
_ptr, releaseObject, setObject
 
Methods inherited from class jp.go.aist.rtm.RTC.port.CorbaConsumerBase
getObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutPortCorbaCdrConsumer

public OutPortCorbaCdrConsumer()
Constructor

Method Detail

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 OutPortConsumer
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 OutPortConsumer
Parameters:
buffer - A pointer to a data buffer to be used by OutPortProvider

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_WRITE
  2. - ON_BUFFER_FULL
  3. - ON_RECEIVED
  4. - ON_RECEIVER_FULL
  5. - ON_SENDER_EMPTY
  6. - ON_SENDER_TIMEOUT
  7. - ON_SENDER_ERROR

Specified by:
setListener in interface OutPortConsumer
Parameters:
info - Connector information
listeners - Listener objects

get

public ReturnCode get(org.omg.CORBA.portable.OutputStream data)
Reads data

Reads data set

Specified by:
get in interface OutPortConsumer
Parameters:
data - Object to receive the read data
Returns:
Read result (Successful:true, Failed:false)

subscribeInterface

public boolean subscribeInterface(NVListHolder properties)
Subscribe the data receive notification

Subscribe the data receive notification based on specified property information

Specified by:
subscribeInterface in interface OutPortConsumer
Parameters:
properties - Subscription information
Returns:
Subscription result (Successful:true, Failed:false)

unsubscribeInterface

public void unsubscribeInterface(NVListHolder properties)
Unsubscribe the data receive notification

Unsubscribe the data receive notification.

Specified by:
unsubscribeInterface in interface OutPortConsumer
Parameters:
properties - Unsubscription information

convertReturn

protected ReturnCode convertReturn(PortStatus status)
Return codes conversion

Parameters:
status - PortStatus
Returns:
ReturnCode

creator_

public OutPortConsumer creator_()
Creats OutPortCorbaCdrConsumer

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

destructor_

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

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

OutPortCorbaCdrConsumerInit

public static void OutPortCorbaCdrConsumerInit()
Module initialization

This initialization function registers OutPortCorbaCdrConsumer's factory.


setConnector

public void setConnector(InPortConnector connector)
set Connector

Specified by:
setConnector in interface OutPortConsumer
Parameters:
connector - InPortConnector