Java Doc for JEntityContext.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.JContext
      org.objectweb.jonas_ejb.container.JEntityContext

All known Subclasses:   org.objectweb.jonas_ejb.container.jorm.JEntityContext,
JEntityContext
public class JEntityContext extends JContext implements EntityContext,Synchronization(Code)
This class implements javax.ejb.EntityContext interface. An Entitycontext is bound to a bean instance. To be used, it must be associated to a JEntitySwitch, and possibly to a Transaction. In case the Context is used inside a Transaction, we use the Synchronization interface to be aware of transaction demarcations.
author:
   Philippe Coq, Philippe Durieux


Field Summary
 TransactionbeanCoord
    
 booleanismarkedremoved
    
 booleanisnewinstance
    

Constructor Summary
public  JEntityContext(JEntityFactory bf, EntityBean eb)
     Constructs an EntityContext the Context has to be initialized after this.

Method Summary
public  voidactivate(boolean doactivate)
     Activate instance.
public  voidafterCompletion(int status)
     This method is typically called after the transaction is committed.
public  voidbeforeCompletion()
    
public  voiddetachTx()
    
public  EJBLocalObjectget2EJBLocalObject()
     Obtain a reference to the EJB local object that is currently associated with the instance.
public  EJBLocalObjectgetEJBLocalObject()
     Obtain a reference to the EJB local object that is currently associated with the instance.
public  EJBObjectgetEJBObject()
     Obtains a reference to the EJB object that is currently associated with the instance.
public  JEntityFactorygetEntityFactory()
    
public  JEntitySwitchgetEntitySwitch()
    
public  EntityBeangetInstance()
    
public  TransactiongetMyTx()
    
public  ObjectgetPrimaryKey()
     Obtains the primary key of the EJB object that is currently associated with this instance.
public  TimerServicegetTimerService()
     Get access to the EJB Timer Service.
public  booleaninitEntityContext(JEntitySwitch bs)
    
public  booleanisDirty()
    
public  booleanisInitialized()
    
public  booleanisMarkedRemoved()
    
public  booleanisNewInstance()
    
public  booleanpassivate()
    
public  voidrazEntityContext()
     Raz Context before freeing it.
public  voidreuseEntityContext(boolean newtrans)
     reuse EntityContext for another transaction.
public  voidsetDirty(boolean d)
     Set the dirty flag: true = instance modified.
public  voidsetEntitySwitch(JEntitySwitch bs)
    
public  voidsetNewInstance()
    
public  voidsetRemoved()
     Mark this context as removed.
public  booleansetRunningTx(Transaction tx)
    
public  voidstoreIfModified()
    

Field Detail
beanCoord
Transaction beanCoord(Code)
Transaction related to this synchronization



ismarkedremoved
boolean ismarkedremoved(Code)
true between a remove and the commit



isnewinstance
boolean isnewinstance(Code)
true if just created in this transaction




Constructor Detail
JEntityContext
public JEntityContext(JEntityFactory bf, EntityBean eb)(Code)
Constructs an EntityContext the Context has to be initialized after this.
Parameters:
  bf - - the JEntityFactory
Parameters:
  eb - - the Enterprise Bean instance




Method Detail
activate
public void activate(boolean doactivate)(Code)
Activate instance.
Parameters:
  doactivate - True if ejbActivate() is called before ejbLoad()



afterCompletion
public void afterCompletion(int status)(Code)
This method is typically called after the transaction is committed.
Parameters:
  status - The status of the transaction completion.



beforeCompletion
public void beforeCompletion()(Code)
This method is typically called at beforeCompletion



detachTx
public void detachTx()(Code)
Detach this Context from tx



get2EJBLocalObject
public EJBLocalObject get2EJBLocalObject() throws IllegalStateException(Code)
Obtain a reference to the EJB local object that is currently associated with the instance. (internal use of getEJBLocalObject with no check). The EJB local object currently associated with the instance.
throws:
  IllegalStateException - - if the instance invokes this method whilethe instance is in a state that does not allow the instance toinvoke this method, or if the instance does not have a localinterface.



getEJBLocalObject
public EJBLocalObject getEJBLocalObject() throws IllegalStateException(Code)
Obtain a reference to the EJB local object that is currently associated with the instance. The EJB local object currently associated with the instance.
throws:
  IllegalStateException - - if the instance invokes this method whilethe instance is in a state that does not allow the instance toinvoke this method, or if the instance does not have a localinterface.



