ObjectDB ObjectDB

addInstanceLifecycleListener(listener, classes) - JDO PersistenceManagerFactory's method

void addInstanceLifecycleListener(
  InstanceLifecycleListener listener,
  Class[] classes

Add the parameter listener to the list of instance lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory. The addInstanceLifecycleListener and removeInstanceLifecycleListener methods are considered to be configuration methods and can only be called when the PersistenceManagerFactory is configurable (before the first time getPersistenceManager is called).

The classes parameter identifies all of the classes of interest. If the classes parameter is specified as null, events for all persistent classes and interfaces will be sent to the listener.

The listener will be called for each event for which it implements the corresponding InstanceLifecycleListener interface.

listener - the lifecycle listener
classes - the classes of interest to the listener
JDO 2.0