All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class SE.kth.speech.broker.Broker

SE.kth.speech.broker.Broker

public class Broker
implements ServiceProvider, BrokerObject
A stand alone program implementing a broker which relays messages between clients and servers. The broker is started with
java SE.kth.speech.broker.Broker  
Where port number is the port where the broker will listen for TCP connections.

Use the class BrokerClient to make a client of the Broker.

See Also:
BrokerClient

Method Index

 o brokerCall(BrokerClient, String)
Takes care of the calls that can be made to the Broker itself.
 o brokerCall(BrokerClient, Vector)
 o debugMsg(String)
 o doCommand(BrokerClient, BrokerTokenizer, BrokerTokenizer, Vector)
 o getBrokerClass()
 o getBrokerObjectId()
Return an identifier for this object, which is unique within the BrokerClass.
 o getBrokerObjectId()
 o getHostName()
 o getPort()
 o main(String[])
The stand-alone program starts up a Broker.
 o run()
The thread that waits for new clients and servers to connect.
 o shutdown()

Methods

 o main
 public static void main(String args[]) throws IOException
The stand-alone program starts up a Broker. Takes exactly two arguments which is the port number where the broker will listen for incoming connections, and the Broker's password for access to restricted services.

Parameters:
args[0] - the port number
args[1] - the password
args[2] - 'debug' for debugging mode
 o debugMsg
 public void debugMsg(String msg)
 o getBrokerObjectId
 public String getBrokerObjectId()
 o getBrokerClass
 public BrokerClass getBrokerClass()
 o getHostName
 public String getHostName()
 o getPort
 public int getPort()
 o run
 public void run()
The thread that waits for new clients and servers to connect. When a new connection is established, an new BrokerServerConnection object is created, which in turn starts a thread which handles that connection This method should not be called from outside this class.

See Also:
BrokerServerConnection
 o shutdown
 public void shutdown()
 o brokerCall
 public Object brokerCall(BrokerClient broker,
                          String data) throws BrokerException
Takes care of the calls that can be made to the Broker itself. Implementation of ServiceProvider.

Parameters:
data - the parameters to the call.
Returns:
The result of the call - a String, a Vector of Strings or null
Throws: BrokerException
the call resulted in an error.
See Also:
brokerCall
 o brokerCall
 public Object brokerCall(BrokerClient broker,
                          Vector parameters) throws BrokerException
 o doCommand
 public Object doCommand(BrokerClient broker,
                         BrokerTokenizer identifier,
                         BrokerTokenizer commandTok,
                         Vector hector) throws BrokerException

All Packages  Class Hierarchy  This Package  Previous  Next  Index