jp.go.aist.rtm.RTC.port.publisher
クラス PublisherNew

java.lang.Object
  上位を拡張 jp.go.aist.rtm.RTC.port.publisher.PublisherBase
      上位を拡張 jp.go.aist.rtm.RTC.port.publisher.PublisherNew
すべての実装されたインタフェース:
java.lang.Runnable, ObjectCreator<PublisherBase>, ObjectDestructor

public class PublisherNew
extends PublisherBase
implements java.lang.Runnable, ObjectCreator<PublisherBase>, ObjectDestructor

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

Publisherの駆動は、データ送出のタイミングになるまでブロックされ、送出タイミングの通知を受けると、 即座にコンシューマの送出処理を呼び出します。


入れ子のクラスの概要
protected static class PublisherNew.Policy
           
 
フィールドの概要
protected  Logbuf rtcout
          
 
コンストラクタの概要
PublisherNew()
          コンストラクタ
 
メソッドの概要
 ReturnCode activate()
           activate
protected  ReturnCode convertReturn(ReturnCode status, org.omg.CORBA.portable.OutputStream data)
           convertReturn
protected  boolean createTask(Properties prop)
           Setting Task
 PublisherBase creator_()
           creator_
 ReturnCode deactivate()
           deactivate
 void destructor_(java.lang.Object obj)
           destructor_
 java.lang.String getName()
           getName
 ReturnCode init(Properties prop)
           init initialization
protected  ReturnCode invokeListener(ReturnCode status, org.omg.CORBA.portable.OutputStream data)
           
 boolean isActive()
           write
protected  void onBufferFull(org.omg.CORBA.portable.OutputStream data)
           
protected  void onBufferRead(org.omg.CORBA.portable.OutputStream data)
           
protected  void onBufferWriteOverwrite(org.omg.CORBA.portable.OutputStream data)
           
protected  void onBufferWriteTimeout(org.omg.CORBA.portable.OutputStream data)
           
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)
           
protected  void onSenderError()
           Connector listener functions
 int open(java.lang.Object[] args)
          当該Publisherの駆動を開始します。
static void PublisherNewInit()
           PublisherNewInit
protected  ReturnCode pushAll()
           pushAll push all policy
protected  ReturnCode pushFifo()
           pushFifo push "fifo" policy
protected  ReturnCode pushNew()
           pushNew push "new" policy
protected  ReturnCode pushSkip()
           pushSkip push "skip" policy
 void release()
          駆動フラグがオフとなり、Publisherの駆動が停止します。
 void run()
          当該Publisherオブジェクトのスレッドコンテキストです。
 ReturnCode setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           setBuffer Setting buffer
 ReturnCode setConsumer(InPortConsumer consumer)
           setConsumer Store InPort consumer
 ReturnCode setListener(ConnectorBase.ConnectorInfo info, ConnectorListeners listeners)
           Setting buffer pointer
protected  void setPushPolicy(Properties prop)
           Setting PushPolicy
 int svc()
          当該Publisherオブジェクトのスレッドコンテキストです。
 void update()
          送出タイミング時に呼び出します。
 ReturnCode write(org.omg.CORBA.portable.OutputStream data)
           
 ReturnCode write(org.omg.CORBA.portable.OutputStream data, int sec, int usec)
          データを書き込む {@.ja Publisher が保持するバッファに対してデータを書き込む。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

rtcout

protected Logbuf rtcout

コンストラクタの詳細

PublisherNew

public PublisherNew()
コンストラクタ

メソッドの詳細

update

public void update()

送出タイミング時に呼び出します。ブロックしている当該Publisherの駆動が開始され、 コンシューマへの送出処理が行われます。


svc

public int svc()

当該Publisherオブジェクトのスレッドコンテキストです。 送出タイミングが通知されるまでブロックします。


pushAll

protected ReturnCode pushAll()

pushAll

push all policy

戻り値:
ReturnCode

pushFifo

protected ReturnCode pushFifo()

pushFifo

push "fifo" policy

戻り値:
ReturnCode

pushSkip

protected ReturnCode pushSkip()

pushSkip

push "skip" policy

戻り値:
ReturnCode

pushNew

protected ReturnCode pushNew()

pushNew

push "new" policy

戻り値:
ReturnCode

open

public int open(java.lang.Object[] args)

当該Publisherの駆動を開始します。

パラメータ:
args - (本Publisherでは使用されません。)

release

public void release()

駆動フラグがオフとなり、Publisherの駆動が停止します。

ただし、すでに駆動スレッドがブロックされている場合には、 最大1回のみコンシューマの送出処理が呼び出されることがあります。

オーバーライド:
クラス PublisherBase 内の release

run

public void run()

当該Publisherオブジェクトのスレッドコンテキストです。 送出タイミングが通知されるまでブロックします。

定義:
インタフェース java.lang.Runnable 内の run

init

public ReturnCode init(Properties prop)

init

initialization

定義:
クラス PublisherBase 内の init
パラメータ:
prop -
戻り値:
ReturnCode

setPushPolicy

protected void setPushPolicy(Properties prop)

Setting PushPolicy

パラメータ:
prop - Properties

createTask

protected boolean createTask(Properties prop)

Setting Task

パラメータ:
prop - Properties
戻り値:
false:Task creation failed

setConsumer

public ReturnCode setConsumer(InPortConsumer consumer)

setConsumer

Store InPort consumer

定義:
クラス PublisherBase 内の setConsumer
パラメータ:
consumer -
戻り値:
ReturnCode

setBuffer

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

setBuffer

Setting buffer

定義:
クラス PublisherBase 内の setBuffer
パラメータ:
buffer -
戻り値:
ReturnCode

setListener

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

Setting buffer pointer

定義:
クラス PublisherBase 内の setListener
戻り値:
ReturnCode

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data,
                        int sec,
                        int usec)
