FileDocCategorySizeDatePackage
ByteBufferStreamPool.javaAPI DocExample3017Tue May 29 16:57:10 BST 2007com.sun.xml.ws.transport.tcp.pool

ByteBufferStreamPool

public final class ByteBufferStreamPool extends Object
author
Alexey Stashok

Fields Summary
private final com.sun.xml.ws.util.Pool
pool
Constructors Summary
public ByteBufferStreamPool(Class memberClass)

        pool = new Pool<T>() {
            protected T create() {
                T member = null;
                try {
                    member = ByteBufferStreamPool.this.create(memberClass);
                } catch (Exception e) {
                }
                
                return member;
            }
        };
    
Methods Summary
private Tcreate(java.lang.Class memberClass)

        return memberClass.newInstance();
    
public voidrelease(T member)

        member.passivate();
        pool.recycle(member);
    
public Ttake()

        final T member = pool.take();
        member.activate();
        return member;