public class InPortPushConnector extends InPortConnector
ConnectorBase.ConnectorInfo, ConnectorBase.ConnectorInfoHolderm_buffer, m_directOutPort, m_isLittleEndian, m_orb, m_outPortListeners, m_profile, rtcout| Constructor and Description |
|---|
InPortPushConnector(ConnectorBase.ConnectorInfo profile,
InPortProvider provider,
ConnectorListeners listeners,
BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Connector activation
|
protected ReturnCode |
convertReturn(ReturnCode status,
DataRef<org.omg.CORBA.portable.OutputStream> data)
Converts buffer.ReturnCode into port.ReturnCode.
|
protected BufferBase<org.omg.CORBA.portable.OutputStream> |
createBuffer(ConnectorBase.ConnectorInfo profile)
create buffer
|
void |
deactivate()
Connector deactivation
|
ReturnCode |
disconnect()
disconnect
|
protected void |
onBufferEmpty() |
protected void |
onBufferRead(DataRef<org.omg.CORBA.portable.OutputStream> data) |
protected void |
onBufferReadTimeout() |
protected void |
onConnect()
Invoke callback when connection is established
|
protected void |
onDisconnect()
Invoke callback when connection is destroied
|
<DataType> ReturnCode |
read(DataRef<DataType> data)
Reading data
|
void |
setListener(ConnectorBase.ConnectorInfo profile,
ConnectorListeners listeners)
Set the listener.
|
getBuffer, id, isLittleEndian, name, profile, setEndian, setOutPortpublic InPortPushConnector(ConnectorBase.ConnectorInfo profile, InPortProvider provider, ConnectorListeners listeners, BufferBase<org.omg.CORBA.portable.OutputStream> buffer) throws java.lang.Exception
InPortPushConnector's constructor is given the following arguments. According to ConnectorInfo which includes connection information, a buffer is created. It is also given a pointer to the provider object for the InPort interface. The owner-ship of the pointer is owned by this InPortPushConnector, it has responsibility to destruct the InPortProvider. InPortPushConnector also has ConnectorListeners to provide event callback mechanisms, and they would be called at the proper timing. If data buffer is given by InPortBase, the pointer to the buffer is also given as arguments.
profile -
ConnectorInfoprovider -
InPortProviderlisteners -
ConnectorListeners type lsitener object listbuffer -
CdrBufferBase type bufferjava.lang.Exceptionpublic void setListener(ConnectorBase.ConnectorInfo profile, ConnectorListeners listeners)
InPortConnectorsetListener in class InPortConnectorprofile -
Connector informationlisteners -
Listener objectspublic <DataType> ReturnCode read(DataRef<DataType> data)
This function reads data from the buffer. If data is read properly, this function will return PORT_OK return code. Except normal return, BUFFER_EMPTY, TIMEOUT, PRECONDITION_NOT_MET and PORT_ERROR will be returned as error codes.
read in class InPortConnectorpublic ReturnCode disconnect()
This operation destruct and delete the consumer, the publisher and the buffer.
disconnect in class InPortConnectorpublic void activate()
This operation activates this connector
activate in class ConnectorBasepublic void deactivate()
This operation deactivates this connector
deactivate in class ConnectorBaseprotected BufferBase<org.omg.CORBA.portable.OutputStream> createBuffer(ConnectorBase.ConnectorInfo profile)
This function creates a buffer based on given information.
profile -
Connector informationprotected void onConnect()
protected void onDisconnect()
protected void onBufferRead(DataRef<org.omg.CORBA.portable.OutputStream> data)
protected void onBufferEmpty()
protected void onBufferReadTimeout()
protected ReturnCode convertReturn(ReturnCode status, DataRef<org.omg.CORBA.portable.OutputStream> data)
status -
jp.go.aist.rtm.RTC.buffer.ReturnCode