|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jonas_ejb.container.JFactory | +--org.objectweb.jonas_ejb.container.JEntityFactory
This class is a factory for an Entity Bean. It is responsible for - managing Home and LocalHome. - managing a pool of instances/contexts - keeping the list of PKs and the associated JEntitySwitch's - keeping the JNDI context for this component (java:comp/env)
Field Summary | |
protected java.util.List |
bctxlist
|
protected java.lang.Object |
datasource
|
protected java.util.ArrayList |
entitySwitchUnused
This field is a pool of JEntitySwitch instance unused. |
protected JEntityHome |
home
|
protected int |
instanceCount
|
protected JEntityLocalHome |
localhome
|
protected int |
maxCacheSize
|
protected int |
minPoolSize
|
protected java.util.Hashtable |
pklist
|
protected boolean |
reentrant
|
protected boolean |
shared
|
Fields inherited from class org.objectweb.jonas_ejb.container.JFactory |
beanclass, cont, dd, ejb10Env, ejbname, JNDICtx, naming, tm, txbeanmanaged |
Constructor Summary | |
JEntityFactory()
constructor must be without parameters (required by Jorm) |
Method Summary | |
void |
bindEJB(java.lang.Object pk,
JEntitySwitch bs)
Bind a PK with a JEntitySwitch |
int |
calculateAutomaticPk()
Calculate a new uid for automatic pk creation Used by JEntityCmpJdbc.vm |
void |
checkTransaction(RequestCtx rctx)
Check Transaction before calling a method on a bean. |
protected JEntityContext |
createNewInstance()
Create a new instance of the bean and its EntityContext In case of CMP, the bean class is derived to manage entity persistence. |
JEntitySwitch |
existEJB(java.lang.Object pk)
get EJB by its PK |
int |
getCacheSize()
|
java.lang.Object |
getDataSource()
|
JEntitySwitch |
getEJB(java.lang.Object pk)
get EJB by its PK Creates if not exist yet. |
EntityCounters |
getEntityCounters()
Take a dump of current entity counters and return them |
JHome |
getHome()
returns the home if exist or null if not |
JEntityContext |
getJContext()
Get a Context from the pool, or create a new one if no more available in the pool. |
JEntitySwitch |
getJEntitySwitch()
This method allocates a new JEntitySwitch. |
JLocalHome |
getLocalHome()
returns the local home if exist or null if not |
int |
getMaxCacheSize()
|
int |
getMinPoolSize()
|
int |
getPoolSize()
Get the size of the instance pool for this bean |
void |
init(EntityDesc dd,
JContainer cont)
Init this object |
boolean |
isReentrant()
|
boolean |
isShared()
|
void |
reduceCache()
Reduce number of instances in memory |
void |
releaseJContext(JContext ctx)
Release a Context |
void |
removeEJB(java.lang.Object pk)
remove an EJB by its PK |
void |
stop()
stop this EJB. |
void |
sync()
synchronize bean instances if needed |
Methods inherited from class org.objectweb.jonas_ejb.container.JFactory |
checkJonasVersion, checkTransactionContainer, getContainer, getCorbaInitialContext, getDeploymentDescriptor, getEjb10Environment, getEJBName, getEnv, getInitialContext, getTransactionManager, init, isClassAvailable, isTxBeanManaged, myClassLoader, postInvoke, postInvokeRemote, preInvoke, preInvokeRemote, resetComponentContext, setComponentContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JEntityHome home
protected JEntityLocalHome localhome
protected boolean reentrant
protected boolean shared
protected java.util.List bctxlist
protected int minPoolSize
protected int instanceCount
protected int maxCacheSize
protected java.util.Hashtable pklist
protected java.lang.Object datasource
protected java.util.ArrayList entitySwitchUnused
Constructor Detail |
public JEntityFactory()
Method Detail |
public void init(EntityDesc dd, JContainer cont)
dd
- the deployment descriptorcont
- the Containerpublic JEntitySwitch getEJB(java.lang.Object pk)
pk
- The Primary Key Objectpublic JEntitySwitch existEJB(java.lang.Object pk)
pk
- The Primary Key Objectpublic void bindEJB(java.lang.Object pk, JEntitySwitch bs)
pk
- The Primary Key Objectbs
- The JEntitySwitchpublic JEntitySwitch getJEntitySwitch()
public void removeEJB(java.lang.Object pk)
pk
- The Primary Key Objectpublic int getPoolSize()
BeanFactory
getPoolSize
in class JFactory
public void stop()
public void sync()
public void reduceCache()
public JHome getHome()
BeanFactory
public JLocalHome getLocalHome()
BeanFactory
public JEntityContext getJContext()
public void releaseJContext(JContext ctx)
ctx
- - The JContext to release.public int getMinPoolSize()
public int getMaxCacheSize()
public int getCacheSize()
public boolean isReentrant()
public boolean isShared()
public java.lang.Object getDataSource()
public void checkTransaction(RequestCtx rctx) throws javax.transaction.SystemException
rctx
- The Request Contextpublic EntityCounters getEntityCounters()
public int calculateAutomaticPk()
protected JEntityContext createNewInstance() throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |