Search in sources :

Example 11 with CacheLoaderArgument

use of org.killbill.billing.util.cache.CacheLoaderArgument in project killbill by killbill.

the class DefaultImmutableAccountInternalApi method createImmutableAccountCacheLoaderArgument.

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

        @Override
        public Object 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

CacheLoaderArgument (org.killbill.billing.util.cache.CacheLoaderArgument)11 ObjectType (org.killbill.billing.ObjectType)7 InternalTenantContext (org.killbill.billing.callcontext.InternalTenantContext)7 Predicate (com.google.common.base.Predicate)1 ImmutableList (com.google.common.collect.ImmutableList)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Annotation (java.lang.annotation.Annotation)1 URI (java.net.URI)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 UUID (java.util.UUID)1 Nullable (javax.annotation.Nullable)1 DefaultStateMachineConfig (org.killbill.automaton.DefaultStateMachineConfig)1 StateMachineConfig (org.killbill.automaton.StateMachineConfig)1 Account (org.killbill.billing.account.api.Account)1 DefaultAccount (org.killbill.billing.account.api.DefaultAccount)1 DefaultImmutableAccountData (org.killbill.billing.account.api.DefaultImmutableAccountData)1 DefaultPlan (org.killbill.billing.catalog.DefaultPlan)1 DefaultPlanPhasePriceOverride (org.killbill.billing.catalog.DefaultPlanPhasePriceOverride)1