Search in sources :

Example 1 with LoaderCallback

use of org.killbill.billing.util.cache.ImmutableAccountCacheLoader.LoaderCallback in project killbill by killbill.

the class DefaultImmutableAccountInternalApi method createImmutableAccountCacheLoaderArgument.

private CacheLoaderArgument createImmutableAccountCacheLoaderArgument(final InternalTenantContext context) {
    final LoaderCallback loaderCallback = new LoaderCallback() {

        @Override
        public ImmutableAccountData loadAccount(final Long recordId, final InternalTenantContext context) {
            final Account account = getAccountByRecordIdInternal(recordId, context);
            return account != null ? new DefaultImmutableAccountData(account) : null;
        }
    };
    final Object[] args = { loaderCallback };
    return new CacheLoaderArgument(null, args, context);
}
Also used : DefaultAccount(org.killbill.billing.account.api.DefaultAccount) Account(org.killbill.billing.account.api.Account) DefaultImmutableAccountData(org.killbill.billing.account.api.DefaultImmutableAccountData) InternalTenantContext(org.killbill.billing.callcontext.InternalTenantContext) LoaderCallback(org.killbill.billing.util.cache.ImmutableAccountCacheLoader.LoaderCallback) CacheLoaderArgument(org.killbill.billing.util.cache.CacheLoaderArgument)

Aggregations

Account (org.killbill.billing.account.api.Account)1 DefaultAccount (org.killbill.billing.account.api.DefaultAccount)1 DefaultImmutableAccountData (org.killbill.billing.account.api.DefaultImmutableAccountData)1 InternalTenantContext (org.killbill.billing.callcontext.InternalTenantContext)1 CacheLoaderArgument (org.killbill.billing.util.cache.CacheLoaderArgument)1 LoaderCallback (org.killbill.billing.util.cache.ImmutableAccountCacheLoader.LoaderCallback)1