Package edu.jas.util
Class DHTBroadcaster<K>
java.lang.Object
java.lang.Thread
edu.jas.util.DHTBroadcaster<K>
- All Implemented Interfaces:
Runnable
Thread for broadcasting all incoming objects to the list clients.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<DHTBroadcaster<K>> private final SocketChannel
private static final boolean
(package private) boolean
private static final org.apache.logging.log4j.Logger
private final SortedMap
<K, DHTTransport> Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionDHTBroadcaster
(SocketChannel s, List<DHTBroadcaster<K>> bc, SortedMap<K, DHTTransport> sm) DHTBroadcaster. -
Method Summary
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger logger -
debug
private static final boolean debug -
channel
-
bcaster
-
theList
-
goon
volatile boolean goon
-
-
Constructor Details
-
DHTBroadcaster
DHTBroadcaster.- Parameters:
s
- SocketChannel to use.bc
- list of broadcasters.sm
- SortedMap with key value pairs.
-
-
Method Details
-
closeChannel
public void closeChannel()closeChannel. -
sendChannel
sendChannel.- Parameters:
tc
- DHTTransport.- Throws:
IOException
-
broadcast
broadcast.- Parameters:
o
- DHTTransport element to broadcast.
-
run
public void run()run. -
toString
toString.
-