@Override public void afterReferenceCreation(Reference r) { if (manager==callback) { callback.afterReferenceCreation(r); return; } // we use the idle manager, so let us use the reference counter // we change the manager once the threshold is reached. There is // a small chance that the value will go beyond Integer.MAX_VALUE // so we check for values below 0 too. If threshold is low, then // this is unlikely to happen. If threshold is high, then we // have all negative values as fall back int count = refCnt.incrementAndGet(); if (count>threshold || count<0) { manager = callback; callback.afterReferenceCreation(r); } } @Override
public ManagedReference(ReferenceType type, ReferenceManager rmanager, T value) { if (rmanager==null) rmanager = NULL_MANAGER; this.manager = rmanager; this.ref = type.createReference(value, this, rmanager.getReferenceQueue()); rmanager.afterReferenceCreation(ref); }
@Override public void afterReferenceCreation(Reference r) { if (manager==callback) { callback.afterReferenceCreation(r); return; } // we use the idle manager, so let us use the reference counter // we change the manager once the threshold is reached. There is // a small chance that the value will go beyond Integer.MAX_VALUE // so we check for values below 0 too. If threshold is low, then // this is unlikely to happen. If threshold is high, then we // have all negative values as fall back int count = refCnt.incrementAndGet(); if (count>threshold || count<0) { manager = callback; } } @Override
@Override public void afterReferenceCreation(Reference r) { if (manager==callback) { callback.afterReferenceCreation(r); return; } // we use the idle manager, so let us use the reference counter // we change the manager once the threshold is reached. There is // a small chance that the value will go beyond Integer.MAX_VALUe // so we check for values below 0 too. If threshold is low, then // this is unlikely to happen. If threshold is high, then we // have all negative values as fall back int count = refCnt.incrementAndGet(); if (count>threshold || count<0) { manager = callback; } } @Override
@Override public void afterReferenceCreation(Reference r) { if (manager==callback) { callback.afterReferenceCreation(r); return; } // we use the idle manager, so let us use the reference counter // we change the manager once the threshold is reached. There is // a small chance that the value will go beyond Integer.MAX_VALUe // so we check for values below 0 too. If threshold is low, then // this is unlikely to happen. If threshold is high, then we // have all negative values as fall back int count = refCnt.incrementAndGet(); if (count>threshold || count<0) { manager = callback; } } @Override
public ManagedReference(ReferenceType type, ReferenceManager rmanager, T value) { if (rmanager==null) rmanager = NULL_MANAGER; this.manager = rmanager; this.ref = type.createReference(value, this, rmanager.getReferenceQueue()); rmanager.afterReferenceCreation(ref); }
public ManagedReference(ReferenceType type, ReferenceManager rmanager, T value) { if (rmanager==null) rmanager = NULL_MANAGER; this.manager = rmanager; this.ref = type.createReference(value, this, rmanager.getReferenceQueue()); rmanager.afterReferenceCreation(ref); }
public ManagedReference(ReferenceType type, ReferenceManager rmanager, T value) { if (rmanager==null) rmanager = NULL_MANAGER; this.manager = rmanager; this.ref = type.createReference(value, this, rmanager.getReferenceQueue()); rmanager.afterReferenceCreation(ref); }