Example usage for com.google.common.collect Interners newWeakInterner

List of usage examples for com.google.common.collect Interners newWeakInterner

Introduction

In this page you can find the example usage for com.google.common.collect Interners newWeakInterner.

Prototype

@GwtIncompatible("java.lang.ref.WeakReference")
public static <E> Interner<E> newWeakInterner() 

Source Link

Document

Returns a new thread-safe interner which retains a weak reference to each instance it has interned, and so does not prevent these instances from being garbage-collected.

Usage

From source file:org.gradle.api.internal.cache.StringInterner.java

public StringInterner() {
    this.interner = Interners.newWeakInterner();
}

From source file:com.torodb.mongowp.bson.netty.pool.WeakMapStringPool.java

public WeakMapStringPool(StringPoolPolicy heuristic) {
    super(heuristic);
    this.interner = Interners.newWeakInterner();
}

From source file:org.deckfour.xes.factory.XFactoryNaiveImpl.java

public XFactoryNaiveImpl() {
    super();
    // Use an weak references as this factory may stay around in the XFactoryRegistry for a long time 
    interner = Interners.newWeakInterner();
}

From source file:org.apache.sentry.provider.file.SimpleFileProviderBackend.java

public SimpleFileProviderBackend(Configuration conf, Path resourcePath) throws IOException {
    this.resourcePath = resourcePath;
    this.fileSystem = resourcePath.getFileSystem(conf);
    this.groupRolePrivilegeTable = HashBasedTable.create();
    this.conf = conf;
    this.configErrors = Lists.newArrayList();
    this.configWarnings = Lists.newArrayList();
    this.validators = ImmutableList.of();
    this.allowPerDatabaseSection = true;
    this.initialized = false;
    this.stringInterner = Interners.newWeakInterner();
}