package com.platform.utils;

import org.apache.log4j.Logger;

import com.base.Custom4exception;

/** 定时查询 volume
 * @author chen
 *
 */
public class ThreadVolume extends Thread {
	
	public final static Logger log = Logger.getLogger(ThreadVolume.class);

	/**
	 *  获取 volume信息
	 */
	private GetVolumeInfo vo = new GetVolumeInfo();
	
	/**
	 * 挂载点路径 -- 暂时无用的
	 */
	private static String pointPath = "/home";

	public ThreadVolume() {
		setName("ThreadVolume");
	}

	public ThreadVolume(String name) {
		setName(name);
	}

	public ThreadVolume(String name, String path) {
		if (null != path && !"".equals(path.trim())) {
			ThreadVolume.pointPath = path;
		}
	}

	@Override
	public void run() {
		super.run();
		while (true) {
			try {
				vo.getVolumeMsg();
				Thread.sleep(Constant.get_volume_sleep_time);
			} catch (Exception e) {
				log.error(Custom4exception.threadVolume_Thread_Except, e);
			}

		}

	}

	public static String getPointPath() {
		return pointPath;
	}

	public static void setPointPath(String pointPath) {
		ThreadVolume.pointPath = pointPath;
	}

}
