4.6. InstanceCallbacks

The above discussion about the required and optional states and state transitions should have given you a good feel for the way an application invokes the PersistenceManager in order to manipulate instances. We will look at this in more detail in Chapter 6. The final topic for this chapter illustrates how instances can be made aware of specific lifecycle events occurring to them, so that the application developer can invoke an appropriate action if required.

InstanceCallbacks is itself an interface containing four method signatures. Classes implementing the interface must provide implementations of the callback methods explicitly – the enhancer will not undertake this task. The JDO implementation will then invoke the callback ...

Get Java™ Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.