Methods Summary |
---|
public org.jboss.ejb3.stateful.StatefulBeanContext | create()
StatefulBeanContext ctx = null;
try
{
ctx = (StatefulBeanContext) pool.get();
++createCount;
synchronized (cacheMap)
{
cacheMap.put(ctx.getId(), ctx);
}
}
catch (EJBException e)
{
e.printStackTrace();
throw e;
}
catch (Exception e)
{
e.printStackTrace();
throw new EJBException(e);
}
return ctx;
|
public org.jboss.ejb3.stateful.StatefulBeanContext | create(java.lang.Class[] initTypes, java.lang.Object[] initValues)
StatefulBeanContext ctx = null;
try
{
ctx = (StatefulBeanContext) pool.get(initTypes, initValues);
synchronized (cacheMap)
{
cacheMap.put(ctx.getId(), ctx);
}
}
catch (EJBException e)
{
throw e;
}
catch (Exception e)
{
throw new EJBException(e);
}
return ctx;
|
public void | finished(org.jboss.ejb3.stateful.StatefulBeanContext ctx)
synchronized (ctx)
{
ctx.setInUse(false);
ctx.lastUsed = System.currentTimeMillis();
}
|
public org.jboss.ejb3.stateful.StatefulBeanContext | get(java.lang.Object key)
return get(key, true);
|
public org.jboss.ejb3.stateful.StatefulBeanContext | get(java.lang.Object key, boolean markInUse)
StatefulBeanContext entry = null;
synchronized (cacheMap)
{
entry = (StatefulBeanContext) cacheMap.get(key);
}
if (entry == null)
{
throw new NoSuchEJBException("Could not find Stateful bean: " + key);
}
if (markInUse)
{
if (entry.isRemoved())
{
throw new NoSuchEJBException("Could not find stateful bean: " + key +
" (bean was marked as removed");
}
entry.setInUse(true);
entry.lastUsed = System.currentTimeMillis();
}
return entry;
|
public int | getAvailableCount()
return -1;
|
public int | getCacheSize()
return cacheMap.size();
|
public int | getCreateCount()
return createCount;
|
public int | getCurrentSize()
return cacheMap.size();
|
public int | getMaxSize()
return -1;
|
public int | getPassivatedCount()
return 0;
|
public int | getRemoveCount()
return removeCount;
|
public int | getTotalSize()
return cacheMap.size();
|
public void | initialize(org.jboss.ejb3.Container container)
this.pool = container.getPool();
cacheMap = new HashMap();
|
public void | remove(java.lang.Object key)
StatefulBeanContext ctx = null;
synchronized (cacheMap)
{
ctx = (StatefulBeanContext) cacheMap.remove(key);
}
if (ctx != null)
{
pool.remove(ctx);
++removeCount;
}
|
public void | start()
|
public void | stop()
synchronized (cacheMap)
{
cacheMap.clear();
}
|