EJB.9.5 Object Interaction Diagrams


This section uses object interaction diagrams to illustrate the interactions between an entity bean instance and its container.

EJB.9.5.1 Notes

The object interaction diagrams illustrate a box labeled "container-provided classes." These classes are either part of the container or are generated by the container tools. These classes communicate with each other through protocols that are container implementation specific. Therefore, the communication between these classes is not shown in the diagrams.

The classes shown in the diagrams should be considered as an illustrative implementation rather than as a prescriptive one.

EJB.9.5.2 Creating an Entity Object

See Figures EJB.9-6 and EJB.9-7 for the creation of an entity object with bean-managed and container-managed persistence.

Figure EJB.9-6. OID of Creation of an Entity Object with Bean-Managed Persistence

Figure EJB.9-7. OID of Creation of an Entity Object with Container-Managed Persistence

EJB.9.5.3 Passivating and Activating an Instance in a Transaction

See Figures EBJ.9-8 and EBJ.9-9 for the passivation and reactivation of unity bean instance with bean-managed persistence and CMP.

Figure EJB.9-8. OID of Passivation and Reactivation of an Entity Bean Instance with Bean-Managed Persistence

Figure EJB.9-9. OID of Passivation and Reactivation of an Entity Bean Instance with CMP

EJB.9.5.4 Committing a Transaction

See Figures EJB.9-10 and EJB.9-11 for the OID of transaction commit protocol for an entity bean instance with bean-managed persistence and container-managed persistence.

Figure EJB.9-10. OID of Transaction Commit Protocol for an Entity Bean Instance with Bean-Managed Persistence

Figure EJB.9-11. OID of Transaction Commit Protocol for an Entity Bean Instance with Container-Managed Persistence

EJB.9.5.5 Starting the Next Transaction

Figure EJB.9-12 illustrates the protocol performed for an entity bean instance with bean-managed persistence at the beginning of a new transaction. The three options illustrated in the diagram correspond to the three commit options in the previous subsection. Figure EJB.9-13 illustrates the same with container-managed persistence.

Figure EJB.9-12. OID of Start of Transaction for an Entity Bean Instance with Bean-Managed Persistence

Figure EJB.9-13. OID of Start of Transaction for an Entity Bean Instance with Container-Managed Persistence

EJB.9.5.6 Removing an Entity Object

See Figures EJB.9-14 and EJB.9-15 for the OID removal of an entity bean object with bean-managed and container-managed persistence.

Figure EJB.9-14. OID of Removal of an Entity Bean Object with Bean-Managed Persistence

Figure EJB.9-15. OID of Removal of an Entity Bean Object with Container-Managed Persistence

EJB.9.5.7 Finding an Entity Object

See Figures EJB.9-16 and EJB.9-17 for the OID of execution of a finder method on an entity bean instance with bean-managed and container-managed persistence.

Figure EJB.9-16. OID of Execution of a Finder Method on an Entity Bean Instance with Bean-Managed Persistence

Figure EJB.9-17. OID of Execution of a Finder Method on an Entity Bean Instance with Container-Managed Persistence

EJB.9.5.8 Adding and Removing an Instance from the Pool

The diagrams in Sections EJB.9.5.2 through EJB.9.5.7 did not show the sequences between the "does not exist" and "pooled" state (see the diagram in Section EJB.9.1.4). See Figures EJB.9-18 and EJB.9-19 for the OID of a container adding and removing an instance to the pool.

Figure EJB.9-18. OID of a Container Adding an Instance to the Pool

Figure EJB.9-19. OID of a Container Removing an Instance from the Pool



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net