org.limitless.nmc.Client
Class CommandSender

java.lang.Object
  extended by org.limitless.nmc.Client.CommandSender

public class CommandSender
extends java.lang.Object

A CommandSender object listens to a source, issues a single command, and then discards everything back until either a close of connection or the result of the command that was sent, which it returns to its caller. The object serializes on the command sending, but not on the command processing--so there can be at most one active sender, even though dozens of messages will flow through.


Nested Class Summary
private  class CommandSender.Listener
          This class sifts through messages looking for a response to a sent message.
 
Field Summary
private  CommandSender.Listener listener
           
(package private) static org.apache.log4j.Logger logger
          Log4J Logger
private  MessageEvent.Source source
           
 
Constructor Summary
CommandSender(MessageEvent.Source source)
          CommandSender requires the source to monitor and send to
 
Method Summary
static void main(java.lang.String[] args)
           
 java.util.List send(java.lang.String command)
          This delivers a command and returns the response.
 void shutdown()
          When you shutdown this object, it severs its connection to the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Log4J Logger


listener

private CommandSender.Listener listener

source

private MessageEvent.Source source
Constructor Detail

CommandSender

public CommandSender(MessageEvent.Source source)
CommandSender requires the source to monitor and send to

Method Detail

shutdown

public void shutdown()
When you shutdown this object, it severs its connection to the source. It does NOT shutdown the source object thus causing a dis-connect from the MUCK of the bot.


send

public java.util.List send(java.lang.String command)
                    throws java.lang.IllegalStateException,
                           SourceUnavailableException
This delivers a command and returns the response. It blocks until it's command is processed. It is legal for many threads to share a command sender and call this method.

Throws:
java.lang.IllegalStateException
SourceUnavailableException

main

public static void main(java.lang.String[] args)


Copyright © 1995, 2004 Limitless Knowledge Association, All Rights Reserved.