com.atlassian.bamboo.utils.expirables
Class ExpirableReferences

java.lang.Object
  extended by com.atlassian.bamboo.utils.expirables.ExpirableReferences

public class ExpirableReferences
extends java.lang.Object


Method Summary
static
<T> com.atlassian.util.concurrent.ResettableLazyReference<T>
expirable(com.google.common.base.Supplier<T> supplier, BambooTimeValue timeToIdle, ExpiryTicker expiryTicker)
          Returns a $ResettableLazyReference.
static
<T extends java.io.Closeable>
com.atlassian.util.concurrent.ResettableLazyReference<T>
expirableWithClose(com.google.common.base.Supplier<T> supplier, BambooTimeValue timeToIdle, ExpiryTicker expiryTicker)
          Returns a $that will automatically close() the referenced object when it's expired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

expirable

public static <T> com.atlassian.util.concurrent.ResettableLazyReference<T> expirable(@NotNull
                                                                                     com.google.common.base.Supplier<T> supplier,
                                                                                     @NotNull
                                                                                     BambooTimeValue timeToIdle,
                                                                                     @NotNull
                                                                                     ExpiryTicker expiryTicker)
Returns a $ResettableLazyReference. The reference will support expiry if expiryTicker is not null. Otherwise it will be a plain resettable reference.


expirableWithClose

public static <T extends java.io.Closeable> com.atlassian.util.concurrent.ResettableLazyReference<T> expirableWithClose(@NotNull
                                                                                                                        com.google.common.base.Supplier<T> supplier,
                                                                                                                        @NotNull
                                                                                                                        BambooTimeValue timeToIdle,
                                                                                                                        @NotNull
                                                                                                                        ExpiryTicker expiryTicker)
Returns a $that will automatically close() the referenced object when it's expired



Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.