top.jfunc.http.component.AbstractCloseAdapter Maven / Gradle / Ivy
package top.jfunc.http.component;
import java.io.Closeable;
import java.io.IOException;
/**
* 关闭执行器
* @author xiongshiyan at 2020/1/6 , contact me with email [email protected] or phone 15208384257
*/
public abstract class AbstractCloseAdapter implements Closeable{
private C c;
public AbstractCloseAdapter(C c) {
this.c = c;
}
@Override
public void close() throws IOException {
if(null != c){
doClose(c);
}
}
/**
* 调用真正的关闭方法
* @param c C
* @throws IOException IOException
*/
protected abstract void doClose(C c) throws IOException ;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy