Class AbstractTcpPacketHandler
- java.lang.Object
-
- net.timewalker.ffmq4.transport.tcp.io.AbstractTcpPacketHandler
-
- All Implemented Interfaces:
ActiveObject
- Direct Known Subclasses:
TcpPacketReceiver,TcpPacketSender
public abstract class AbstractTcpPacketHandler extends Object implements ActiveObject
Base class for threads handling the outgoing/incoming traffic on a TCP socket
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringidprotected longlastActivityprotected PacketTransportListenerlistener
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractTcpPacketHandler(String id, PacketTransportListener listener)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()Get the handler idlonggetLastActivity()Get a timestamp of this object's last activity-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.timewalker.ffmq4.utils.watchdog.ActiveObject
getTimeoutDelay, onActivityTimeout
-
-
-
-
Field Detail
-
id
protected String id
-
listener
protected PacketTransportListener listener
-
lastActivity
protected long lastActivity
-
-
Constructor Detail
-
AbstractTcpPacketHandler
protected AbstractTcpPacketHandler(String id, PacketTransportListener listener)
Constructor
-
-
Method Detail
-
getId
public final String getId()
Get the handler id- Returns:
- the handler id
-
getLastActivity
public final long getLastActivity()
Description copied from interface:ActiveObjectGet a timestamp of this object's last activity- Specified by:
getLastActivityin interfaceActiveObject- Returns:
- a java timestamp
-
-