XNIO API 3.0.7.GA

org.xnio
Interface Pooled<T>

Type Parameters:
T - the pooled resource type

public interface Pooled<T>

A resource which is pooled.

Author:
David M. Lloyd

Method Summary
 void discard()
          Discard this resource.
 void free()
          Free this resource for immediate re-use.
 T getResource()
          Get the pooled resource.
 

Method Detail

discard

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.


free

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.


getResource

T getResource()
              throws IllegalStateException
Get the pooled resource.

Returns:
the pooled resource
Throws:
IllegalStateException - if the resource has been freed or discarded already

XNIO API 3.0.7.GA

Copyright © 2010 JBoss, a division of Red Hat, Inc.