@RequiresPermissions("bankAccount:operate")
    public double withdrawFrom(long anAccountId, double anAmount)
            throws AccountNotFoundException, NotEnoughFundsException, InactiveAccountException {
        assertServiceState();
        LOGGER.info("Making withdrawal of " + anAmount + " from account " + anAccountId);

        Account a = safelyRetrieveAccountForId(anAccountId);
        AccountTransaction tx = AccountTransaction.createWithdrawalTx(anAccountId, anAmount);
        tx.setCreatedBy(getCurrentUsername());
        LOGGER.debug("Created a new transaction " + tx);

        a.applyTransaction(tx);
        LOGGER.debug("New balance of account " + a.getId() + " after withdrawal is " + a.getBalance());

        return a.getBalance();
    }
Internal utility method that validate the internal state of this service.
samples/aspectj/src/main/java/org/apache/shiro/samples/aspectj/bank/SecureBankService.java