Java Doc for JEntityFactory.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_ejb » container » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » JOnAS 4.8.6 » org.objectweb.jonas_ejb.container 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jonas_ejb.container.JFactory
      org.objectweb.jonas_ejb.container.JEntityFactory

All known Subclasses:   org.objectweb.jonas_ejb.container.jorm.JormFactory,
JEntityFactory
public class JEntityFactory extends JFactory implements TimerService(Code)

author:
   coqp
author:
   TODO To change the template for this generated type comment go to
author:
   Window - Preferences - Java - Code Style - Code Templates


Field Summary
protected  Listbctxlist
    
protected  booleancmp2
    
protected  Objectdatasource
    
 Stringdsname
    
protected  booleanhardLimit
    
protected  JEntityHomehome
    
protected  intinstanceCount
    
protected  JEntityLocalHomelocalhome
    
protected  intlockPolicy
    
protected  booleanprefetch
    
protected  intreadTimeout
     Number of seconds before reading again instances for read-only.
protected  booleanreentrant
    
protected  booleanshared
     shared if the EJB container is not the only one to modify the bean state on the database, or if a cluster of container access the bean concurrently.
protected  HashMaptxlist
     List of Transaction Listeners.

Constructor Summary
public  JEntityFactory()
    

Method Summary
public synchronized  voidbindEJB(Object pk, JEntitySwitch bs)
    
public  intcalculateAutomaticPk()
    
public  voidcheckTransaction(RequestCtx rctx)
     Check Transaction before calling a method on a bean.
protected  JEntityContextcreateNewContext(EntityBean bean)
    
protected  JEntityContextcreateNewInstance(JEntitySwitch es)
     Create a new instance of the bean and its EntityContext In case of CMP, the bean class is derived to manage entity persistence.
public  TimercreateTimer(long arg0, Serializable arg1)
    
public  TimercreateTimer(long arg0, long arg1, Serializable arg2)
    
public  TimercreateTimer(Date arg0, Serializable arg1)
    
public  TimercreateTimer(Date arg0, long arg1, Serializable arg2)
    
public  SerializabledecodePK(Serializable strpk)
     Decode PK.
public  booleandirtyInstances()
    
public  voiddummyFinderException(boolean dummy)
    
public  SerializableencodePK(Serializable pk)
     Encode PK.
public synchronized  JEntitySwitchexistEJB(Object pk, JEntitySwitch bs)
     get EJB by its PK.
public  intgetCacheSize()
    
public  intgetCurrentWaiters()
    
public  ObjectgetDataSource()
    
public  intgetDeadlockTimeout()
    
public synchronized  JEntitySwitchgetEJB(Object pk)
     get EJB by its PK Creates if not exist yet.
public synchronized  EntityCountersgetEntityCounters()
    
public  JHomegetHome()
    
public  intgetInactivityTimeout()
    
public  JEntityContextgetJContext(JEntitySwitch es)
     Get a Context from the pool, or create a new one if no more available in the pool.
public  JEntitySwitchgetJEntitySwitch()
     This method allocates a new JEntitySwitch.
public  JLocalHomegetLocalHome()
    
public  intgetLockPolicy()
    
public  intgetMaxWaitTime()
    
public  intgetPassivationTimeout()
    
public  intgetPoolSize()
    
public  intgetReadTimeout()
    
public  booleangetSelectForUpdate()
    
public  TimerServicegetTimerService()
    
public  CollectiongetTimers()
    
public  voidinit(EntityDesc dd, JContainer cont)
    
public  voidinitInstancePool()
    
public  booleanisCMP2()
    
public  booleanisDeadLocked(Transaction suspect)
    
public  booleanisHardLimit()
    
public  booleanisPrefetch()
    
public  booleanisReentrant()
    
public  booleanisShared()
    
public  booleanrebindEJB(Transaction tx, JEntityContext bctx, Object pk)
    
public  voidreduceCache()
    
public  booleanregisterContext(Transaction tx, JEntityContext ec)
     Register a Context/Instance in the transaction.
public synchronized  voidregisterEJB(JEntitySwitch ejb)
     Register an EntitySwitch in the dirty list.
public  voidreleaseJContext(JContext ctx, int poolaction)
    
public  voidreleaseJContext(JContext ctx)
    
public synchronized  voidremoveEJB(Object pk)
    
public  voidremoveTxListener(Transaction tx)
     Remove a Transaction Listener from the list.
public  voidsetDeadlockTimeout(int i)
    
public  voidsetInactivityTimeout(int i)
    
public  voidsetMaxWaitTime(int sec)
    
public  voidsetPassivationTimeout(int i)
    
public  voidstop()
     stop this EJB.
public  voidstoreInstances(Transaction tx)
    
public  voidsyncDirty(boolean alwaysStore)
     Synchronize all dirty instances Does nothing if not CS policy.
public  voidsyncForFind(Transaction tx)
     synchronize data modified in this transaction.
public  voidsyncForSelect()
     synchronize data modified in the current transaction.
public  voidsynchronizeEntities()
    
public  booleantooManyInstances()
    
public  voidunregisterContext(Transaction tx, JEntityContext ec)
     Unregister a Context/Instance in the transaction.

Field Detail
bctxlist
protected List bctxlist(Code)
freelist of JEntityContext's



cmp2
protected boolean cmp2(Code)
True if CMP2 container



datasource
protected Object datasource(Code)
Datasource in case of CMP



dsname
String dsname(Code)
datasource name



hardLimit
protected boolean hardLimit(Code)
True if cannot overtake max-cache-size



home
protected JEntityHome home(Code)
optional home



instanceCount
protected int instanceCount(Code)
Current number of instances in memory



localhome
protected JEntityLocalHome localhome(Code)
optional local home



lockPolicy
protected int lockPolicy(Code)
lock policy



prefetch
protected boolean prefetch(Code)
enable the prefetch for CMP2 bean



readTimeout
protected int readTimeout(Code)
Number of seconds before reading again instances for read-only.



reentrant
protected boolean reentrant(Code)
reentrant if instance can be used concurrently



shared
protected boolean shared(Code)
shared if the EJB container is not the only one to modify the bean state on the database, or if a cluster of container access the bean concurrently.



txlist
protected HashMap txlist(Code)
List of Transaction Listeners. At each Transaction is associated a TxListener object




Constructor Detail
JEntityFactory
public JEntityFactory()(Code)
constructor must be without parameters (required by Jorm)




Method Detail
bindEJB
public synchronized void bindEJB(Object pk, JEntitySwitch bs)(Code)
Bind a PK with a JEntitySwitch
Parameters:
  pk - The Primary Key Object
Parameters:
  bs - The JEntitySwitch



calculateAutomaticPk
public int calculateAutomaticPk()(Code)
Calculate a new uid for automatic pk creation Used by JEntityCmpJdbc.vm int (unique pk)



checkTransaction
public void checkTransaction(RequestCtx rctx)(Code)
Check Transaction before calling a method on a bean. For Entity beans, the only possible case is "Container Managed Tx"
Parameters:
  rctx - The Request Context



createNewContext
protected JEntityContext createNewContext(EntityBean bean)(Code)



createNewInstance
protected JEntityContext createNewInstance(JEntitySwitch es) throws Exception(Code)
Create a new instance of the bean and its EntityContext In case of CMP, the bean class is derived to manage entity persistence. JEntityContext
throws:
  Exception - cannot instantiate bean



createTimer
public Timer createTimer(long arg0, Serializable arg1) throws IllegalArgumentException, IllegalStateException, EJBException(Code)
Illegal operation: timers are associated with a PK
See Also:   javax.ejb.TimerService.createTimer(longjava.io.Serializable)



createTimer
public Timer createTimer(long arg0, long arg1, Serializable arg2) throws IllegalArgumentException, IllegalStateException, EJBException(Code)
Illegal operation: timers are associated with a PK /* (non-Javadoc)
See Also:   javax.ejb.TimerService.createTimer(longlongjava.io.Serializable)



createTimer
public Timer createTimer(Date arg0, Serializable arg1) throws IllegalArgumentException, IllegalStateException, EJBException(Code)
Illegal operation: timers are associated with a PK
See Also:   javax.ejb.TimerService.createTimer(java.util.Datejava.io.Serializable)



createTimer
public Timer createTimer(Date arg0, long arg1, Serializable arg2) throws IllegalArgumentException, IllegalStateException, EJBException(Code)
Illegal operation: timers are associated with a PK
See Also:   javax.ejb.TimerService.createTimer(java.util.Datelongjava.io.Serializable)



decodePK
public Serializable decodePK(Serializable strpk)(Code)
Decode PK. This does nothing, except in case of CMP2 PK matching the String



dirtyInstances
public boolean dirtyInstances()(Code)
true if dirty list is not emptyOnly used for CS policy (non transacted modifying methods)



dummyFinderException
public void dummyFinderException(boolean dummy) throws FinderException(Code)
Dummy method that defines the FinderException in the throws clause to can catch this exception in any case in the JentityHome.vm
Parameters:
  dummy - if true do nothing, else throw the FinderException
throws:
  FinderException - if dummy is false



encodePK
public Serializable encodePK(Serializable pk)(Code)
Encode PK. This does nothing, except in case of CMP2 String representation of the PK



existEJB
public synchronized JEntitySwitch existEJB(Object pk, JEntitySwitch bs)(Code)
get EJB by its PK. If not exist yet, map the EntitySwitch to the PK.
Parameters:
  pk - The Primary Key Object
Parameters:
  bs - the Entityswitch The JEntitySwitch matching the PK, or null if none exist.



getCacheSize
public int getCacheSize()(Code)
current cache size



getCurrentWaiters
public int getCurrentWaiters()(Code)
current number of instance waiters



getDataSource
public Object getDataSource()(Code)
the Datasource used for CMP



getDeadlockTimeout
public int getDeadlockTimeout()(Code)
deadlock timeout in sec.



getEJB
public synchronized JEntitySwitch getEJB(Object pk)(Code)
get EJB by its PK Creates if not exist yet.
Parameters:
  pk - The Primary Key Object The JEntitySwitch matching the PK.



getEntityCounters
public synchronized EntityCounters getEntityCounters()(Code)
Take a dump of current entity counters and return them EntityCounters



getHome
public JHome getHome()(Code)
the home if it exists



getInactivityTimeout
public int getInactivityTimeout()(Code)
inactivity timeout in sec.



getJContext
public JEntityContext getJContext(JEntitySwitch es)(Code)
Get a Context from the pool, or create a new one if no more available in the pool. This JContext must be initialized then by the caller. a JEntityContext, not initialized.



getJEntitySwitch
public JEntitySwitch getJEntitySwitch()(Code)
This method allocates a new JEntitySwitch. But no association has been done between the primary key and the new JEntitySwitch. Therefore the initialisation is not done. The JEntitySwitch.



getLocalHome
public JLocalHome getLocalHome()(Code)
the local home if it exists



getLockPolicy
public int getLockPolicy()(Code)
lockPolicy



getMaxWaitTime
public int getMaxWaitTime()(Code)
waiter timeout in seconds



getPassivationTimeout
public int getPassivationTimeout()(Code)
passivation timeout in sec.



getPoolSize
public int getPoolSize()(Code)
the Instance pool size for this Ejb



getReadTimeout
public int getReadTimeout()(Code)
read timeout in sec.



getSelectForUpdate
public boolean getSelectForUpdate()(Code)
true if the bean is shared



getTimerService
public TimerService getTimerService()(Code)
Obtains the TimerService associated for this Bean a JTimerService instance.



getTimers
public Collection getTimers() throws IllegalStateException, EJBException(Code)
Illegal operation: timers are associated with a PK
See Also:   javax.ejb.TimerService.getTimers



init
public void init(EntityDesc dd, JContainer cont)(Code)
Init this object
Parameters:
  dd - the deployment descriptor
Parameters:
  cont - the Container



initInstancePool
public void initInstancePool()(Code)
Init the pool of instances



isCMP2
public boolean isCMP2()(Code)
true if CMP2 container



isDeadLocked
public boolean isDeadLocked(Transaction suspect)(Code)
Search if this transaction is blocked in a deadlock
Parameters:
  suspect - Transaction suspected to block everybody True if a deadlock has been detected.



isHardLimit
public boolean isHardLimit()(Code)
true if hard limit for max-cache-size



isPrefetch
public boolean isPrefetch()(Code)
true if prefetch enable



isReentrant
public boolean isReentrant()(Code)
true if reentrant



isShared
public boolean isShared()(Code)
true if shared



rebindEJB
public boolean rebindEJB(Transaction tx, JEntityContext bctx, Object pk)(Code)
rebind a PK with a JEntitySwitch (called by create methods)
Parameters:
  tx - current Transaction
Parameters:
  bctx - The EntityContext
Parameters:
  pk - The Primary Key Object true if bs has been added to the PK list.



reduceCache
public void reduceCache()(Code)
Reduce number of instances in memory passivate all instances that are not busy and not used very recently



registerContext
public boolean registerContext(Transaction tx, JEntityContext ec) throws IllegalStateException(Code)
Register a Context/Instance in the transaction.
Parameters:
  tx - current Transaction
Parameters:
  ctx - JEntityContext to be registered true if instance has been registered.



registerEJB
public synchronized void registerEJB(JEntitySwitch ejb)(Code)
Register an EntitySwitch in the dirty list. should be called each time a new instance is modified outside transaction
Parameters:
  ejb - The Entity Switch to be registered



releaseJContext
public void releaseJContext(JContext ctx, int poolaction)(Code)
Release a Context
Parameters:
  ctx - - The JContext to release.
Parameters:
  poolaction - 0=never pool, 1=pool if < MinPoolSize, 2=pool if < MaxCacheSize



releaseJContext
public void releaseJContext(JContext ctx)(Code)
Release a Context [deprecated]
Parameters:
  ctx - - The JContext to release.



removeEJB
public synchronized void removeEJB(Object pk)(Code)
remove an EJB by its PK
Parameters:
  pk - The Primary Key Object



removeTxListener
public void removeTxListener(Transaction tx)(Code)
Remove a Transaction Listener from the list.
Parameters:
  tx - the Transaction to remove



setDeadlockTimeout
public void setDeadlockTimeout(int i)(Code)
Set the deadlock timeout (jonas admin) Not used today



setInactivityTimeout
public void setInactivityTimeout(int i)(Code)
Set the inactivity timeout (jonas admin) Not used today



setMaxWaitTime
public void setMaxWaitTime(int sec)(Code)

Parameters:
  sec - max time to wait for a connection, in seconds



setPassivationTimeout
public void setPassivationTimeout(int i)(Code)
Set the passivation timeout (jonas admin) Not used today



stop
public void stop()(Code)
stop this EJB. Mainly unregister it in JNDI.



storeInstances
public void storeInstances(Transaction tx)(Code)
For storing entities modified in tx
Parameters:
  tx - current transaction
See Also:   org.objectweb.jonas_ejb.container.BeanFactory.storeInstances(javax.transaction.Transaction)



syncDirty
public void syncDirty(boolean alwaysStore)(Code)
Synchronize all dirty instances Does nothing if not CS policy.
Parameters:
  alwaysStore - True if we want to store modify instanceseven if passivation timeout is not reached.



syncForFind
public void syncForFind(Transaction tx)(Code)
synchronize data modified in this transaction. this is necessary in case of finder method, because ejb-ql looks for on disk.
Parameters:
  tx - the Transaction



syncForSelect
public void syncForSelect()(Code)
synchronize data modified in the current transaction. this is necessary in case of select method, because ejb-ql looks for on disk.



synchronizeEntities
public void synchronizeEntities()(Code)
Ask swapper to synchronize all dirty EntitySwitch Only used for container-serialized policy



tooManyInstances
public boolean tooManyInstances()(Code)
true if max-cache-size has been reached



unregisterContext
public void unregisterContext(Transaction tx, JEntityContext ec) throws IllegalStateException(Code)
Unregister a Context/Instance in the transaction.
Parameters:
  tx - current Transaction
Parameters:
  ctx - JEntityContext to be registered



Fields inherited from org.objectweb.jonas_ejb.container.JFactory
protected Context JNDICtx(Code)(Java Doc)
protected Class beanclass(Code)(Java Doc)
protected JContainer cont(Code)(Java Doc)
protected BeanDesc dd(Code)(Java Doc)
protected Properties ejb10Env(Code)(Java Doc)
protected String ejbTimeoutSignature(Code)(Java Doc)
protected String ejbname(Code)(Java Doc)
protected boolean isClusterReplicated(Code)(Java Doc)
protected int maxCacheSize(Code)(Java Doc)
protected int minPoolSize(Code)(Java Doc)
protected TimerService myTimerService(Code)(Java Doc)
protected ContainerNaming naming(Code)(Java Doc)
protected File passivationDir(Code)(Java Doc)
protected boolean stopped(Code)(Java Doc)
protected int timerTxAttr(Code)(Java Doc)
protected TransactionManager tm(Code)(Java Doc)
protected boolean txbeanmanaged(Code)(Java Doc)
protected WorkManager wm(Code)(Java Doc)

Methods inherited from org.objectweb.jonas_ejb.container.JFactory
protected void checkJonasVersion(String clName)(Code)(Java Doc)
public void checkSecurity(EJBInvocation ejbInv)(Code)(Java Doc)
abstract void checkTransaction(RequestCtx rctx)(Code)(Java Doc)
protected void checkTransactionContainer(RequestCtx rctx)(Code)(Java Doc)
public int getCacheSize()(Code)(Java Doc)
public JContainer getContainer()(Code)(Java Doc)
public BeanDesc getDeploymentDescriptor()(Code)(Java Doc)
public String getEJBName()(Code)(Java Doc)
public Properties getEjb10Environment()(Code)(Java Doc)
public String getEjbTimeoutSignature()(Code)(Java Doc)
public Hashtable getEnv()(Code)(Java Doc)
public InitialContext getInitialContext()(Code)(Java Doc)
public int getMaxCacheSize()(Code)(Java Doc)
public int getMinPoolSize()(Code)(Java Doc)
public File getPassivationDir()(Code)(Java Doc)
abstract public int getPoolSize()(Code)(Java Doc)
abstract public TimerService getTimerService()(Code)(Java Doc)
public int getTimerTxAttribute()(Code)(Java Doc)
public TransactionManager getTransactionManager()(Code)(Java Doc)
public WorkManager getWorkManager()(Code)(Java Doc)
public void init(BeanDesc dd, JContainer cont)(Code)(Java Doc)
abstract public void initInstancePool()(Code)(Java Doc)
protected boolean isClassAvailable(String className, boolean unique)(Code)(Java Doc)
public boolean isStopped()(Code)(Java Doc)
public boolean isTxBeanManaged()(Code)(Java Doc)
public ClassLoader myClassLoader()(Code)(Java Doc)
public void postInvoke(RequestCtx rctx)(Code)(Java Doc)
public void postInvokeRemote(RequestCtx rctx) throws RemoteException(Code)(Java Doc)
public RequestCtx preInvoke(int txa)(Code)(Java Doc)
public RequestCtx preInvokeRemote(int txa) throws RemoteException(Code)(Java Doc)
public void resetComponentContext(Context oldctx)(Code)(Java Doc)
public void restartTimers()(Code)(Java Doc)
public Context setComponentContext()(Code)(Java Doc)
public void stopContainer()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.