Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description |
|---|---|
protected |
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 double |
addTerBilledAmount(long terClientID,
double billedAmount)
Adds billed amount to total billed amount for corresponding account id
|
protected 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.
|
protected void |
shutDown()
Shutting down this thread.
|
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, yieldprotected 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()
protected void addOrgBilledAmount(long orgClientID,
double billedAmount)
orgClientID - originating client id for which bill should be addedbilledAmount - billed amount that should be addedprotected double addTerBilledAmount(long terClientID,
double billedAmount)
terClientID - terminating account id for which bill has happenedbilledAmount - billed amount that should be added in total billprotected void immediateDatabaseBalanceUpdate(long accountID)
accountID - for which balance should be updated in mysql immediatelyprotected void shutDown()
Copyright © 2022. All rights reserved.