Search in sources :

Example 1 with LoaderCallback

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

the class CacheConfig method initializeCacheLoaderArgument.

private CacheLoaderArgument initializeCacheLoaderArgument() {
    final LoaderCallback loaderCallback = new LoaderCallback() {

        @Override
        public Object loadConfig(@Nullable final String inputJson) throws IOException {
            return inputJson != null ? objectMapper.readValue(inputJson, PerTenantConfig.class) : new PerTenantConfig();
        }
    };
    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) LoaderCallback(org.killbill.billing.util.cache.TenantConfigCacheLoader.LoaderCallback) Nullable(javax.annotation.Nullable) CacheLoaderArgument(org.killbill.billing.util.cache.CacheLoaderArgument)

Aggregations

Nullable (javax.annotation.Nullable)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.TenantConfigCacheLoader.LoaderCallback)1