org.jboss.ejb3.pool
Interface Pool

All Known Implementing Classes:
AbstractPool, InfinitePool, StrictMaxPool, ThreadlocalPool

public interface Pool

Minimally a pool acts as a factory for a bean. It will handle callbacks to ejbCreate and ejbRemove as well.

Version:
$Revision: 67042 $
Author:
Bill Burke

Method Summary
 void destroy()
          Destroy the pool.
 void discard(BeanContext<?> obj)
          Discard the bean.
 BeanContext<?> get()
          Creates if no object is available in pool.
 BeanContext<?> get(Class<?>[] initTypes, Object[] initValues)
           
 int getAvailableCount()
           
 int getCreateCount()
           
 int getCurrentSize()
           
 int getMaxSize()
           
 int getRemoveCount()
           
 void initialize(Container container, int maxSize, long timeout)
           
 void release(BeanContext<?> obj)
          Put bean back in pool
 void remove(BeanContext<?> obj)
          Destroy bean.
 void setInjectors(Injector[] injectors)
           
 void setMaxSize(int maxSize)
           
 

Method Detail

get

BeanContext<?> get()
Creates if no object is available in pool. ejbCreate will be called if created


get

BeanContext<?> get(Class<?>[] initTypes,
                   Object[] initValues)

release

void release(BeanContext<?> obj)
Put bean back in pool


remove

void remove(BeanContext<?> obj)
Destroy bean. ejbRemove callback is executed


discard

void discard(BeanContext<?> obj)
Discard the bean. Called in different context as remove. If there is a system exception this is called.

Parameters:
obj -

setInjectors

void setInjectors(Injector[] injectors)

initialize

void initialize(Container container,
                int maxSize,
                long timeout)

getCurrentSize

int getCurrentSize()

getAvailableCount

int getAvailableCount()

getMaxSize

int getMaxSize()

setMaxSize

void setMaxSize(int maxSize)

getCreateCount

int getCreateCount()

getRemoveCount

int getRemoveCount()

destroy

void destroy()
Destroy the pool.



Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.