All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.xson.web.cache.vo.CacheUseVo Maven / Gradle / Ivy

Go to download

xco-web is an easy to use control layer framework, is part of the SOA system, using xml language to describe the controller.

The newest version!
package org.xson.web.cache.vo;

import org.xson.web.Container;
import org.xson.web.async.AsyncTask;

public class CacheUseVo extends CacheBase {

	private Integer	time;

	public CacheUseVo(CacheVo cacheVo, String key, Integer time, String[] ignore, String service) {
		super(cacheVo, ignore, service);
		this.time = time;
		// 预处理key
		parseKey(service, key);
	}

	public void putObject(final Object arg, final Object value) {
		// 异步操作
		Container.getInstance().addAsyncTask(new AsyncTask() {
			@Override
			public void run() {
				String key = buildKey(arg);
				cacheVo.putObject(key, value, time, ignore, service);
			}
		});
	}

	public Object getObject(Object arg) {
		String key = buildKey(arg);
		return cacheVo.getObject(key);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy