jp.go.aist.rtm.RTC.port.publisher
Class PublisherFlush

java.lang.Object
  extended by jp.go.aist.rtm.RTC.port.publisher.PublisherBase
      extended by jp.go.aist.rtm.RTC.port.publisher.PublisherFlush
All Implemented Interfaces:
ObjectCreator<PublisherBase>, ObjectDestructor

public class PublisherFlush
extends PublisherBase
implements ObjectCreator<PublisherBase>, ObjectDestructor

データ送出を待つコンシューマを、送出する側と同じスレッドで動作させる場合に使用します。


Field Summary
protected  Logbuf rtcout
           
 
Constructor Summary
PublisherFlush()
           Constructor
 
Method Summary
 ReturnCode activate()
           activate
 PublisherBase creator_()
           creator_
 ReturnCode deactivate()
           deactivate
 void destruct()
          当該Publisherが不要となり破棄される際に、PublisherFactoryにより呼び出されます。
 void destructor_(java.lang.Object obj)
           destructor_
protected  void finalize()
          ファイナライザです。
 java.lang.String getName()
           getName
 ReturnCode init(Properties prop)
           init
 boolean isActive()
           write
protected  void onReceived(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverError(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverFull(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverTimeout(org.omg.CORBA.portable.OutputStream data)
           
protected  void onSend(org.omg.CORBA.portable.OutputStream data)
           Connector data listener functions
static void PublisherFlushInit()
           PublisherFlushInit
 ReturnCode setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           setBuffer
 ReturnCode setConsumer(InPortConsumer consumer)
           setConsumer
 ReturnCode setListener(ConnectorBase.ConnectorInfo info, ConnectorListeners listeners)
           Setting buffer pointer
 ReturnCode write(org.omg.CORBA.portable.OutputStream data)
           
 ReturnCode write(org.omg.CORBA.portable.OutputStream data, int sec, int usec)
           Write data
 
Methods inherited from class jp.go.aist.rtm.RTC.port.publisher.PublisherBase
release
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rtcout

protected Logbuf rtcout
Constructor Detail

PublisherFlush

public PublisherFlush()
Constructor

Method Detail

destruct

public void destruct()

当該Publisherが不要となり破棄される際に、PublisherFactoryにより呼び出されます。


finalize

protected void finalize()
                 throws java.lang.Throwable

ファイナライザです。

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

init

public ReturnCode init(Properties prop)

init

initialization

Specified by:
init in class PublisherBase
Parameters:
prop -
Returns:
ReturnCode

setConsumer

public ReturnCode setConsumer(InPortConsumer consumer)

setConsumer

Store InPort consumer

Specified by:
setConsumer in class PublisherBase
Parameters:
consumer -
Returns:
ReturnCode

setBuffer

public ReturnCode setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)

setBuffer

Setting buffer

Specified by:
setBuffer in class PublisherBase
Parameters:
buffer -
Returns:
ReturnCode

setListener

public ReturnCode setListener(ConnectorBase.ConnectorInfo info,
                              ConnectorListeners listeners)

Setting buffer pointer

Specified by:
setListener in class PublisherBase
Returns:
ReturnCode

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data,
                        int sec,
                        int usec)
Write data

This function writes data into the consumer associated with this Publisher. If this function is called without initializing correctly such as a consumer, listeners, etc., error code PRECONDITION_NOT_MET will be returned and no operation of the writing to the consumer etc. will be performed. When publisher writes data to the buffer, if the consumer returns full-status, returns error, is returned with timeout, error codes BUFFER_FULL, BUFFER_ERROR and BUFFER_TIMEOUT will be returned respectively. In other cases, PROT_ERROR will be returned.

Specified by:
write in class PublisherBase
Parameters:
data - Data to be wrote to the buffer
sec - Timeout time in unit seconds
usec - Timeout time in unit micro-seconds
Returns:
PORT_OK Normal return PRECONDITION_NO_MET Precondition does not met. A consumer, a buffer, listenes are not set properly. SEND_FULL Data was sent but full-status returned SEND_TIMEOUT Data was sent but timeout occurred CONNECTION_LOST detected that the connection has been lost

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data)
Specified by:
write in class PublisherBase

isActive

public boolean isActive()

write

Specified by:
isActive in class PublisherBase
Returns:
boolean

activate

public ReturnCode activate()

activate

Specified by:
activate in class PublisherBase
Returns:
ReturnCode

deactivate

public ReturnCode deactivate()

deactivate

Specified by:
deactivate in class PublisherBase
Returns:
ReturnCode

creator_

public PublisherBase creator_()

creator_

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

destructor_

public void destructor_(java.lang.Object obj)

destructor_

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

PublisherFlushInit

public static void PublisherFlushInit()

PublisherFlushInit


getName

public java.lang.String getName()

getName

Specified by:
getName in class PublisherBase
Returns:
String

onSend

protected void onSend(org.omg.CORBA.portable.OutputStream data)

Connector data listener functions


onReceived

protected void onReceived(org.omg.CORBA.portable.OutputStream data)

onReceiverFull

protected void onReceiverFull(org.omg.CORBA.portable.OutputStream data)

onReceiverTimeout

protected void onReceiverTimeout(org.omg.CORBA.portable.OutputStream data)

onReceiverError

protected void onReceiverError(org.omg.CORBA.portable.OutputStream data)