edu.UCL.xmiddle.lib.protocols
Class SimpleProtocolChooser

java.lang.Object
  |
  +--edu.UCL.xmiddle.framework.lib.protocols.ProtocolChooser
        |
        +--edu.UCL.xmiddle.lib.protocols.SimpleProtocolChooser
All Implemented Interfaces:
java.lang.Runnable

public class SimpleProtocolChooser
extends ProtocolChooser

SimpleProtocolChooser.java This ProtocolChooser is called "Simple", because it doesn't have the ability to download protocols that it doesn't have registered. It expects all protocols to exist on the local platform Created: Fri Jul 27 12:44:02 2001


Field Summary
 
Fields inherited from class edu.UCL.xmiddle.framework.lib.protocols.ProtocolChooser
ACTIVE, appManager, args, has_sender, INACTIVE, listener, localhost, locator, network, protocol, protocolRegistry, sender, sessionID, status
 
Constructor Summary
SimpleProtocolChooser(java.lang.Object[] args)
          This ProtocolChooser, as launched by the Network is responsible for deriving a unique id (String) for this session, loading the appropriate protocol from the ProtocolRegistry and giving it the appropriate resources (such as the documents it needs etc).
 
Method Summary
 void abort()
          Aborts the execution of the ProtocolChooser and the protocol if it is not running.
 void run()
          Starts the ProtocolChooser thread
 void sync(boolean sessionType)
          Makes sure that the hosts involved are ready to execute the protocol (protocol.execute()).
 
Methods inherited from class edu.UCL.xmiddle.framework.lib.protocols.ProtocolChooser
getProtocol, getSessionID, getStatus, setAppManager, setListener, setLocalHost, setLocator, setNetwork, setRegistry, setSender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleProtocolChooser

public SimpleProtocolChooser(java.lang.Object[] args)
This ProtocolChooser, as launched by the Network is responsible for deriving a unique id (String) for this session, loading the appropriate protocol from the ProtocolRegistry and giving it the appropriate resources (such as the documents it needs etc). It also makes sure that the hosts involved are all ready to start executing the loaded protocol, via synchronisation, as the hosts might have vastly different processing capabilities.

Parameters:
args - structure of args expected: [protocol name (String][remote host (Host (or NULL if no remote host))][args/parameters (Object[])] structure of parameters for link: [appID (String)][path (String)][optional: local appID][optional: local path] structure of parameters for sync: [appID of original host (String)][path of original host (String)][local application ID (Integer)][local path of element (String)]
Method Detail

abort

public void abort()
Aborts the execution of the ProtocolChooser and the protocol if it is not running. It also closes all listeners and senders

Specified by:
abort in class ProtocolChooser

run

public void run()
Starts the ProtocolChooser thread

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class ProtocolChooser

sync

public void sync(boolean sessionType)
Makes sure that the hosts involved are ready to execute the protocol (protocol.execute()).

Parameters:
sessionType - Either ACTIVE or PASSIVE