org.killbill.billing.util.glue.RedisShiroManager Maven / Gradle / Ivy
/*
* Copyright 2014-2018 Groupon, Inc
* Copyright 2014-2018 The Billing Project, LLC
*
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package org.killbill.billing.util.glue;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import javax.cache.Cache.Entry;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.killbill.commons.metrics.api.MetricRegistry;
import org.redisson.api.RedissonClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class RedisShiroManager extends RedisCacheProviderBase implements CacheManager {
private static final Logger log = LoggerFactory.getLogger(RedisShiroManager.class);
private final javax.cache.CacheManager eh107CacheManager;
public RedisShiroManager(final javax.cache.CacheManager eh107CacheManager,
final MetricRegistry metricRegistry,
final RedissonClient redissonClient) {
super(metricRegistry, redissonClient);
this.eh107CacheManager = eh107CacheManager;
}
@Override
public Cache getCache(final String name) throws CacheException {
log.trace("Acquiring RedisShiro instance named [{}]", name);
javax.cache.Cache