T
- デバイス設定オブジェクトクラスpublic abstract class AbstractDevice<T extends DeviceConfig> extends java.lang.Object implements IDevice<T>
コンストラクタと説明 |
---|
AbstractDevice(java.lang.String id,
T config)
コンストラクタ.
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
addComponent(IComponent<?> component)
コンポーネントを登録します。
|
void |
addListener(IDeviceListener listener)
リスナーを登録します。
|
IComponent<?> |
getComponent(java.lang.String componentId)
保有しているコンポーネントを取得します。
|
T |
getConfig()
設定オブジェクトを取得します。
|
java.lang.String |
getId()
ユニークIDを取得します。
|
java.util.List<IDeviceListener> |
getListeners()
リスナー一覧を取得します。
|
IUecsNode<?> |
getNode()
所属するノードインスタンスを取得します。
|
void |
init(IUecsNode<?> node)
初期化処理を実行します。
|
java.util.List<IComponent<?>> |
listComponents()
コンポーネントリストを取得します。
|
<U extends IComponent<?>> |
listComponents(java.lang.Class<U> cls)
型でフィルタ指定してコンポーネントリストを取得します。
|
protected void |
notifyException(java.lang.Exception e)
リスナーに例外発生を通知します。
|
protected void |
notifyStarted()
リスナーに開始イベントを伝達します。
|
protected void |
notifyStopped()
リスナーに停止イベントを伝達します。
|
protected abstract void |
onInit()
初期化(init)実行時に呼び出されます。
|
protected abstract void |
onStart()
起動時の追加処理を実装するメソッドです。
|
protected abstract void |
onStop()
停止時の追加処理を実装するメソッドです。
|
IComponent<?> |
removeComponent(java.lang.String componentId)
コンポーネントを削除します。
|
boolean |
removeListener(IDeviceListener listener)
リスナーを削除します。
|
void |
start()
デバイス動作を開始します。
|
void |
stop()
デバイス動作を終了させます。
|
public AbstractDevice(java.lang.String id, T config)
config
- 設定値オブジェクトpublic void addListener(IDeviceListener listener)
IDevice
addListener
インタフェース内 IDevice<T extends DeviceConfig>
listener
- リスナーpublic java.util.List<IDeviceListener> getListeners()
IDevice
getListeners
インタフェース内 IDevice<T extends DeviceConfig>
public boolean removeListener(IDeviceListener listener)
IDevice
removeListener
インタフェース内 IDevice<T extends DeviceConfig>
listener
- 削除したいリスナーpublic java.lang.String getId()
IDevice
getId
インタフェース内 IDevice<T extends DeviceConfig>
public IUecsNode<?> getNode()
IDevice
getNode
インタフェース内 IDevice<T extends DeviceConfig>
public T getConfig()
IDevice
getConfig
インタフェース内 IDevice<T extends DeviceConfig>
public IComponent<?> getComponent(java.lang.String componentId)
IDevice
getComponent
インタフェース内 IDevice<T extends DeviceConfig>
componentId
- コンポーネントIDpublic void addComponent(IComponent<?> component)
IDevice
addComponent
インタフェース内 IDevice<T extends DeviceConfig>
component
- コンポーネントインスタンスpublic java.util.List<IComponent<?>> listComponents()
IDevice
listComponents
インタフェース内 IDevice<T extends DeviceConfig>
public <U extends IComponent<?>> java.util.List<U> listComponents(java.lang.Class<U> cls)
IDevice
listComponents
インタフェース内 IDevice<T extends DeviceConfig>
cls
- フィルタする型public IComponent<?> removeComponent(java.lang.String componentId)
IDevice
removeComponent
インタフェース内 IDevice<T extends DeviceConfig>
componentId
- 削除したいコンポーネントのIDpublic void init(IUecsNode<?> node) throws DeviceException
IDevice
init
インタフェース内 IDevice<T extends DeviceConfig>
node
- 所属するノードDeviceException
- 処理に失敗するとスローされます。public void start() throws DeviceException
IDevice
start
インタフェース内 IDevice<T extends DeviceConfig>
DeviceException
public void stop() throws DeviceException
IDevice
stop
インタフェース内 IDevice<T extends DeviceConfig>
DeviceException
- 処理に失敗するとスローされます。protected void notifyStarted()
protected void notifyStopped()
protected void notifyException(java.lang.Exception e)
e
- 発生した例外protected abstract void onInit() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。protected abstract void onStart() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。protected abstract void onStop() throws java.lang.Exception
java.lang.Exception
- 処理に失敗するとスローされます。