com.bbn.openmap.layer.link
Class LinkListener

java.lang.Object
  extended by java.lang.Thread
      extended by com.bbn.openmap.layer.link.LinkListener
All Implemented Interfaces:
LinkPropertiesConstants, java.lang.Runnable

public class LinkListener
extends java.lang.Thread
implements LinkPropertiesConstants

The Link Listener is the object listening from input from the link server, asynchronously. It is launched within its own thread to handle a specific link layer.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  OMGridGenerator currentGenerator
          The generator to use with LinkGrid objects.
protected  LinkLayer layer
          The LinkLayer to use to do the work.
protected  LinkManager linkManager
          The Link to use to talk to the client.
protected  boolean listening
          Used by outsiders to find out if the listener should be started.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.bbn.openmap.layer.link.LinkPropertiesConstants
LPC_BACKWARD_DIAG_PATTERN, LPC_CENTER_LAT, LPC_CENTER_LONG, LPC_CLEAR_PROPERTIES, LPC_CLEAR_PROPERTIES_CHAR, LPC_CROSS_PATTERN, LPC_DASH, LPC_DASH_DOT, LPC_DASH_DOT_DOT, LPC_DIAG_CROSS_PATTERN, LPC_DOT, LPC_FILLCOLOR, LPC_FILLPATTERN, LPC_FORWARD_DIAG_PATTERN, LPC_GRAPHICID, LPC_HEIGHT, LPC_HIGHLIGHTCOLOR, LPC_HORIZONTAL_PATTERN, LPC_HTML, LPC_INFO, LPC_LATMAX, LPC_LATMIN, LPC_LINECOLOR, LPC_LINESTYLE, LPC_LINEWIDTH, LPC_LINKRASTERIMAGEURL, LPC_LINKROTATION, LPC_LINKTEXTBASELINE, LPC_LINKTEXTFONT, LPC_LINKTEXTSTRING, LPC_LONG_DASH, LPC_LONMAX, LPC_LONMIN, LPC_MESSAGE, LPC_OLD_FILLCOLOR, LPC_OLD_FILLPATTERN, LPC_OLD_HIGHLIGHTCOLOR, LPC_OLD_LINECOLOR, LPC_OLD_LINESTYLE, LPC_OLD_LINEWIDTH, LPC_OLD_LINKTEXTFONT, LPC_OLD_LINKTEXTSTRING, LPC_PROJECTION, LPC_PROPERY_MANAGEMENT_POLICY, LPC_PROPERY_MANAGEMENT_POLICY_CHAR, LPC_REUSE_PROPERTIES, LPC_REUSE_PROPERTIES_CHAR, LPC_SCALE, LPC_SOLID, LPC_SOLID_PATTERN, LPC_TIME, LPC_URL, LPC_VERTICAL_PATTERN, LPC_WIDTH
 
Constructor Summary
LinkListener(LinkManager linkManager, LinkLayer layer, OMGridGenerator generator)
          Create child thread that will handle the client.
 
Method Summary
protected  LinkListener getListener()
           
 boolean isListening()
          A method used by outsiders to figure out if the LinkListener is listening to the server.
 void listen()
          listen is a method that listens to the server and responds to requests that are made.
 void run()
          From the Runnable interface.
protected  void setListening(boolean value)
           
 void startUp()
          Use a SwingWorker to launch the listener.
 
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, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

linkManager

protected LinkManager linkManager
The Link to use to talk to the client.


layer

protected LinkLayer layer
The LinkLayer to use to do the work.


currentGenerator

protected OMGridGenerator currentGenerator
The generator to use with LinkGrid objects.


listening

protected boolean listening
Used by outsiders to find out if the listener should be started.

Constructor Detail

LinkListener

public LinkListener(LinkManager linkManager,
                    LinkLayer layer,
                    OMGridGenerator generator)
Create child thread that will handle the client.

Parameters:
linkManager - the LinkManager to communicate over.
layer - the LinkLayer to do the work.
generator - the OMGridGenerator.
Method Detail

isListening

public boolean isListening()
A method used by outsiders to figure out if the LinkListener is listening to the server. If false, start() may need to be called to get the listener listening.


setListening

protected void setListening(boolean value)

getListener

protected LinkListener getListener()

startUp

public void startUp()
Use a SwingWorker to launch the listener. Calls start() on the LinkListener from a new thread.


run

public void run()
From the Runnable interface. The thread starts here...

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

listen

public void listen()
            throws java.io.IOException
listen is a method that listens to the server and responds to requests that are made.

Throws:
java.io.IOException


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details