Top Description Methods
org.xnio

public Interface Pooled<T>

extends AutoCloseable
Known Direct Implementers
org.xnio.Buffers.SecurePooledByteBuffer, org.xnio.ByteBufferSlicePool.PooledByteBuffer
Type Parameters
<T>
the pooled resource type

Deprecated

See ByteBufferPool.

A resource which is pooled.
Author
David M. Lloyd

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Delegates to free().

public void
discard()

Discard this resource.

public void
free()

Free this resource for immediate re-use.

public T

Returns:

the pooled resource
getResource
()

Get the pooled resource.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Delegates to free().

discardback to summary
public void discard()

Discard this resource. Any backing resources corresponding to this pooled resource will be rendered unavailable until the pooled resource has been garbage-collected.

freeback to summary
public void free()

Free this resource for immediate re-use. The resource must not be accessed again after calling this method; if it is possible that an instance is still in use, you must call discard() instead.

getResourceback to summary
public T getResource() throws IllegalStateException

Get the pooled resource.

Returns:T

the pooled resource

Exceptions
IllegalStateException:
if the resource has been freed or discarded already