package com.platform.service.thread;

import com.base.Custom4exception;
import com.base.CustomException;
import com.platform.form.oracleForm;
import com.platform.service.IOracleExtractService;

/** 测试是否能获得oracle连接
 * @author chen
 *
 */
public class ThreadGainOracleConnect extends Thread {
	
	private boolean isConnect = false;
	
	private boolean isExcept = false;
	
	private IOracleExtractService OracleExtract;
	
	private oracleForm form;
	
	/** 测试是否能获得oracle连接
	 * @param form
	 * @param OracleExtract
	 */
	public ThreadGainOracleConnect(oracleForm form, IOracleExtractService OracleExtract) {
		this.form = form;
		this.OracleExtract= OracleExtract;
	}
	
	@Override
	public void run() {
		try {
			this.isConnect = OracleExtract.isConnectTotalOracle(form.getTarget());
		} catch (Exception e) {
			isExcept = true;
			new CustomException(Custom4exception.connect_Oracle_Except,e,form,OracleExtract);
		}
	}

	/** 
	 * @return the isConnect true:能连接
	 */
	public boolean isConnect() {
		return isConnect;
	}

	/**
	 * @return the isExcept
	 */
	public boolean isExcept() {
		return isExcept;
	}

}
