C# Class gov.va.medora.mdo.dao.QueryThreadPool

Exibir arquivo Open project: OSEHRA/mdo

Public Methods

Method Description
QueryThreadPool ( int connectionPoolSize, int cxnRefreshTime, AbstractAccount account, AbstractCredentials creds, SiteTable siteTable, IList cxnSites ) : System
queue ( QueryThread qt, string siteId ) : void
reallocateConnection ( gov.va.medora.mdo.dao.AbstractConnection cxn ) : void
shutdown ( ) : void

Private Methods

Method Description
QueryThreadChanged ( object sender, EventArgs e ) : void
QueueChanged ( object sender, EventArgs e ) : void
addConnection ( string sitecode, gov.va.medora.mdo.dao.AbstractConnection cxn ) : void
connectSite ( object site ) : void
connectWithReturn ( Site site, bool addToCxnCollection ) : gov.va.medora.mdo.dao.AbstractConnection

This function is the heart of the connection pool dictionary. It connects to a site and attaches the event handlers by executing a standard gettimestamp request so the connection can immediately begin processing queued query threads

getAvailableConnection ( string siteId ) : gov.va.medora.mdo.dao.AbstractConnection

This function should locate a connection marked as available, verify the connection is still active (using a simple getTimestamp query), re-allocate any encountered failed connections out of process, and return the first connection that is available and connected

heartbeat ( ) : void
peekAvailableConnection ( string siteId ) : bool

This function shouldn't be utilized in production as thread safety isn't guaranteed between peek and getAvailableConnection. For controlled testing only

reconnect ( gov.va.medora.mdo.dao.AbstractConnection cxn ) : void

Disconnect old connection and try reconnecting to same site. Set old connection to new connection if the reconnent is successful

start ( ) : void
startAsync ( ) : void
startQuick ( ) : void
threadedReallocateConnection ( object cxn ) : void

Method Details

QueryThreadPool() public method

public QueryThreadPool ( int connectionPoolSize, int cxnRefreshTime, AbstractAccount account, AbstractCredentials creds, SiteTable siteTable, IList cxnSites ) : System
connectionPoolSize int
cxnRefreshTime int
account AbstractAccount
creds AbstractCredentials
siteTable SiteTable
cxnSites IList
return System

queue() public method

public queue ( QueryThread qt, string siteId ) : void
qt QueryThread
siteId string
return void

reallocateConnection() public method

public reallocateConnection ( gov.va.medora.mdo.dao.AbstractConnection cxn ) : void
cxn gov.va.medora.mdo.dao.AbstractConnection
return void

shutdown() public method

public shutdown ( ) : void
return void