Search in sources :

Example 1 with LoaderCallback

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

the class EhCacheCatalogCache method initializeCacheLoaderArgument.

//
// Build the LoaderCallback that is required to build the catalog from the xml from a module that knows
// nothing about catalog.
//
// This is a contract between the TenantCatalogCacheLoader and the EhCacheCatalogCache
private CacheLoaderArgument initializeCacheLoaderArgument(final boolean filterTemplateCatalog) {
    final LoaderCallback loaderCallback = new LoaderCallback() {

        @Override
        public Object loadCatalog(final List<String> catalogXMLs, final Long tenantRecordId) throws CatalogApiException {
            return loader.load(catalogXMLs, filterTemplateCatalog, tenantRecordId);
        }
    };
    final Object[] args = new Object[1];
    args[0] = loaderCallback;
    final ObjectType irrelevant = null;
    final InternalTenantContext notUsed = null;
    return new CacheLoaderArgument(irrelevant, args, notUsed);
}
Also used : ObjectType(org.killbill.billing.ObjectType) InternalTenantContext(org.killbill.billing.callcontext.InternalTenantContext) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) LoaderCallback(org.killbill.billing.util.cache.TenantCatalogCacheLoader.LoaderCallback) CacheLoaderArgument(org.killbill.billing.util.cache.CacheLoaderArgument)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 List (java.util.List)1 ObjectType (org.killbill.billing.ObjectType)1 InternalTenantContext (org.killbill.billing.callcontext.InternalTenantContext)1 CacheLoaderArgument (org.killbill.billing.util.cache.CacheLoaderArgument)1 LoaderCallback (org.killbill.billing.util.cache.TenantCatalogCacheLoader.LoaderCallback)1