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

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by OpenRTM.InPortCdrPOA
          extended by jp.go.aist.rtm.RTC.port.InPortCorbaCdrProvider
All Implemented Interfaces:
ObjectCreator<InPortProvider>, ObjectDestructor, InPortProvider, InPortCdrOperations, org.omg.CORBA.portable.InvokeHandler

public class InPortCorbaCdrProvider
extends InPortCdrPOA
implements InPortProvider, ObjectCreator<InPortProvider>, ObjectDestructor

InPortCorbaCdrProvider class

This is an implementation class of the input port Provider that uses CORBA for means of communication.


Field Summary
protected  NVListHolder m_properties
          インタフェース情報を保持するオブジェクトです。
 
Constructor Summary
InPortCorbaCdrProvider()
           Constructor
 
Method Summary
 InPortCdr _this()
           Gets CORBA object referense of this OpenRTM.InPortCdr
protected  PortStatus convertReturn(ReturnCode status, com.sun.corba.se.impl.encoding.EncapsOutputStream data)
           {p.en Return codes conversion}
 InPortProvider creator_()
           Creats InPortCorbaCdrProvider
 void destructor_(java.lang.Object obj)
           Destructs InPortCorbaCdrProvider
 void init(Properties prop)
           Initializing configuration
static void InPortCorbaCdrProviderInit()
           Module initialization
 boolean publishInterface(NVListHolder properties)
           Publish interface information
 void publishInterfaceProfile(NVListHolder properties)
           Publish InterfaceProfile information
 PortStatus put(byte[] data)
           [CORBA interface] Write data into the buffer
 PortStatus put(CdrDataHolder data)
           [CORBA interface] Write data into the buffer
 void setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           Setting outside buffer's pointer
 void setConnector(InPortConnector 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 setSubscriptionType(java.lang.String subscriptionType)
           Sets subscription type of the interface profile
 
Methods inherited from class OpenRTM.InPortCdrPOA
_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

InPortCorbaCdrProvider

public InPortCorbaCdrProvider()
Constructor

Method Detail

_this

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

Overrides:
_this in class InPortCdrPOA
Returns:
CORBA object referense of this OpenRTM.InPortCdr

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

put

public PortStatus put(byte[] data)
               throws org.omg.CORBA.SystemException
[CORBA interface] Write data into the buffer

Write data into the specified buffer.

Specified by:
put in interface InPortCdrOperations
Parameters:
data - The target data for writing
Throws:
org.omg.CORBA.SystemException

put

public PortStatus put(CdrDataHolder data)
               throws org.omg.CORBA.SystemException
[CORBA interface] Write data into the buffer

Write data into the specified buffer.

Parameters:
data - The target data for writing
Returns:
Prot status
Throws:
org.omg.CORBA.SystemException

convertReturn

protected PortStatus convertReturn(ReturnCode status,
                                   com.sun.corba.se.impl.encoding.EncapsOutputStream data)
{p.en Return codes conversion}

Parameters:
status - ReturnCode
Returns:
PortStatus

creator_

public InPortProvider creator_()
Creats InPortCorbaCdrProvider

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

destructor_

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

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

InPortCorbaCdrProviderInit

public static void InPortCorbaCdrProviderInit()
Module initialization

This initialization function registers InPortCorbaCdrConsumer'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 InPortProvider
Parameters:
properties - Holder object 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 InPortProvider
Parameters:
properties - Holder object to receive interface information
Returns:
true: normal return

setListener

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

InPort 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 InPortCorbaCdrProvider provides the following callbacks.

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

setConnector

public void setConnector(InPortConnector connector)
set Connector

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

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

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