データを書き込む

Publisher が保持するバッファに対してデータを書き込む。コンシュー マ、バッファ、リスナ等が適切に設定されていない等、Publisher オブ ジェクトが正しく初期化されていない場合、この関数を呼び出すとエラー コード PRECONDITION_NOT_MET が返され、バッファへの書き込み等の操 作は一切行われない。 バッファへの書き込みと、InPortへのデータの送信は非同期的に行われ るため、この関数は、InPortへのデータ送信の結果を示す、 CONNECTION_LOST, BUFFER_FULL などのリターンコードを返すことがあ る。この場合、データのバッファへの書き込みは行われない。 バッファへの書き込みに対して、バッファがフル状態、バッファのエ ラー、バッファへの書き込みがタイムアウトした場合、バッファの事前 条件が満たされない場合にはそれぞれ、エラーコード BUFFER_FULL, BUFFER_ERROR, BUFFER_TIMEOUT, PRECONDITION_NOT_MET が返される。 これら以外のエラーの場合、PORT_ERROR が返される。

定義:
クラス PublisherBase 内の write
パラメータ:
data - 書き込むデータ
sec - タイムアウト時間
usec - タイムアウト時間
戻り値:
PORT_OK 正常終了 PRECONDITION_NO_MET consumer, buffer, listener等が適切に設定 されていない等、このオブジェクトの事前条件 を満たさない場合。 CONNECTION_LOST 接続が切断されたことを検知した。 BUFFER_FULL バッファがフル状態である。 BUFFER_ERROR バッファに何らかのエラーが生じた場合。 NOT_SUPPORTED サポートされない操作が行われた。 TIMEOUT タイムアウトした。

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data)
定義:
クラス PublisherBase 内の write

isActive

public boolean isActive()

write

定義:
クラス PublisherBase 内の isActive
戻り値:
boolean

activate

public ReturnCode activate()

activate

定義:
クラス PublisherBase 内の activate
戻り値:
ReturnCode

deactivate

public ReturnCode deactivate()

deactivate

定義:
クラス PublisherBase 内の deactivate
戻り値:
ReturnCode

creator_

public PublisherBase creator_()

creator_

定義:
インタフェース ObjectCreator<PublisherBase> 内の creator_
戻り値:
Object Created instances

destructor_

public void destructor_(java.lang.Object obj)

destructor_

定義:
インタフェース ObjectDestructor 内の destructor_
パラメータ:
obj - The target instances for destruction

PublisherNewInit

public static void PublisherNewInit()

PublisherNewInit


convertReturn

protected ReturnCode convertReturn(ReturnCode status,
                                   org.omg.CORBA.portable.OutputStream data)

convertReturn


invokeListener

protected ReturnCode invokeListener(ReturnCode status,
                                    org.omg.CORBA.portable.OutputStream data)

getName

public java.lang.String getName()

getName

定義:
クラス PublisherBase 内の getName
戻り値:
String

onBufferFull

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

onBufferWriteTimeout

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

onBufferWriteOverwrite

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

onBufferRead

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

onSend

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

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)

onSenderError

protected void onSenderError()

Connector listener functions