org.kaariboga.io
Class SendMessageThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--org.kaariboga.io.SendMessageThread
All Implemented Interfaces:
java.lang.Runnable

class SendMessageThread
extends java.lang.Thread

Sends a KaaribogaMessage to another base.


Field Summary
(package private)  KaaribogaMessage message
          message to send
private  KbMessageHandler messageHandler
          Message handler for errors in case the sending fails.
private  java.util.Collection sendingThreads
          Threads, that are currently sending messages.
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ
 
Constructor Summary
SendMessageThread(KaaribogaMessage msg, KbMessageHandler handler, java.util.Collection senders)
          Creates a thread that sends a message to another host.
 
Method Summary
 void run()
          Send the message through a socket connection.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

message

KaaribogaMessage message
message to send

sendingThreads

private java.util.Collection sendingThreads
Threads, that are currently sending messages. This class adds and removes itself to the collection, because it knows best when to do it.

messageHandler

private KbMessageHandler messageHandler
Message handler for errors in case the sending fails.
Constructor Detail

SendMessageThread

public SendMessageThread(KaaribogaMessage msg,
                         KbMessageHandler handler,
                         java.util.Collection senders)
Creates a thread that sends a message to another host. The message must contain the receiver's address!
Parameters:
msg - The message to send.
handler - A KbMessageHandler to handle error messages
senders - Collection of currently sending threads
Method Detail

run

public void run()
Send the message through a socket connection.
Overrides:
run in class java.lang.Thread