热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e
以下内容为反编译后的 g.java 源代码,内容仅作参考
package h0;
import ch.qos.logback.core.rolling.RolloverFailure;
import ch.qos.logback.core.rolling.helper.CompressionMode;
import i0.r;
import java.io.File;
import java.util.Date;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import m0.k;
public class g<E> extends d implements h<E> {
public i0.h f30670g;
public i0.b f30671h;
public Future<?> f30673j;
public Future<?> f30674k;
public i0.a f30677n;
public e<E> f30678o;
public r f30672i = new r();
public int f30675l = 0;
public k f30676m = new k(0);
public boolean f30679p = false;
public boolean J() {
return this.f30676m.a() == 0;
}
public Future<?> K(String str, String str2) throws RolloverFailure {
String str3 = str + System.nanoTime() + ".tmp";
this.f30672i.G(G(), str3);
return this.f30671h.F(str3, str, str2);
}
public void L(e<E> eVar) {
this.f30678o = eVar;
}
public final String M(String str) {
return i0.f.a(i0.f.b(str));
}
public final void N(Future<?> future, String str) {
StringBuilder sb2;
String str2;
if (future != null) {
try {
future.get(30L, TimeUnit.SECONDS);
} catch (TimeoutException e10) {
e = e10;
sb2 = new StringBuilder();
str2 = "Timeout while waiting for ";
sb2.append(str2);
sb2.append(str);
sb2.append(" job to finish");
addError(sb2.toString(), e);
} catch (Exception e11) {
e = e11;
sb2 = new StringBuilder();
str2 = "Unexpected exception while waiting for ";
sb2.append(str2);
sb2.append(str);
sb2.append(" job to finish");
addError(sb2.toString(), e);
}
}
}
@Override
public String g() {
String G = G();
return G != null ? G : this.f30678o.getCurrentPeriodsFileNameWithoutCompressionSuffix();
}
@Override
public boolean isTriggeringEvent(File file, E e10) {
return this.f30678o.isTriggeringEvent(file, e10);
}
@Override
public void m() throws RolloverFailure {
String elapsedPeriodsFileName = this.f30678o.getElapsedPeriodsFileName();
String a10 = i0.f.a(elapsedPeriodsFileName);
if (this.f30663a != CompressionMode.NONE) {
this.f30673j = G() == null ? this.f30671h.F(elapsedPeriodsFileName, elapsedPeriodsFileName, a10) : K(elapsedPeriodsFileName, a10);
} else if (G() != null) {
this.f30672i.G(G(), elapsedPeriodsFileName);
}
if (this.f30677n != null) {
this.f30674k = this.f30677n.j(new Date(this.f30678o.getCurrentTime()));
}
}
@Override
public void start() {
this.f30672i.setContext(this.context);
if (this.f30665c == null) {
addWarn("The FileNamePattern option must be set before using TimeBasedRollingPolicy. ");
addWarn("See also http://logback.qos.ch/codes.html#tbr_fnp_not_set");
throw new IllegalStateException("The FileNamePattern option must be set before using TimeBasedRollingPolicy. See also http://logback.qos.ch/codes.html#tbr_fnp_not_set");
}
this.f30664b = new i0.h(this.f30665c, this.context);
F();
i0.b bVar = new i0.b(this.f30663a);
this.f30671h = bVar;
bVar.setContext(this.context);
this.f30670g = new i0.h(i0.b.H(this.f30665c, this.f30663a), this.context);
addInfo("Will use the pattern " + this.f30670g + " for the active file");
if (this.f30663a == CompressionMode.ZIP) {
this.f30667e = new i0.h(M(this.f30665c), this.context);
}
if (this.f30678o == null) {
this.f30678o = new a();
}
this.f30678o.setContext(this.context);
this.f30678o.setTimeBasedRollingPolicy(this);
this.f30678o.start();
if (!this.f30678o.isStarted()) {
addWarn("Subcomponent did not start. TimeBasedRollingPolicy will not start.");
return;
}
if (this.f30675l != 0) {
i0.a archiveRemover = this.f30678o.getArchiveRemover();
this.f30677n = archiveRemover;
archiveRemover.u(this.f30675l);
this.f30677n.t(this.f30676m.a());
if (this.f30679p) {
addInfo("Cleaning on start up");
this.f30674k = this.f30677n.j(new Date(this.f30678o.getCurrentTime()));
}
} else if (!J()) {
addWarn("'maxHistory' is not set, ignoring 'totalSizeCap' option with value [" + this.f30676m + "]");
}
super.start();
}
@Override
public void stop() {
if (isStarted()) {
N(this.f30673j, "compression");
N(this.f30674k, "clean-up");
super.stop();
}
}
public String toString() {
return "c.q.l.core.rolling.TimeBasedRollingPolicy@" + hashCode();
}
public void u(int i10) {
this.f30675l = i10;
}
}