net.jini.jeri.kerberos
Class KerberosUtil.SoftCache.ValueCell

java.lang.Object
  extended by java.lang.ref.Reference<T>
      extended by java.lang.ref.SoftReference
          extended by net.jini.jeri.kerberos.KerberosUtil.SoftCache.ValueCell
Enclosing class:
KerberosUtil.SoftCache

private static class KerberosUtil.SoftCache.ValueCell
extends SoftReference

An instance of this class maintains a reference to a key, and a soft reference to the value the key maps to.


Field Summary
private static Object INVALID_KEY
           
private  Object key
           
 
Constructor Summary
private KerberosUtil.SoftCache.ValueCell(Object key, Object value, ReferenceQueue queue)
           
 
Method Summary
private static KerberosUtil.SoftCache.ValueCell create(Object key, Object value, ReferenceQueue queue)
           
private  void drop()
          Clear the soft reference, and mark the cell as invalid
private  boolean isValid()
          Return true if this cell has not been dropped, false otherwise
private static Object strip(Object val, boolean drop)
          Extract the encapsulated value if the passed in object is an instance of ValueCell, clear the soft reference and mark the cell as invalid if drop is true.
 
Methods inherited from class java.lang.ref.SoftReference
get
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, isEnqueued
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_KEY

private static Object INVALID_KEY

key

private Object key
Constructor Detail

KerberosUtil.SoftCache.ValueCell

private KerberosUtil.SoftCache.ValueCell(Object key,
                                         Object value,
                                         ReferenceQueue queue)
Method Detail

create

private static KerberosUtil.SoftCache.ValueCell create(Object key,
                                                       Object value,
                                                       ReferenceQueue queue)

strip

private static Object strip(Object val,
                            boolean drop)
Extract the encapsulated value if the passed in object is an instance of ValueCell, clear the soft reference and mark the cell as invalid if drop is true.


isValid

private boolean isValid()
Return true if this cell has not been dropped, false otherwise


drop

private void drop()
Clear the soft reference, and mark the cell as invalid



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.