net.ymate.platform.cache.ICaches Maven / Gradle / Ivy
/*
* Copyright 2007-2017 the original author or authors.
*
* Licensed 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 net.ymate.platform.cache;
import net.ymate.platform.core.YMP;
import java.util.List;
import java.util.Map;
/**
* @author 刘镇 ([email protected]) on 15/11/2 下午2:24
* @version 1.0
*/
public interface ICaches {
String MODULE_NAME = "cache";
/**
* 缓存作用域
*/
enum Scope {
APPLICATION, SESSION, DEFAULT
}
/**
* @return 返回所属YMP框架管理器实例
*/
YMP getOwner();
/**
* @return 返回缓存模块配置对象
*/
ICacheModuleCfg getModuleCfg();
/**
* @return 返回缓存提供者对象
*/
ICacheProvider getCacheProvider();
/**
* 从缓存中获取对象
*
* @param cacheName 缓存名称
* @param key 缓存Key
* @return 返回缓存的对象,若不存在则返回null
* @throws CacheException 可能产生的异常
*/
Object get(String cacheName, Object key) throws CacheException;
Object get(Object key) throws CacheException;
/**
* 从缓存中获取所有对象
*
* @param cacheName 缓存名称
* @return 返回缓存内对象映射
* @throws CacheException 可能产生的异常
*/
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy