This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDO: Events ?  RSS feed

 
Rama Raghavan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While were are at it, thought I'd ask..
Are there a pre/post events that consumers can register for, and be notified, when the state of an object changes and is persisted ?
Is there any event model for JDO ?
 
David Jordan
Author
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, JDO has 4 events:
jdoPostLoad()
jdoPreClear()
jdoPreDelete()
jdoPreStore()
These are methods defined on an interface called InstanceCallbacks. If you want to execute some code when these events occur, you must declare your class implements InstanceCallbacks. These methods are called when the event occurs.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Jordan:
Yes, JDO has 4 events:
jdoPostLoad()
jdoPreClear()
jdoPreDelete()
jdoPreStore()
These are methods defined on an interface called InstanceCallbacks. If you want to execute some code when these events occur, you must declare your class implements InstanceCallbacks. These methods are called when the event occurs.

Now that is a nice Interface.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!