| Modifier and Type | Class and Description |
|---|---|
| public static interface | ObjectPool.
The object type. O>A lease for an object (obtained via |
| public static interface | ObjectPool.
The object type. T>Sanitizes a previously leased object so it can be reused by the pool. |
| public static interface |
| Modifier and Type | Method and Description |
|---|---|
| public static < The object type. O> ObjectPool | Returns: The object pool.The object supplier. supplier,The object sanitizer. sanitizerCreates a new |
| public ObjectPool. | |
| public static < The object type. O> ObjectPool. | Returns: The lease; closing/discarding has no effect.The object. obj)Returns a |
| newThreadLocalPool | back to summary |
|---|---|
| public static <O> ObjectPool Creates a new
| |
| take | back to summary |
|---|---|
| public ObjectPool. Takes an exclusive lease of an object from the pool. If no existing object is available from the pool, a new one may be provided.
| |
| unpooledLease | back to summary |
|---|---|
| public static <O> ObjectPool. Returns a
| |
get()); working with the object is only permitted
before close().
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | discard()
Marks the leased object as discarded, potentially preventing it from being reused in the object pool. |
| public O | Returns: The object, ornull.Returns the leased object, potentially |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Terminates the validity of this lease. Unless discarded via
| |
| discard | back to summary |
|---|---|
| public void discard() Marks the leased object as discarded, potentially preventing it from being reused in the object pool. | |
| get | back to summary |
|---|---|
| public O get() Returns the leased object, potentially
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if sanitization was successful, false if the object should not
be reused.The object to sanitize. obj)Sanitizes a previously leased object so it can be reused by the pool; if the object should
not be reused, |
| sanitize | back to summary |
|---|---|
| public boolean sanitize(T obj) Sanitizes a previously leased object so it can be reused by the pool; if the object should
not be reused,
| |
| Modifier and Type | Method and Description |
|---|---|
| public T |
| get | back to summary |
|---|---|
| public T get() Gets a result.
| |