Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
MysqlBalanceUpdater(boolean redundancy)
Create the instance
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOrgBilledAmount(long orgClientID,
double billedAmount)
Adds billed amount to total bill for corresponding account id
|
protected void |
addTerBilledAmount(long terClientID,
double billedAmount)
Adds billed amount to total billed amount for corresponding account id
|
void |
immediateDatabaseBalanceUpdate(long accountID)
When this account maintenance is needed and mysql balance need to be updated immediately,
this method does that
|
void |
run()
Continuously updates mysql balance without any sleep if some data are available to be updated in mysql,
and they are successfully updated then it will not sleep and try again.
|
void |
shutDown()
Shutting down this thread.
|
boolean |
updateMysqlBalanceForAllClient()
Mysql balance is updated for all client.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic MysqlBalanceUpdater(boolean redundancy)
redundancy - If redundancy is running for this BalanceManager then mysql balance update will be
as fast as possible, without any sleep. otherwise, mysql update will be periodicalpublic void run()
public boolean updateMysqlBalanceForAllClient()
protected void addOrgBilledAmount(long orgClientID,
double billedAmount)
orgClientID - originating client id for which bill should be addedbilledAmount - billed amount that should be addedprotected void addTerBilledAmount(long terClientID,
double billedAmount)
terClientID - terminating account id for which bill has happenedbilledAmount - billed amount that should be added in total billpublic void immediateDatabaseBalanceUpdate(long accountID)
accountID - for which balance should be updated in mysql immediatelypublic void shutDown()
Copyright © 2022. All rights reserved.