Package com.hierynomus.smbj.common
Class Pooled<A extends Pooled<A>>
java.lang.Object
com.hierynomus.smbj.common.Pooled<A>
- Direct Known Subclasses:
Connection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicInteger
A newly createdPooled
object has 1 lease outstanding (the created object) -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
leases
A newly createdPooled
object has 1 lease outstanding (the created object)
-
-
Constructor Details
-
Pooled
public Pooled()
-
-
Method Details
-
lease
Takes a lease on the pooled object.- Returns:
this
if the object is still valid (has at least 1 lease), elsenull
-
release
public boolean release()Releases the pooled object. If this was the last outstanding lease,release()
returnstrue
.- Returns:
true
if this was the last outstanding lease. Elsefalse
-