Java Code Examples for jdk.jfr.events.FileReadEvent

The following examples show how to use jdk.jfr.events.FileReadEvent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 2
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 3
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dsts, offset, length);
    }
    long bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dsts, offset, length);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 4
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 5
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 6
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 7
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 8
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 9
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 10
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 11
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 12
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dsts, offset, length);
    }
    long bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dsts, offset, length);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 13
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 14
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 15
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 16
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 17
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 18
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 19
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 20
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(ByteBuffer dst, long position) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dst, position);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dst, position);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 21
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public long read(ByteBuffer[] dsts, int offset, int length) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(dsts, offset, length);
    }
    long bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(dsts, offset, length);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 22
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 23
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 24
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 25
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read() throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read();
    }
    int result = 0;
    try {
        event.begin();
        result = read();
        if (result < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = 1;
        }
    } finally {
        event.path = path;
        event.commit();
        event.reset();
    }
    return result;
}
 
Example 26
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[]) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}
 
Example 27
@SuppressWarnings("deprecation")
@JIInstrumentationMethod
public int read(byte b[], int off, int len) throws IOException {
    FileReadEvent event = FileReadEvent.EVENT.get();
    if (!event.isEnabled()) {
        return read(b, off, len);
    }
    int bytesRead = 0;
    try {
        event.begin();
        bytesRead = read(b, off, len);
    } finally {
        if (bytesRead < 0) {
            event.endOfFile = true;
        } else {
            event.bytesRead = bytesRead;
        }
        event.path = path;
        event.commit();
        event.reset();
    }
    return bytesRead;
}