|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.UCL.xmiddle.framework.lib.protocols.ProtocolChooser
ProtocolChooser.java ProtocolChooser is responsible to negotiate with other hosts and start protocols, such as linking, reconciliation etc. Created: Fri Jul 20 16:14:29 2001
Field Summary | |
static boolean |
ACTIVE
Denotes an active protocol session (protocol is running) |
protected static AppManager |
appManager
A reference to the ApplicationManager |
protected java.lang.Object[] |
args
The arguments/parameters of this sessions |
protected java.lang.Boolean |
has_sender
|
static boolean |
INACTIVE
Denotes a passive protocol session (protocol is not running) |
protected Listener |
listener
Used to receive information from the remote Host(s) |
protected static LocalHost |
localhost
A reference to the localhost (used to access the linktable) |
protected static Locator |
locator
Describe variable locator here. |
protected static Network |
network
A static reference to the xmiddle networking layer |
protected Protocol |
protocol
Stores the protocol chosen |
protected static ProtocolRegistry |
protocolRegistry
A reference to the protocol registry, from where the protocol chooser can pick protocols |
protected Sender |
sender
Used to send information to the remote Host(s) |
protected java.lang.Object |
sessionID
The unique ID for this session |
protected boolean |
status
The protocol's status (ACTIVE or INACTIVE) |
Constructor Summary | |
ProtocolChooser()
|
Method Summary | |
abstract void |
abort()
Aborts the execution of the protocol (in case for example of a network disconnection). |
Protocol |
getProtocol()
Returns the protocol chosen by the ProtocolChooser |
java.lang.Object |
getSessionID()
Returns the session ID assigned for this session. |
boolean |
getStatus()
Returns the status of the session. |
abstract void |
run()
Starts the protocol chooser. |
static void |
setAppManager(AppManager appmgr)
Gives a static reference to the Application Manager. |
void |
setListener(Listener listener)
Gives a reference to the Listener used to receive information from the remote host(s) involved. |
static void |
setLocalHost(LocalHost loc)
Gives a static reference to the LocalHost. |
static void |
setLocator(Locator loc)
Gives a static reference to the Locator. |
static void |
setNetwork(Network net)
Gives a static reference to the networking layer. |
static void |
setRegistry(ProtocolRegistry reg)
Gives a static reference to the ProtocolRegistry. |
void |
setSender(Sender sender)
Gives a reference to the Sender used to send information to the remote host(s) involved. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Object[] args
protected static LocalHost localhost
protected java.lang.Object sessionID
protected Protocol protocol
protected Sender sender
protected Listener listener
protected static Network network
protected static Locator locator
locator
here.
protected boolean status
protected static AppManager appManager
protected static ProtocolRegistry protocolRegistry
public static boolean ACTIVE
public static boolean INACTIVE
protected java.lang.Boolean has_sender
Constructor Detail |
public ProtocolChooser()
Method Detail |
public abstract void run()
run
in interface java.lang.Runnable
public void setListener(Listener listener)
listener
- a Listener
valuepublic void setSender(Sender sender)
sender
- a Sender
valuepublic Protocol getProtocol()
Protocol
chosen by the
ProtocolChooser, or null if the choice hasn't been made yetpublic java.lang.Object getSessionID()
Object
valuepublic boolean getStatus()
ACTIVE
if the protocol is executing, or
PASSIVE
if the protocol isn't executingpublic static void setNetwork(Network net)
net
- a Network
valuepublic static void setLocator(Locator loc)
loc
- a Locator
valuepublic static void setRegistry(ProtocolRegistry reg)
reg
- a ProtocolRegistry
valuepublic static void setAppManager(AppManager appmgr)
appmgr
- an AppManager
valuepublic static void setLocalHost(LocalHost loc)
loc
- a LocalHost
valuepublic abstract void abort()
Protocol.abort()
and cleans up.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |