Java Doc for JtaEntityManagerRegistry.java in  » J2EE » openejb3 » org » apache » openejb » persistence » 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 » openejb3 » org.apache.openejb.persistence 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.openejb.persistence.JtaEntityManagerRegistry

JtaEntityManagerRegistry
public class JtaEntityManagerRegistry (Code)
The JtaEntityManagerRegistry tracks JTA entity managers for transation and extended scoped entity managers. A signle instance of this object should be created and shared by all JtaEntityManagers in the server instance. Failure to do this will result in multiple entity managers being created for a single persistence until, and that will result in cache incoherence.



Constructor Summary
public  JtaEntityManagerRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry)
     Creates a JtaEntityManagerRegistry using the specified transactionSynchronizationRegistry for the registry if transaction associated entity managers.

Method Summary
public  voidaddEntityManagers(String deploymentId, Object primaryKey, Map<EntityManagerFactory, EntityManager> entityManagers)
     Adds the entity managers for the specified component to the registry.
public  EntityManagergetEntityManager(EntityManagerFactory entityManagerFactory, Map properties, boolean extended)
     Gets an entity manager instance from the transaction registry, extended regitry or for a transaction scoped entity manager, creates a new one when an exisitng instance is not found.

It is important that a component adds extended scoped entity managers to this registry when the component is entered and removes them when exited.
public  EntityManagergetInheritedEntityManager(EntityManagerFactory entityManagerFactory)
     Gets an exiting extended entity manager created by a component down the call stack.
public  booleanisTransactionActive()
    
public  voidremoveEntityManagers(String deploymentId, Object primaryKey)
     Removed the registered entity managers for the specified component.
public  voidtransactionStarted(String deploymentId, Object primaryKey)
     Notifies the registry that a user transaction has been started or the specified component.


Constructor Detail
JtaEntityManagerRegistry
public JtaEntityManagerRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry)(Code)
Creates a JtaEntityManagerRegistry using the specified transactionSynchronizationRegistry for the registry if transaction associated entity managers.




Method Detail
addEntityManagers
public void addEntityManagers(String deploymentId, Object primaryKey, Map<EntityManagerFactory, EntityManager> entityManagers) throws EntityManagerAlreadyRegisteredException(Code)
Adds the entity managers for the specified component to the registry. This should be called when the component is entered.
Parameters:
  deploymentId - the id of the component
Parameters:
  entityManagers - the entity managers to register
throws:
  EntityManagerAlreadyRegisteredException - if an entity manager is already registered with the transactionfor one of the supplied entity manager factories; for EJBs this should be caught and rethown as an EJBException



getEntityManager
public EntityManager getEntityManager(EntityManagerFactory entityManagerFactory, Map properties, boolean extended) throws IllegalStateException(Code)
Gets an entity manager instance from the transaction registry, extended regitry or for a transaction scoped entity manager, creates a new one when an exisitng instance is not found.

It is important that a component adds extended scoped entity managers to this registry when the component is entered and removes them when exited. If this registration is not preformed, an IllegalStateException will be thrown when entity manger is fetched.
Parameters:
  entityManagerFactory - the entity manager factory from which an entity manager is required
Parameters:
  properties - the properties passed to the entity manager factory when an entity manager is created
Parameters:
  extended - is the entity manager an extended context the new entity manager
throws:
  IllegalStateException - if the entity manger is extended and there is not an existing entity managerinstance already registered



getInheritedEntityManager
public EntityManager getInheritedEntityManager(EntityManagerFactory entityManagerFactory)(Code)
Gets an exiting extended entity manager created by a component down the call stack.
Parameters:
  entityManagerFactory - the entity manager factory from which an entity manager is needed the existing entity manager or null if one is not found



isTransactionActive
public boolean isTransactionActive()(Code)
Is a transaction active? true if a transaction is active; false otherwise



removeEntityManagers
public void removeEntityManagers(String deploymentId, Object primaryKey)(Code)
Removed the registered entity managers for the specified component.
Parameters:
  deploymentId - the id of the component



transactionStarted
public void transactionStarted(String deploymentId, Object primaryKey)(Code)
Notifies the registry that a user transaction has been started or the specified component. When a transaction is started for a component with registered extended entity managers, the entity managers are enrolled in the transaction.
Parameters:
  deploymentId - the id of the component



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.