Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
MysqlBalanceUpdater(boolean redundancy,
BalanceManager balanceManager)
Create the instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOrgBilledAmount(long orgClientID,
double billedAmount)
Adds billed amount to total bill for corresponding account id
|
double |
addTerBilledAmount(long terClientID,
double billedAmount)
Adds billed amount to total billed amount for corresponding account id
|
double |
getMysqlBalance(long accountID) |
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.
|
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,
BalanceManager balanceManager)
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 periodicalbalanceManager - the instance of BalanceManager who owns this thread.public void run()
public void addOrgBilledAmount(long orgClientID,
double billedAmount)
orgClientID - originating client id for which bill should be addedbilledAmount - billed amount that should be addedpublic double 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 double getMysqlBalance(long accountID)
public void shutDown()
Copyright © 2024. All rights reserved.