Methods Summary |
---|
public synchronized void | addAccount(Account newAccount)
_accounts.add(newAccount);
|
private synchronized void | decrementLockTimers()
Iterator i = _accounts.iterator();
while (i.hasNext()) {
Account_Impl nextAccount = (Account_Impl) i.next();
nextAccount.decrementLockTimer(THREAD_SLEEP_TIME);
}
|
public static synchronized com.ora.rmibook.chapter15.bank.Account_Impl_LockThread | getSingleton()
if (null == _singleton) {
_singleton = new Account_Impl_LockThread();
_singleton.start();
}
return _singleton;
|
public void | run()
while (true) {
try {
Thread.sleep(THREAD_SLEEP_TIME);
} catch (Exception ignored) {
}
decrementLockTimers();
}
|