Top Inners Fields Constructors Methods
org.eclipse.jetty.util.compression

public abstract Class CompressionPool<T>

extends ContainerLifeCycle
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.util.compression.DeflaterPool, org.eclipse.jetty.util.compression.InflaterPool
Annotations
@ManagedObject
Imports
java.io.Closeable, org.eclipse.jetty.util.ConcurrentPool, .IO, .Pool, org.eclipse.jetty.util.annotation.ManagedObject, org.eclipse.jetty.util.component.ContainerLifeCycle

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private int
private Pool<CompressionPool<T>.Entry>
public static final int

Constructor Summary

AccessConstructor and Description
public
CompressionPool(int
maximum number of Objects which can be contained in the pool
capacity
)

Create a Pool of T instances.

Method Summary

Modifier and TypeMethod and Description
public CompressionPool<T>.Entry

Returns:

Object taken from the pool if it is not empty or a newly created Object
acquire
()

protected void
doStart()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.
public void
doStop()

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.
protected abstract void
end(T object)

public int
public Pool<CompressionPool<T>.Entry>
protected abstract T
public void
release(CompressionPool<T>.Entry
returns this Object to the pool or calls end(Object) if the pool is full.
entry
)

Release an Entry.

protected abstract void
reset(T object)

public void
setCapacity(int capacity)

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.
Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydumpdumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans

Field Detail

_capacityback to summary
private int _capacity
_poolback to summary
private Pool<CompressionPool<T>.Entry> _pool
DEFAULT_CAPACITYback to summary
public static final int DEFAULT_CAPACITY

Constructor Detail

CompressionPoolback to summary
public CompressionPool(int capacity)

Create a Pool of T instances. If given a capacity equal to zero the Objects will not be pooled and will be created on acquire and ended on release. If given a negative capacity equal to zero there will be no size restrictions on the Pool

Parameters
capacity:int

maximum number of Objects which can be contained in the pool

Method Detail

acquireback to summary
public CompressionPool<T>.Entry acquire()
Returns:CompressionPool<T>.Entry

Object taken from the pool if it is not empty or a newly created Object

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStart.

Starts the managed lifecycle beans in the order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

If there was a problem starting. Will cause a transition to FAILED state

doStopback to summary
public void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.ContainerLifeCycle.doStop.

Stops the managed lifecycle beans in the reverse order they were added.

Annotations
@Override
Exceptions
Exception:

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

If there was a problem stopping. Will cause a transition to FAILED state

endback to summary
protected abstract void end(T object)
getCapacityback to summary
public int getCapacity()
getPoolback to summary
public Pool<CompressionPool<T>.Entry> getPool()
newPooledback to summary
protected abstract T newPooled()
releaseback to summary
public void release(CompressionPool<T>.Entry entry)

Release an Entry.

Parameters
entry:CompressionPool<T>.Entry

returns this Object to the pool or calls end(Object) if the pool is full.

resetback to summary
protected abstract void reset(T object)
setCapacityback to summary
public void setCapacity(int capacity)
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.eclipse.jetty.util.compression back to summary

public Class CompressionPool.Entry

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable

Field Summary

Modifier and TypeField and Description
private final Pool.Entry<CompressionPool<T>.Entry>
private final T

Constructor Summary

AccessConstructor and Description
pack-priv
Entry(T value)

pack-priv
Entry(T value, Pool.Entry<CompressionPool<T>.Entry> entry)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public T
get()

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_entryback to summary
private final Pool.Entry<CompressionPool<T>.Entry> _entry
_valueback to summary
private final T _value

Constructor Detail

Entryback to summary
pack-priv Entry(T value)
Entryback to summary
pack-priv Entry(T value, Pool.Entry<CompressionPool<T>.Entry> entry)

Method Detail

closeback to summary
public void close()

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
getback to summary
public T get()
releaseback to summary
public void release()