![JAR search and dependency download from the Maven repository](/logo.png)
net.java.truevfs.ext.pacemaker.PaceMediator.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truevfs-ext-pacemaker Show documentation
Show all versions of truevfs-ext-pacemaker Show documentation
Constrains the number of concurrently mounted archive file systems in
order to save some heap space.
This module provides a JMX interface for monitoring and management.
Add the JAR artifact of this module to the run time class path to
make its services available for service location in the client API
modules.
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truevfs.ext.pacemaker
import net.java.truevfs.comp.inst._
import net.java.truevfs.comp.jmx._
import net.java.truevfs.kernel.spec._
/** A mediator for the instrumentation of the TrueVFS Kernel with a
* [[PaceManager]] and a [[PaceController]].
*
* @author Christian Schlichtherle
*/
private class PaceMediator extends JmxMediator[PaceMediator] with Immutable {
final val cachedMountPoints = new LruCache[FsMountPoint](maximumFileSystemsMountedDefaultValue)
final val evictedMountPoints = cachedMountPoints.evicted
final def maximumSize = cachedMountPoints.maximumSize
final def maximumSize_=(maximumSize: Int) {
require(maximumSize >= maximumFileSystemsMountedMinimumValue)
cachedMountPoints.maximumSize = maximumSize
}
final override def instrument(subject: FsManager) =
activate(new PaceManager(this, subject))
final override def instrument(context: InstrumentingManager[PaceMediator], subject: FsController) =
new PaceController(context.asInstanceOf[PaceManager], subject)
final override def instrument(context: InstrumentingManager[PaceMediator], subject: FsCompositeDriver) =
new InstrumentingCompositeDriver(this, subject)
final override def instrument(context: InstrumentingCompositeDriver[PaceMediator], subject: FsModel) =
new PaceModel(this, subject)
}
private object PaceMediator extends PaceMediator
© 2015 - 2025 Weber Informatics LLC | Privacy Policy