All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.java.truevfs.ext.insight.I5tStatistics.scala Maven / Gradle / Ivy

Go to download

Instruments the TrueVFS Kernel for statistics monitoring via JMX. 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.

There is a newer version: 0.14.0
Show newest version
/*
 * Copyright (C) 2005-2013 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */
package net.java.truevfs.ext.insight

import javax.annotation.concurrent._
import net.java.truevfs.comp.jmx._
import net.java.truevfs.ext.insight.stats._

/**
 * A controller for [[net.java.truevfs.ext.insight.stats.FsStatistics]].
 *
 * @author Christian Schlichtherle
 */
@ThreadSafe
private abstract class I5tStatistics(mediator: I5tMediator, offset: Int)
extends JmxComponent {

  assert(0 <= offset)

  def subject = mediator.subject
  def stats = mediator stats offset
  def rotate { mediator rotateStats this }

  private def objectName = mediator
    .nameBuilder(classOf[FsStatistics])
    .put("subject", subject)
    .put("offset", mediator formatOffset offset)
    .get

  def newView: I5tStatisticsView

  override def activate() { mediator register (objectName, newView) }

  override def toString =
    "%s[subject=%s, offset=%d, mediator=%s]" format (getClass.getName, subject, offset, mediator)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy