|
QJCC homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.chitec.quarterback.gjsa.ServerConnector
biz.chitec.quarterback.gjsa.SessionConnector
Session-wise connection class for GJSA clients.
SessionConnector is used by Java programs communicating with GJSA servers. This class offers the query() methods to issue requests and receive replies. The overall design of SessionConnector performs synchronous queries, even though the GJSA protocol would allow asynchronous communication as well.
A SessionConnector is always bound to exactly one session in the connection. If a command results in opening a new session, three strategies are possible:
All strategies are equally in their result. Choose whichever fits best into the existing program scheme. If in doubt, take strategy 3, as it is the semantically clearest.
All querying methods exist in two shapes: One named qxxx() and one named qxxxNE(). The first alternative may throw an IOException in case of a communication failure. The second, however will not throw an exception but return a reply of the type SERIOUSERROR. Additionally to the ConnectionDesasterListener concept, this offers up to three ways to cope with connection problems.
| Field Summary | |
private java.util.List |
children
|
private SessionConnector |
father
|
private ServerEnvelope |
initialenvelope
|
private SessionedServerConnector |
llsc
|
private SessionConnector |
newsessionsc
|
private int |
sessionid
|
protected SyncBurstReceiver |
syncburstreceiver
|
protected java.lang.Thread |
syncburstreceiverthread
|
private boolean |
throttling
|
| Constructor Summary | |
SessionConnector(SessionedServerConnector llscx,
int sidx)
|
|
SessionConnector(SessionedServerConnector llscx,
ServerEnvelope iex)
|
|
| Method Summary | |
void |
addConnectionDesasterListener(ConnectionDesasterListener cdl)
Add listener for connection desasterts |
void |
addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
Adds a presentor for the encryption state |
void |
addConnectionStatePresentor(ConnectionStatePresentor ccsp)
Adds a connection state presentor. |
void |
attachSyncBurstReceiver(SyncBurstReceiver sbr)
Attaches and starts a SyncBurstReceiver to this SessionConnector. |
void |
close()
Close myself, leads to children being closed anyway |
private void |
close(boolean proactive)
Close myself, unregister myself from father and server if parameter is set to true |
void |
connDesaster()
Raises a connection desaster |
void |
connectionOnHold(ServerEnvelope reest)
Closes the connection to the server transparently for higher layers. |
void |
disableErrorMsgs()
Deprecated. Feature is not supported any more |
int |
getEncodingMode()
Return encoding of the connection |
ServerEnvelope |
getInitialEnvelope()
|
SessionConnector |
getNewSessionConnector()
Returns branched SessionConnector if last query has branched, null if not. |
SessionedServerConnector |
getSessionedServerConnector()
Returns the SessionedServerConnector for this SessionConnector |
int |
getSessionID()
|
boolean |
isBackgroundSession()
Return whether the connector is throttling. |
boolean |
isEncrypting()
Gets the encrypting attribute of the ServerConnector object |
ServerEnvelope |
query(ServerEnvelope se)
Query for standard requests. |
java.lang.Object |
queryOrBranch(ServerEnvelope se)
Basic method for querying. |
java.lang.Object |
queryOrBranchNE(ServerEnvelope se)
Query for standard requests or new sessions without any exceptions. |
void |
quit()
Quit connection. |
void |
removeConnectionDesasterListener(ConnectionDesasterListener cdl)
Remove listener for connection desasters |
void |
removeConnectionStatePresentor()
Removes the presentor for the connection state |
void |
setBackgroundSession(boolean t)
Set the connector to "throttling" mode => if someone else is sending, wait for that one to finish. |
private void |
setFather(SessionConnector fatherx)
|
void |
setFreeFloatingInterface(ThreadInterface ti)
Set the interface where free floating messages are sent to. |
void |
setMessageLogger(Logger mx)
Sets the messageLogger attribute of the ServerConnector object |
void |
setReaderPriority(int newprio)
Set priority of the reader thread. |
void |
startLineWakeupToggler()
Deprecated. Use SessionedServerConnector.setSendKeepAlive() instead |
void |
stopSyncBurstReceiver()
Stops a currently running SyncBurstReceiver. |
private void |
unregisterChild(SessionConnector child)
Unregister a child. |
| Methods inherited from class biz.chitec.quarterback.gjsa.ServerConnector |
openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, openLegacyServerConnector, query, query, query, query, query, query, query, query, query, query, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE, queryNE |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int sessionid
private SessionedServerConnector llsc
private ServerEnvelope initialenvelope
private SessionConnector newsessionsc
private SessionConnector father
private java.util.List children
private boolean throttling
protected java.lang.Thread syncburstreceiverthread
protected SyncBurstReceiver syncburstreceiver
| Constructor Detail |
public SessionConnector(SessionedServerConnector llscx,
int sidx)
public SessionConnector(SessionedServerConnector llscx,
ServerEnvelope iex)
| Method Detail |
public int getSessionID()
private void setFather(SessionConnector fatherx)
public ServerEnvelope getInitialEnvelope()
public void setBackgroundSession(boolean t)
ServerConnector
setBackgroundSession in class ServerConnectorpublic boolean isBackgroundSession()
ServerConnector
isBackgroundSession in class ServerConnector
public java.lang.Object queryOrBranch(ServerEnvelope se)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Object queryOrBranchNE(ServerEnvelope se)
public ServerEnvelope query(ServerEnvelope se)
throws java.io.IOException
query in class ServerConnectorse - ServerEnvelope with one or more queries set
java.io.IOException - If something goes wrong in the communication between client and serverServerEnvelopepublic SessionConnector getNewSessionConnector()
public SessionedServerConnector getSessionedServerConnector()
private void unregisterChild(SessionConnector child)
public void close()
close in class ServerConnectorprivate void close(boolean proactive)
public void quit()
public void attachSyncBurstReceiver(SyncBurstReceiver sbr)
attachSyncBurstReceiver in class ServerConnectorsbr - Description of the Parameterpublic void stopSyncBurstReceiver()
stopSyncBurstReceiver in class ServerConnectorpublic boolean isEncrypting()
ServerConnector
isEncrypting in class ServerConnector
public void connectionOnHold(ServerEnvelope reest)
throws java.io.IOException
ServerConnectorThe next query sent to the ServerConnector will reestablish the connection. After opening the ports, the complete reest ServerEnvelope will be sent to the server to reach the state it had on closing.
connectionOnHold in class ServerConnectorreest - Description of the Parameter
java.io.IOException - Description of the Exceptionpublic void setMessageLogger(Logger mx)
ServerConnector
setMessageLogger in class ServerConnectormx - The new messageLogger valuepublic void disableErrorMsgs()
disableErrorMsgs in class ServerConnectorpublic void startLineWakeupToggler()
startLineWakeupToggler in class ServerConnectorpublic void connDesaster()
ServerConnector
connDesaster in class ServerConnectorpublic void addConnectionStatePresentor(ConnectionStatePresentor ccsp)
ServerConnector
addConnectionStatePresentor in class ServerConnectorpublic void addConnectionEncryptionPresentor(ConnectionEncryptionPresentor ccep)
ServerConnector
addConnectionEncryptionPresentor in class ServerConnectorpublic void removeConnectionStatePresentor()
ServerConnector
removeConnectionStatePresentor in class ServerConnectorpublic int getEncodingMode()
ServerConnector
getEncodingMode in class ServerConnectorpublic void addConnectionDesasterListener(ConnectionDesasterListener cdl)
ServerConnector
addConnectionDesasterListener in class ServerConnectorpublic void removeConnectionDesasterListener(ConnectionDesasterListener cdl)
ServerConnector
removeConnectionDesasterListener in class ServerConnectorpublic void setFreeFloatingInterface(ThreadInterface ti)
ServerConnector
setFreeFloatingInterface in class ServerConnectorpublic void setReaderPriority(int newprio)
ServerConnector
setReaderPriority in class ServerConnector
|
QJCC homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||