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

net.java.truevfs.comp.inst.InstrumentingBuffer Maven / Gradle / Ivy

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

import java.util.Objects;
import javax.annotation.concurrent.ThreadSafe;
import net.java.truecommons.cio.DecoratingIoBuffer;
import net.java.truecommons.cio.InputSocket;
import net.java.truecommons.cio.IoBuffer;
import net.java.truecommons.cio.OutputSocket;

/**
 * @param   the type of the mediator.
 * @author Christian Schlichtherle
 */
@ThreadSafe
public class InstrumentingBuffer>
extends DecoratingIoBuffer {

    protected final M mediator;

    public InstrumentingBuffer(final M mediator, final IoBuffer entry) {
        super(entry);
        this.mediator = Objects.requireNonNull(mediator);
    }

    @Override
    public InputSocket input() {
        return mediator.instrument(this, entry.input());
    }

    @Override
    public OutputSocket output() {
        return mediator.instrument(this, entry.output());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy