Luky Library - 4.1.1 (20061117-1148)

luky.serverSimple
Class ClientExtended

java.lang.Object
  extended by luky.serverSimple.Client
      extended by luky.serverSimple.ClientExtended
All Implemented Interfaces:
Runnable, EventListener, MyEventListener

public class ClientExtended
extends Client
implements Runnable, MyEventListener

The ClientExtended class extends the Client class and is created to make a general listner for servers which communicates with MyEventListners Revision Changes :

Version:
1.02
Author:
Chris Lukassen
 

Field Summary
protected static int IDLE
           
protected  EventListenerList listenerList
           
protected  String name
           
protected static int RECONNECTING
           
protected static int RUNNING
           
protected static int STARTING
           
protected  int status
           
protected static int STOPPING
           
 
Fields inherited from class luky.serverSimple.Client
connected, reader, writer
 
Constructor Summary
ClientExtended(String ip, String port, int interval)
          constructor, takes ip number and portnumber of the server to connect to and the watchdog interval < 0 means disable
 
Method Summary
 void addMyEventListener(MyEventListener listener)
          This methods allows classes to register for MyEvents
protected  void fireMyEvent(MyEvent evt)
          This method is used to fire MyEvents
 int handleCommError()
          comm error occured re-initialize and report to listners
 void myEventOccurred(MyEvent evt)
          This method gets called by the Watchdog
 void removeMyEventListener(MyEventListener listener)
          This methods allows classes to unregister for MyEvents
 void run()
          main loop of the client, override with more sensible actions
currently listens to input and fires each line as an event
 void start()
          This method starts the client in a seperate thread
 void stop()
          This method stops the client
 
Methods inherited from class luky.serverSimple.Client
getLine, getList, openConnection, sendCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

listenerList

protected EventListenerList listenerList

IDLE

protected static final int IDLE
See Also:
Constant Field Values

STARTING

protected static final int STARTING
See Also:
Constant Field Values

RUNNING

protected static final int RUNNING
See Also:
Constant Field Values

RECONNECTING

protected static final int RECONNECTING
See Also:
Constant Field Values

STOPPING

protected static final int STOPPING
See Also:
Constant Field Values

status

protected int status
Constructor Detail

ClientExtended

public ClientExtended(String ip,
                      String port,
                      int interval)
constructor, takes ip number and portnumber of the server to connect to and the watchdog interval < 0 means disable

Method Detail

addMyEventListener

public void addMyEventListener(MyEventListener listener)
This methods allows classes to register for MyEvents


removeMyEventListener

public void removeMyEventListener(MyEventListener listener)
This methods allows classes to unregister for MyEvents


fireMyEvent

protected void fireMyEvent(MyEvent evt)
This method is used to fire MyEvents


myEventOccurred

public void myEventOccurred(MyEvent evt)
This method gets called by the Watchdog

Specified by:
myEventOccurred in interface MyEventListener

start

public void start()
This method starts the client in a seperate thread


stop

public void stop()
This method stops the client


handleCommError

public int handleCommError()
comm error occured re-initialize and report to listners


run

public void run()
main loop of the client, override with more sensible actions
currently listens to input and fires each line as an event

Specified by:
run in interface Runnable

Luky Library - 4.1.1 (20061117-1148)