getEJBObject
public EJBObject getEJBObject() throws IllegalStateException(Code)
Obtains a reference to the EJB object that is currently associated with the instance. The EJB object currently associated with the instance.
throws:
  IllegalStateException - Thrown if the instance invokes this methodwhile the instance is in a state that does not allow the instanceto invoke this method.



getEntityFactory
public JEntityFactory getEntityFactory()(Code)
JEntityFactory accessor the JEntityFactory



getEntitySwitch
public JEntitySwitch getEntitySwitch()(Code)
JEntitySwitch accessor the JEntitySwitch



getInstance
public EntityBean getInstance() throws RemoteException(Code)
Returns the bean instance of this context Used in the generated classes to retrieve the instance the bean instance
throws:
  RemoteException - if no instance.



getMyTx
public Transaction getMyTx()(Code)
the transaction associated to this context.



getPrimaryKey
public Object getPrimaryKey() throws IllegalStateException(Code)
Obtains the primary key of the EJB object that is currently associated with this instance. The EJB object currently associated with the instance.
throws:
  IllegalStateException - Thrown if the instance invokes this methodwhile the instance is in a state that does not allow the instanceto invoke this method.



getTimerService
public TimerService getTimerService() throws IllegalStateException(Code)
Get access to the EJB Timer Service. the EJB Timer Service
throws:
  IllegalStateException - Thrown if the instance is not allowed touse this method



initEntityContext
public boolean initEntityContext(JEntitySwitch bs)(Code)
Reinit Context for reuse
Parameters:
  bs - - The Bean Switch this Context belongs to.



isDirty
public boolean isDirty()(Code)
true if instance has been modified



isInitialized
public boolean isInitialized()(Code)
True if Entity Switch has been already associated



isMarkedRemoved
public boolean isMarkedRemoved()(Code)
Check if context has been marked removed true when instance is marked removed.



isNewInstance
public boolean isNewInstance()(Code)
Check if context is a newly created instance true when instance has been created in the current transaction.



passivate
public boolean passivate()(Code)
passivate this instance true if passivated.



razEntityContext
public void razEntityContext()(Code)
Raz Context before freeing it. This is mainly for garbage collector.



reuseEntityContext
public void reuseEntityContext(boolean newtrans)(Code)
reuse EntityContext for another transaction. optimization: don't pass it by the pool.
Parameters:
  newtrans - true if new transaction



setDirty
public void setDirty(boolean d)(Code)
Set the dirty flag: true = instance modified.



setEntitySwitch
public void setEntitySwitch(JEntitySwitch bs)(Code)
set the EntitySwitch
Parameters:
  bs - - the EntitySwitch



setNewInstance
public void setNewInstance()(Code)
Set new instance flag



setRemoved
public void setRemoved() throws RemoteException, RemoveException(Code)
Mark this context as removed. Complete removing will be achieved at the end of the transaction.
throws:
  RemoteException - ejbRemove failed
throws:
  RemoveException - ejbRemove failed



setRunningTx
public boolean setRunningTx(Transaction tx)(Code)
Associate transaction to ths Context
Parameters:
  tx - true if correctly associated, false if was already done.



storeIfModified
public void storeIfModified()(Code)
Persistence: write data on storage



Fields inherited from org.objectweb.jonas_ejb.container.JContext
final protected JFactory bf(Code)(Java Doc)
int instanceState(Code)(Java Doc)
protected EnterpriseBean myinstance(Code)(Java Doc)
final protected TransactionManager tm(Code)(Java Doc)

Methods inherited from org.objectweb.jonas_ejb.container.JContext
public Identity getCallerIdentity()(Code)(Java Doc)
public Principal getCallerPrincipal() throws IllegalStateException(Code)(Java Doc)
public EJBHome getEJBHome() throws IllegalStateException(Code)(Java Doc)
public EJBLocalHome getEJBLocalHome() throws IllegalStateException(Code)(Java Doc)
public Properties getEnvironment()(Code)(Java Doc)
public boolean getRollbackOnly() throws IllegalStateException(Code)(Java Doc)
public int getState()(Code)(Java Doc)
abstract public TimerService getTimerService() throws IllegalStateException(Code)(Java Doc)
public UserTransaction getUserTransaction() throws IllegalStateException(Code)(Java Doc)
public WorkManager getWorkManager()(Code)(Java Doc)
public boolean isCallerInRole(Identity role)(Code)(Java Doc)
public boolean isCallerInRole(String roleName) throws IllegalStateException(Code)(Java Doc)
public void setRollbackOnly() throws IllegalStateException(Code)(Java Doc)
public void setState(int newState)(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.