de.schlichtherle.truezip.fs.inst.jmx.JmxInputSocket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truezip-extension-jmx-jul Show documentation
Show all versions of truezip-extension-jmx-jul Show documentation
This module provides a file system manager and an I/O pool service
for managing and monitoring TrueZIP via JMX and java.util.logging.
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.
The newest version!
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package de.schlichtherle.truezip.fs.inst.jmx;
import de.schlichtherle.truezip.entry.Entry;
import de.schlichtherle.truezip.fs.inst.InstrumentingInputSocket;
import de.schlichtherle.truezip.rof.ReadOnlyFile;
import de.schlichtherle.truezip.socket.InputSocket;
import java.io.IOException;
import java.io.InputStream;
import javax.annotation.concurrent.Immutable;
/**
* @author Christian Schlichtherle
*/
@Immutable
class JmxInputSocket
extends InstrumentingInputSocket {
final JmxIOStatistics stats;
JmxInputSocket(InputSocket extends E> model, JmxDirector director, JmxIOStatistics stats) {
super(model, director);
assert null != stats;
this.stats = stats;
}
@Override
public final ReadOnlyFile newReadOnlyFile() throws IOException {
return new JmxReadOnlyFile(getBoundSocket().newReadOnlyFile(), stats);
}
@Override
public final InputStream newInputStream() throws IOException {
return new JmxInputStream(getBoundSocket().newInputStream(), stats);
}
}