public class LinkManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
host |
protected ClientLink |
link
volatile because we want internal methods to get the message
that a link was nulled out.
|
protected boolean |
obeyCommandToExit |
protected int |
port |
Modifier | Constructor and Description |
---|---|
protected |
LinkManager()
Constructor.
|
|
LinkManager(java.lang.String host,
int port)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
finLink()
When a getLink() is called, and the link is reserved for that
caller, finLink() MUST be called to release the link for
others.
|
protected ClientLink |
getLink()
Get the ClientLink however it is appropriate for this
LinkManager.
|
ClientLink |
getLink(boolean waitForLock)
This should be the only method a multi-threaded object uses to
gain use of the thread, i.e., on the client side where a GUI
can start a lot of requests.
|
protected ClientLink |
getLink(LinkListener ll)
Called for a LayerListener that will not write to the Link,
only read from it.
|
boolean |
getObeyCommandToExit() |
void |
resetLink()
Set the link to null.
|
void |
setObeyCommandToExit(boolean value) |
protected java.lang.String host
protected int port
protected boolean obeyCommandToExit
protected volatile ClientLink link
protected LinkManager()
public LinkManager(java.lang.String host, int port)
public void setObeyCommandToExit(boolean value)
public boolean getObeyCommandToExit()
public ClientLink getLink(boolean waitForLock) throws java.io.IOException
waitForLock
- if true, the caller will block in this
method until the link has been locked for the caller. If
false, a null will be returned if the lock on the link
couldn't be set for the caller's use.java.io.IOException
protected ClientLink getLink(LinkListener ll) throws java.io.IOException
java.io.IOException
protected ClientLink getLink() throws java.io.IOException
java.io.IOException
public void finLink() throws java.io.IOException
java.io.IOException
public void resetLink()
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details