All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class SE.kth.speech.broker.Connection

SE.kth.speech.broker.Connection

public abstract class Connection
The base class for both client-side and server-side classes for Broker connections.

See Also:
BrokerClient, BrokerServerConnection

Constructor Index

 o Connection()

Method Index

 o broken()
true if the connection is broken.
 o callProc(String, String)
Send a CALL PROC message.
 o close()
Close the connection, cleanly if possible The connection can not be used after this call.
 o getName()
The name of the client.
 o getNameNonBlocking()
 o send(String)
Send a string through the connection.
 o setDebug(boolean)
 o setName(String)
Set the name of the connection.
 o toString()

Constructors

 o Connection
 public Connection()

Methods

 o setDebug
 public void setDebug(boolean newDebug)
 o getName
 public String getName()
The name of the client. For clients, this name is assigned at connect-time. Will block until a name is set.

Returns:
The name of the client
 o getNameNonBlocking
 public String getNameNonBlocking()
 o toString
 public String toString()
 o setName
 public void setName(String newName)
Set the name of the connection. This should Only be called by Broker classes. It can only be called once - the name of a connection can not be changed.

Parameters:
newName - the name of the connection.
 o send
 public void send(String s) throws ServerDownException
Send a string through the connection. This method synchronizes on the writer attribute. To do several sends in a row with nothing coming in between, synchronize on writer, and then call send() several times.

Parameters:
s - The string to send.
Throws: ServerDownException
The other end of the connection has closed.
See Also:
writer
 o callProc
 public void callProc(String server,
                      String data) throws ServerDownException
Send a CALL PROC message.

Parameters:
server - The server the CALL PROC is destined for.
data - The parameters to the call
Throws: ServerDownException
The connection is down.
 o broken
 public boolean broken()
true if the connection is broken.

Returns:
true if the connection is broken, false otherwise.
 o close
 public void close()
Close the connection, cleanly if possible The connection can not be used after this call.


All Packages  Class Hierarchy  This Package  Previous  Next  Index