X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fkernel%2FKernelThread.java;h=a0f9c5b71d895b7357a4458bd9611c7d0a8d4185;hb=a1e5c8447beec2b896b0a03e38a4c17608a4b85d;hp=944a7cd3dbcf3bd42b59afdc37ce535c49bff558;hpb=ba8f8a6fb8ad9649dd03b2ac4670d194f0e1be79;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelThread.java b/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelThread.java index 944a7cd3d..a0f9c5b71 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelThread.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelThread.java @@ -7,13 +7,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.jackrabbit.api.stats.RepositoryStatistics; import org.apache.jackrabbit.stats.RepositoryStatisticsImpl; -import org.argeo.cms.CmsException; +import org.argeo.cms.internal.auth.CmsSessionImpl; /** - * Background thread started by the {@link Kernel}, which gather statistics and + * Background thread started by the kernel, which gather statistics and * monitor/control other processes. */ class KernelThread extends Thread { + private final static Log log = LogFactory.getLog(KernelThread.class); + private RepositoryStatisticsImpl repoStats; /** The smallest period of operation, in ms */ @@ -35,6 +37,9 @@ class KernelThread extends Thread { } private void doSmallestPeriod() { + // Clean expired sessions + CmsSessionImpl.closeInvalidSessions(); + if (kernelStatsLog.isDebugEnabled()) { StringBuilder line = new StringBuilder(64); line.append("§\t"); @@ -85,6 +90,8 @@ class KernelThread extends Thread { @Override public void run() { + if (log.isTraceEnabled()) + log.trace("Kernel thread started."); final long periodNs = PERIOD * m; while (running) { long beginNs = System.nanoTime(); @@ -106,11 +113,12 @@ class KernelThread extends Thread { synchronized void destroyAndJoin() { running = false; notifyAll(); - interrupt(); - try { - join(PERIOD * 2); - } catch (InterruptedException e) { - throw new CmsException("Kernel thread destruction was interrupted"); - } +// interrupt(); +// try { +// join(PERIOD * 2); +// } catch (InterruptedException e) { +// // throw new CmsException("Kernel thread destruction was interrupted"); +// log.error("Kernel thread destruction was interrupted", e); +// } } }