org.jfox.ejb
Class StatefulSessionBeanObjectPool

java.lang.Object
  extended byorg.huihoo.jfox.system.ComponentSupport
      extended byorg.jfox.ejb.StatefulSessionBeanObjectPool
All Implemented Interfaces:
Component, IndexedObjectPool, Loggable, Persistentable, java.io.Serializable

public class StatefulSessionBeanObjectPool
extends ComponentSupport
implements IndexedObjectPool

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.huihoo.jfox.system.ComponentSupport
logger, name, proxyInstance, sequence, state
 
Constructor Summary
StatefulSessionBeanObjectPool(StatefulSessionBucket bucket, ObjectFactory factory)
           
 
Method Summary
 void clear()
          Clears any objects sitting idle in the pool, releasing any associated resources
 PoolableObject createObject()
           
protected  void doDestroy()
          do actually destory action
protected  void doInit()
          do actually create action
 ObjectFactory getObjectFactory()
          get the factory use to create new instances
 int getRest()
          get the count of rest object
 int getWorking()
          get the count of working object
 void lifecycleCheck()
          对缓存的对象进行生命周期检查
 EJBPoolableObject loadObject(java.lang.Object key)
           
static void main(java.lang.String[] args)
           
 boolean passivateObject(java.lang.Object key)
           
 boolean removeObject(java.lang.Object key)
          remove a poolable object from the pool
 boolean restoreObject(java.lang.Object key, PoolableObject obj)
          如果池中已经有该 key 存在,返回 false,没有则返回 true
 PoolableObject retrieveObject(java.lang.Object key)
          retrieve Object from object pool with the key 如果这个 key 还不存在,就新建该 key ,并返回和该 key 关联的对象
 
Methods inherited from class org.huihoo.jfox.system.ComponentSupport
destroy, getLogger, getName, getState, init, parseName, setLogger, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulSessionBeanObjectPool

public StatefulSessionBeanObjectPool(StatefulSessionBucket bucket,
                                     ObjectFactory factory)
Method Detail

createObject

public PoolableObject createObject()
                            throws java.lang.Exception
Throws:
java.lang.Exception

retrieveObject

public PoolableObject retrieveObject(java.lang.Object key)
                              throws java.lang.Exception
Description copied from interface: IndexedObjectPool
retrieve Object from object pool with the key 如果这个 key 还不存在,就新建该 key ,并返回和该 key 关联的对象

Specified by:
retrieveObject in interface IndexedObjectPool
Returns:
Throws:
java.lang.Exception

restoreObject

public boolean restoreObject(java.lang.Object key,
                             PoolableObject obj)
如果池中已经有该 key 存在,返回 false,没有则返回 true

Specified by:
restoreObject in interface IndexedObjectPool
Parameters:
key -
obj -
Returns:

removeObject

public boolean removeObject(java.lang.Object key)
Description copied from interface: IndexedObjectPool
remove a poolable object from the pool

Specified by:
removeObject in interface IndexedObjectPool
Parameters:
key -
Returns:

clear

public void clear()
Description copied from interface: IndexedObjectPool
Clears any objects sitting idle in the pool, releasing any associated resources

Specified by:
clear in interface IndexedObjectPool

getObjectFactory

public ObjectFactory getObjectFactory()
Description copied from interface: IndexedObjectPool
get the factory use to create new instances

Specified by:
getObjectFactory in interface IndexedObjectPool

getWorking

public int getWorking()
Description copied from interface: IndexedObjectPool
get the count of working object

Specified by:
getWorking in interface IndexedObjectPool
Returns:

getRest

public int getRest()
Description copied from interface: IndexedObjectPool
get the count of rest object

Specified by:
getRest in interface IndexedObjectPool
Returns:

doInit

protected void doInit()
               throws java.lang.Exception
Description copied from class: ComponentSupport
do actually create action

Specified by:
doInit in class ComponentSupport
Throws:
java.lang.Exception

doDestroy

protected void doDestroy()
                  throws java.lang.Exception
Description copied from class: ComponentSupport
do actually destory action

Specified by:
doDestroy in class ComponentSupport
Throws:
java.lang.Exception

passivateObject

public boolean passivateObject(java.lang.Object key)

loadObject

public EJBPoolableObject loadObject(java.lang.Object key)
                             throws java.lang.Exception
Throws:
java.lang.Exception

lifecycleCheck

public void lifecycleCheck()
对缓存的对象进行生命周期检查


main

public static void main(java.lang.String[] args)