public abstract class Pool<T> extends Object
In many parts of the runtime, we need to pool instances of objects that
are expensive to create (such as JAXB objects, StAX parsers, Tube
instances.)
This class provides a default implementation of such a pool. TODO: improve the implementation
Modifier and Type | Class and Description |
---|---|
static class |
Pool.Marshaller
JAXB
Marshaller pool. |
static class |
Pool.TubePool
Tube pool. |
static class |
Pool.Unmarshaller
JAXB
Marshaller pool. |
Constructor and Description |
---|
Pool() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
create()
Creates a new instance of object.
|
void |
recycle(T t)
Returns an object back to the pool.
|
T |
take()
Gets a new object from the pool.
|
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.