com.aispeech.dui

## 类 BaseNode

- java.lang.Object
- - com.aispeech.dui.BaseNode

- 所有已实现的接口:
    BusClient.Handler, java.lang.Runnable
  直接已知子类:
    Agent

      public abstract class BaseNode
      extends java.lang.Object
      implements java.lang.Runnable, BusClient.Handler

  node life cycle

           onCreate()
              |
           onJoin() -- try join again -----<--
              |                                |
             bus client main loop              |
              |                                |
           onExit() -- exit on exception -->--
              |
           onDestroy()

- - ### 字段概要

    字段
    限定符和类型 | 字段和说明
    --- | ---
    `protected BusClient` | `bc`
    `static java.lang.String` | `DEFAULT_BUS_SERVER`

  - ### 构造器概要

    构造器
    构造器和说明
    `BaseNode()`

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `dump(java.io.PrintWriter pw)`
    `void` | `dump(java.io.PrintWriter pw, java.lang.String args)`
    `java.lang.String` | `getAddress()`
    `int` | `getBufferSize()` invoked when this node need larger buffer for communication
    `BusClient` | `getBusClient()`
    `abstract java.lang.String` | `getName()`
    `boolean` | `isRunning()`
    `void` | `onCreate()` invoked when this node is created
    `void` | `onDestroy()` invoked when this node is being destroyed
    `void` | `onExit()` invoked when this node exit from bus
    `void` | `onJoin()` invoked when this node join bus
    `void` | `onMessage(java.lang.String topic, byte[]... parts)` invoked when topic received.
    `void` | `publishSticky(java.lang.String topic, java.lang.String... parts)` The topic will always be delivered to subscribers 1. no matter aios has ready or not. 2. no matter subscriber invokes bc.subscribe earlier or later.
    `void` | `removeSticky(java.lang.String topic)` The topic will be not sticky anymore Remove the recent sticky topic kept in memory
    `void` | `run()`
    `boolean` | `start()`
    `boolean` | `stop()`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### 从接口继承的方法 com.aispeech.dui.BusClient.Handler

      `onCall`

- - ### 字段详细资料

    - #### bc

          protected BusClient bc

    - #### DEFAULT_BUS_SERVER

          public static java.lang.String DEFAULT_BUS_SERVER

  - ### 构造器详细资料

    - #### BaseNode

          public BaseNode()

  - ### 方法详细资料

    - #### getName

          public abstract java.lang.String getName()

    - #### onCreate

          public void onCreate()

      invoked when this node is created

    - #### onJoin

          public void onJoin()

      invoked when this node join bus

    - #### onExit

          public void onExit()

      invoked when this node exit from bus

    - #### onDestroy

          public void onDestroy()

      invoked when this node is being destroyed

    - #### getAddress

          public java.lang.String getAddress()

    - #### onMessage

          public void onMessage(java.lang.String topic,
                                byte[]... parts)
                         throws java.lang.Exception

      invoked when topic received.

      only handle bus.event in BaseNode

      指定者:
        `onMessage` 在接口中 `BusClient.Handler`
      参数:
        `topic` -
        `parts` -
      抛出:
        `java.lang.Exception`

    - #### dump

          public void dump(java.io.PrintWriter pw,
                           java.lang.String args)

    - #### dump

          public void dump(java.io.PrintWriter pw)

    - #### getBufferSize

          public int getBufferSize()

      invoked when this node need larger buffer for communication
      返回:
        the size of socket receiver & sender buffer, Bytes

    - #### getBusClient

          public final BusClient getBusClient()

    - #### run

          public void run()

      指定者:
        `run` 在接口中 `java.lang.Runnable`

    - #### isRunning

          public final boolean isRunning()

    - #### start

          public final boolean start()

    - #### stop

          public final boolean stop()

    - #### publishSticky

          public void publishSticky(java.lang.String topic,
                                    java.lang.String... parts)

      The topic will always be delivered to subscribers 1. no matter aios has ready or not. 2. no matter subscriber invokes bc.subscribe earlier or later. The most recent sticky topic is kept in memory for future access by subscribers
      参数:
        `topic` - sticky topic to publish
        `parts` - content

    - #### removeSticky

          public void removeSticky(java.lang.String topic)

      The topic will be not sticky anymore Remove the recent sticky topic kept in memory
      参数:
        `topic` - sticky topic to remove