Example usage for java.lang AutoCloseable getClass

List of usage examples for java.lang AutoCloseable getClass

Introduction

In this page you can find the example usage for java.lang AutoCloseable getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:io.fluo.metrics.config.Reporters.java

@Override
public void close() {
    for (AutoCloseable reporter : reporters) {
        try {//  ww  w  .j a  v a2 s .c o  m
            reporter.close();
        } catch (Exception e) {
            log.warn("Failed to stop " + reporter.getClass().getName(), e);
        }
    }
}

From source file:io.github.mywarp.mywarp.bukkit.MyWarpPlugin.java

@Override
public void onDisable() {
    unregister();/*from ww w  .j a va  2s  .  com*/

    //close any registered Closables
    for (AutoCloseable closeable : closeables) {
        try {
            closeable.close();
        } catch (Exception e) {
            log.warn("Failed to close " + closeable.getClass().getCanonicalName(), e);
        }
    }
}

From source file:com.emc.ecs.sync.EcsSync.java

private void safeClose(AutoCloseable closeable) {
    try {/*ww w .j a  v a  2  s.c  o  m*/
        if (closeable != null)
            closeable.close();
    } catch (Throwable t) {
        log.warn("could not close " + closeable.getClass().getSimpleName(), t);
    }
}

From source file:org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.java

public static void closeQuietly(AutoCloseable... closables) {
    for (AutoCloseable closable : closables) {
        if (closable != null) {
            try {
                closable.close();/*from   w ww  . j  a  v a  2 s .  c o m*/
            } catch (Exception e) {
                LOG.warn("Cannot close AutoCloseable {}, ignoring.", closable.getClass().getName());
                LOG.debug("Exception", e);
            }
        }
    }
}