org.jibble.pircbot
Class OutputThread
java.lang.Object
|
+--java.lang.Thread
|
+--org.jibble.pircbot.OutputThread
- All Implemented Interfaces:
- Runnable
- public class OutputThread
- extends Thread
A Thread which is responsible for sending messages to the IRC server.
Messages are obtained from the outgoing message queue and sent
immediately if possible. If there is a flood of messages, then to
avoid getting kicked from a channel, we put a small delay between
each one.
- Version:
- 1.0.5 (Build time: Sat Apr 26 23:11:37 2003)
- Author:
- Paul James Mutton,
http://www.jibble.org/
Constructor Summary |
protected |
OutputThread(PircBot bot,
Queue outQueue)
Constructs an OutputThread for the underlying PircBot. |
Method Summary |
void |
run()
This method starts the Thread consuming from the outgoing message
Queue and sending lines to the server. |
static void |
sendRawLine(PircBot bot,
BufferedWriter bwriter,
String line)
A static method to write a line to a BufferedOutputStream and then pass
the line to the log method of the supplied PircBot instance. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
OutputThread
protected OutputThread(PircBot bot,
Queue outQueue)
- Constructs an OutputThread for the underlying PircBot. All messages
sent to the IRC server are sent by this OutputThread to avoid hammering
the server. Messages are sent immediately if possible. If there are
multiple messages queued, then there is a delay imposed.
- Parameters:
bot
- The underlying PircBot instance.outQueue
- The Queue from which we will obtain our messages.
sendRawLine
public static void sendRawLine(PircBot bot,
BufferedWriter bwriter,
String line)
- A static method to write a line to a BufferedOutputStream and then pass
the line to the log method of the supplied PircBot instance.
- Parameters:
bot
- The underlying PircBot instance.line
- The line to be written. "\r\n" is appended to the end.
run
public void run()
- This method starts the Thread consuming from the outgoing message
Queue and sending lines to the server.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread