@ThreadSafe public abstract class AisBusComponent extends Object
| Modifier and Type | Field and Description |
|---|---|
protected PacketFilterCollection |
filters
Filters to apply to received packets
|
protected CopyOnWriteArrayList<IAisPacketTransformer> |
packetTransformers
Transformers to apply
|
protected AisBusComponentStatus |
status
The status of the component
|
static long |
THREAD_STOP_WAIT_MAX
Maximum time to wait for threads to stop after having been cancelled
|
| Constructor and Description |
|---|
AisBusComponent()
Instantiates a new Ais bus component.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cancel()
All components must implement a way to stop
|
PacketFilterCollection |
getFilters()
Get filters collection
|
CopyOnWriteArrayList<IAisPacketTransformer> |
getPacketTransformers()
Get packet transformers list
|
AisBusComponentStatus |
getStatus()
Get component status
|
Thread |
getThread()
Get component thread
|
protected AisPacket |
handleReceived(AisPacket packet)
Method to handle incoming packet for all AisBus components.
|
void |
init()
Initialize the component after configuration.
|
String |
rateReport()
Rate report string.
|
void |
setConnected()
Sets connected.
|
void |
setNotConnected()
Sets not connected.
|
void |
setStopped()
Sets stopped.
|
protected void |
setThread(Thread thread)
Set component thread
|
void |
start()
Start the component.
|
String |
toString() |
public static final long THREAD_STOP_WAIT_MAX
protected final AisBusComponentStatus status
protected final PacketFilterCollection filters
protected final CopyOnWriteArrayList<IAisPacketTransformer> packetTransformers
public void init()
public void start()
public void setConnected()
public void setNotConnected()
public void setStopped()
public AisBusComponentStatus getStatus()
protected void setThread(Thread thread)
thread - the threadpublic Thread getThread()
public abstract void cancel()
protected AisPacket handleReceived(AisPacket packet)
packet - the packetpublic PacketFilterCollection getFilters()
public CopyOnWriteArrayList<IAisPacketTransformer> getPacketTransformers()
public String rateReport()
Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.