Package com.iizix.server.vsviewer
Class VSViewerTransactionProcessor
- java.lang.Object
- com.iizix.server.vsviewer.VSViewerTransactionProcessor
- All Implemented Interfaces:
ITransactionCreator,ITransactionProcessor,IRootPropTransactionSender
public class VSViewerTransactionProcessor extends java.lang.Object implements ITransactionProcessor, IRootPropTransactionSender
The TransactionProcessor contains all the code required to process transactions with the application being run for a single client reconnectable connection. If parallel client sessions is enabled or allowed, a single AppSessionGyro is shared.- Author:
- Christopher Mindus
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseClient(java.lang.String msg)Sends an HTML message to be displayed on the client that will immediately close the connection.SendTransactioncreateTransaction()Creates a transaction with the configured write cache.java.lang.StringgetClientContextMenuReference(UIContextMenu contextMenu)Gets the reference to use for a context menu.VSViewerParamsgetVSViewerParams()Gets the VS Viewer parameters.booleanisConnected()Verifies that the connection is established and not paused, reconnecting, etc.voidonConnection(SessionTransMgr manager)Called when a connection is established.voidonDisposed(SessionTransMgr manager)Called when a connection is disposed of.voidonPause(SessionTransMgr manager)Called when a connection is paused.voidonReconnected(SessionTransMgr manager)Called when a connection is reconnected.voidprocessTransaction(SessionTransMgr manager, ReadTransaction trans)Process incoming transaction that itself can consist of several sub-transactions.voidsendTransaction(SendTransaction trans)Sends the transaction to the remote party.voidshowMessageInClient(int severity, java.lang.String heading, java.lang.String msg)Sends an error message to be displayed on the client immediately.
Method Detail
getVSViewerParams
public VSViewerParams getVSViewerParams()
Gets the VS Viewer parameters.
onConnection
public void onConnection(SessionTransMgr manager)
Called when a connection is established.- Specified by:
onConnectionin interfaceITransactionProcessor
onPause
public void onPause(SessionTransMgr manager)
Called when a connection is paused.- Specified by:
onPausein interfaceITransactionProcessor
onReconnected
public void onReconnected(SessionTransMgr manager)
Called when a connection is reconnected.- Specified by:
onReconnectedin interfaceITransactionProcessor
onDisposed
public void onDisposed(SessionTransMgr manager)
Called when a connection is disposed of.- Specified by:
onDisposedin interfaceITransactionProcessor
processTransaction
public void processTransaction(SessionTransMgr manager, ReadTransaction trans)
Process incoming transaction that itself can consist of several sub-transactions.Management transaction are not present here, but GConstants.TRANS_NEXT_SERIAL that should call
manager.onNextSerialTransaction();.- Specified by:
processTransactionin interfaceITransactionProcessor- Parameters:
trans- The transaction to process.
createTransaction
public SendTransaction createTransaction()
Creates a transaction with the configured write cache.- Specified by:
createTransactionin interfaceITransactionCreator- Returns:
- The new
Transactioninstance.
sendTransaction
public void sendTransaction(SendTransaction trans)
Sends the transaction to the remote party.- Specified by:
sendTransactionin interfaceIRootPropTransactionSender- Parameters:
trans- The transaction.
isConnected
public boolean isConnected()
Verifies that the connection is established and not paused, reconnecting, etc.- Specified by:
isConnectedin interfaceIRootPropTransactionSender- Returns:
- true if connected, false otherwise.
showMessageInClient
public void showMessageInClient(int severity, java.lang.String heading, java.lang.String msg)Sends an error message to be displayed on the client immediately.- Parameters:
severity- The message severity (-1 none, 0=info, 1=warning, 2=error).heading- The heading text.msg- The message text.
closeClient
public void closeClient(java.lang.String msg)
Sends an HTML message to be displayed on the client that will immediately close the connection.- Parameters:
msg- The message text in HTML.
getClientContextMenuReference
public java.lang.String getClientContextMenuReference(UIContextMenu contextMenu)
Gets the reference to use for a context menu.- Specified by:
getClientContextMenuReferencein interfaceIRootPropTransactionSender- Parameters:
contextMenu- The context menu.- Returns:
- The reference to use, empty string for none (never null).