Java Doc for GenClassImpl.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_ejb » container » jorm » 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.jorm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jonas_ejb.container.jorm.GenClassImpl

All known Subclasses:   org.objectweb.jonas_ejb.container.jorm.Collection,  org.objectweb.jonas_ejb.container.jorm.Set,
GenClassImpl
abstract public class GenClassImpl implements PGenClassAccessor(Code)
This class is a basic implementation of the PGenClassAccessor interface usefull for the multivalued relation.
author:
   S.Chassande-Barrioz

Inner Class :protected class ElementIterator implements Iterator

Field Summary
protected  int[]deletedLength
     This array represents the distance between two deleted elements in the pIndexedElems arraylist.
protected  org.objectweb.jonas_ejb.container.JEntityContextectx
    
protected  PClassMappinggcm
     This field references the PClassMapping which manages the persistency of this GenClass.
protected  booleanisModified
    
protected  GenClassListenerlistener
     All the actions are send to this listener. There is 1 Listener for each GenClass, i.e.
protected  ArrayListpIndexedElems
    
protected  PBindingpb
     This fields is the PBinding associated to this instance.
protected  booleanselectForUpdate
     true when we want use select ..
protected  intsize
     This is the size of the relation.

Constructor Summary
public  GenClassImpl()
     A GenClassImpl object is created for each Multi-Valued CMR field See JEntityCmp2.vm It starts with an empty list.

Method Summary
public  PIndexedElemcreatePIndexedElem()
     The default implementation of the PIndexedElem is GenClassElement.
protected  voidgcAdd(PObject element, boolean callListener)
     This method add a new element in the collection.
public  voidgcClear(boolean delete)
     Clear the GenClass.
protected  booleangcContains(PObject element, Object connection)
    
protected  PObjectgcDeref(PName pn)
    
protected  PObjectgcGetElement(GenClassElement gce, Object connection)
     It dereferences an element if needed
Parameters:
  gce - is the PIndexedElem which must be dereferenced
Parameters:
  connection - a connection to use to resolve the PName.
public  PBindinggcGetPBinding()
    
protected  intgcGetRealIndex(int idx)
     This method calculates the real index of an element.
public  intgcGetSize()
    
public  booleangcIsModified()
    
protected  IteratorgcIterator()
    
protected  IteratorgcIterator(Object connection)
    
Parameters:
  connection - the connection to use during the PName resolving (if it has notalready dereferenced).
protected  PNamegcObject2ref(PObject value)
     This method permits to find the PName of an object.
protected  ObjectgcRemove(Object element, boolean callListener)
     It removes the first occurence of an element from the relation.
public  GenClassListenergetListener()
    
public  ObjectgetMemoryInstance()
     In most of cases this class is extented to personalize to a collection type.
public  voidpaAdd(PIndexedElem elem, Object conn)
     It adds the elements in the list.
public  booleanpaDeltaSupported()
     This implementation is able to isolate the modification by element of the gen class.
public  intpaGetNbElem()
     This method is used by the PBinding to allocated data structure during a write operation.
public  IteratorpaIterator()
     This method is used by the PBinding to fetch all PIndexedElem.
public  voidpaSetNbElem(int nbelem)
     This method is call in first during a read operation in order to indicate the size of the gen class.
public  voidprintState()
    
public  voidread(PName pn, Object connection, Object tx)
     It loads the data of the gen class.
Parameters:
  pn - is the PName of the genclass
Parameters:
  connection - is a connection to access to the support.
public  voidreset()
     reset the GenClass to its initial state.
public  voidsetEntityContext(org.objectweb.jonas_ejb.container.JEntityContext ectx)
    
public  voidsetListener(GenClassListener gcl)
    
public  voidsetPBinding(PBinding pb)
    
public  voidsetPClassMapping(PClassMapping gcm)
     Set the PClassMapping for this GenClass.
public  voidwrite(PName pn, Object connection)
     It writes the data of the gen class if it was modified (see the field isModified).
Parameters:
  pn - is the PName of the genclass
Parameters:
  connection - is a connection to access to the support.

Field Detail
deletedLength
protected int[] deletedLength(Code)
This array represents the distance between two deleted elements in the pIndexedElems arraylist. O means there is no element in the middle. The first element is in fact the quantity of existing element before the first deleted element. The size of this array is also the quantity of deleted elements. Then if the array is empty there is no deleted elements. for example: if this fields is equals to [3, 2] then the elements whith the index 3 and 6 are marked as deleted: [a, b, c, D, d, e, D, ....] This array is useless to convert an index valid inside the user/virtual collection to an index valid inside the 'pIndexedElems' ArrayList.



ectx
protected org.objectweb.jonas_ejb.container.JEntityContext ectx(Code)



gcm
protected PClassMapping gcm(Code)
This field references the PClassMapping which manages the persistency of this GenClass. (xxxGCM.java) This is actually a GenClassMapping, returned by the bean Factory (PClassMapping)



isModified
protected boolean isModified(Code)
true when GenClass has been modified and must be written



listener
protected GenClassListener listener(Code)
All the actions are send to this listener. There is 1 Listener for each GenClass, i.e. for each multi-valued CMR field. (See JEntityCmp2.vm) Used mainly for coherence.



pIndexedElems
protected ArrayList pIndexedElems(Code)
All elements of the gen class (unmodified, modified, created, deleted) This ArrayList contains GenClassElem objects



pb
protected PBinding pb(Code)
This fields is the PBinding associated to this instance.



selectForUpdate
protected boolean selectForUpdate(Code)
true when we want use select .. for ..update



size
protected int size(Code)
This is the size of the relation. This field is equal to the pIndexedElems size minus the quantity of deleted element. The value is always right and is updated during each delete or create action.




Constructor Detail
GenClassImpl
public GenClassImpl()(Code)
A GenClassImpl object is created for each Multi-Valued CMR field See JEntityCmp2.vm It starts with an empty list.




Method Detail
createPIndexedElem
public PIndexedElem createPIndexedElem()(Code)
The default implementation of the PIndexedElem is GenClassElement. This method may be redefined for different GenClass implementations.



gcAdd
protected void gcAdd(PObject element, boolean callListener)(Code)
This method add a new element in the collection. A PIndexedElem is built via the 'createPIndexedElem' method. Then this instance is initialized with the element and the staus specified by the parameter 'status'. Before added the element, a checking is done. If the element was previously removed in the same transaction then the status of the removed element is changed to ELEM_UNMODIFIED. This optimization avoid two useless I/O.
Parameters:
  element - the object to add
Parameters:
  callListener - indicates if the gen class listener must be callabout this action



gcClear
public void gcClear(boolean delete)(Code)
Clear the GenClass.
Parameters:
  delete - true if cascade delete must be checked (ONE - MANY)



gcContains
protected boolean gcContains(PObject element, Object connection) throws PException(Code)



gcDeref
protected PObject gcDeref(PName pn)(Code)



gcGetElement
protected PObject gcGetElement(GenClassElement gce, Object connection) throws PException(Code)
It dereferences an element if needed
Parameters:
  gce - is the PIndexedElem which must be dereferenced
Parameters:
  connection - a connection to use to resolve the PName. If this parameter isnull a new connection is allocate via the mapper.This connection is closed just after its use. a reference to the bean (The local interface in fact).



gcGetPBinding
public PBinding gcGetPBinding()(Code)
Get the PBinding used for this GenClass Used by JEntityCmp2.vm The PBinding for this GenClass



gcGetRealIndex
protected int gcGetRealIndex(int idx)(Code)
This method calculates the real index of an element.
Parameters:
  idx - the index valid in the colllection an index valid into the 'pIndexedElems' ArrayList.



gcGetSize
public int gcGetSize()(Code)



gcIsModified
public boolean gcIsModified()(Code)



gcIterator
protected Iterator gcIterator() throws PException(Code)



gcIterator
protected Iterator gcIterator(Object connection) throws PException(Code)

Parameters:
  connection - the connection to use during the PName resolving (if it has notalready dereferenced). an Iterator over the virtual relations (only the existing elements).



gcObject2ref
protected PName gcObject2ref(PObject value) throws PException(Code)
This method permits to find the PName of an object.



gcRemove
protected Object gcRemove(Object element, boolean callListener) throws PException(Code)
It removes the first occurence of an element from the relation.
Parameters:
  element - an element which must be removed
Parameters:
  callListener - indicates if the gen class listener must be callabout this action the remove element



getListener
public GenClassListener getListener()(Code)



getMemoryInstance
public Object getMemoryInstance()(Code)
In most of cases this class is extented to personalize to a collection type. Then an instance of this class is often the real collection.



paAdd
public void paAdd(PIndexedElem elem, Object conn) throws PException(Code)
It adds the elements in the list. This method is used by the PBinding to load the data. The elements is added at the end of the 'pIndexedElems' then 'deletedLength' is not impacted.



paDeltaSupported
public boolean paDeltaSupported()(Code)
This implementation is able to isolate the modification by element of the gen class.



paGetNbElem
public int paGetNbElem()(Code)
This method is used by the PBinding to allocated data structure during a write operation. The returned size must then contains also the deleted elements.



paIterator
public Iterator paIterator()(Code)
This method is used by the PBinding to fetch all PIndexedElem.



paSetNbElem
public void paSetNbElem(int nbelem)(Code)
This method is call in first during a read operation in order to indicate the size of the gen class. if the value is equals to -1 then that means the data support is unable to known the size of the relation in advance. Then the previous size is kept. Otherwise the list is initialized to the specified size.



printState
public void printState()(Code)



read
public void read(PName pn, Object connection, Object tx) throws PException(Code)
It loads the data of the gen class.
Parameters:
  pn - is the PName of the genclass
Parameters:
  connection - is a connection to access to the support. If it is nulla connection is asked to the mapper and closed after its use.



reset
public void reset()(Code)
reset the GenClass to its initial state.



setEntityContext
public void setEntityContext(org.objectweb.jonas_ejb.container.JEntityContext ectx)(Code)
Set the EntityContext needed for setDirty calls



setListener
public void setListener(GenClassListener gcl)(Code)



setPBinding
public void setPBinding(PBinding pb)(Code)
Set the PBinding that will be used for this GenClass Used by JEntityCmp2.vm
Parameters:
  pb - The PBinding for this GenClass



setPClassMapping
public void setPClassMapping(PClassMapping gcm)(Code)
Set the PClassMapping for this GenClass. It's needed to get Connections for read and write operations. Used by JEntityCmp2.vm
Parameters:
  gcm - the PClassMapping



write
public void write(PName pn, Object connection) throws PException(Code)
It writes the data of the gen class if it was modified (see the field isModified).
Parameters:
  pn - is the PName of the genclass
Parameters:
  connection - is a connection to access to the support. If it is nulla connection is asked to the mapper and closed after its use.



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.