01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: GenericQueryManagerListener.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.database.querymanagers.generic;
09:
10: /**
11: * The methods of a <code>GenericQueryManagerListener</code> will be executed
12: * as the corresponding actions are successfully executed through the
13: * <code>GenericQueryManager</code> that this listener is registered with.
14: * <p>The difference with <code>Callbacks</code> is that listeners are
15: * associated with a <code>GenericQueryManager</code> and
16: * <code>Callbacks</code> are associated with your domain model. Listeners
17: * are also only called as a notification mechanisms, they don't allow you to
18: * intervene in the execution flow. Listeners are called before 'after'
19: * callbacks.
20: *
21: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
22: * @version $Revision: 3634 $
23: * @see
24: * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager
25: * @see com.uwyn.rife.database.querymanagers.generic.Callbacks
26: * @since 1.5
27: */
28: public interface GenericQueryManagerListener<BeanType> {
29: /**
30: * Executed when the database structure has been successfully installed.
31: *
32: * @since 1.5
33: */
34: void installed();
35:
36: /**
37: * Executed when the database structure has been successfully removed.
38: *
39: * @since 1.5
40: */
41: void removed();
42:
43: /**
44: * Executed when a bean was successfully inserted.
45: *
46: * @param bean the bean that was inserted
47: * @since 1.5
48: */
49: void inserted(BeanType bean);
50:
51: /**
52: * Executed when a bean was successfully updated.
53: *
54: * @param bean the bean that was updated
55: * @since 1.5
56: */
57: void updated(BeanType bean);
58:
59: /**
60: * Executed when a bean was successfully restored.
61: *
62: * @param bean the bean that was restored
63: * @since 1.5
64: */
65: void restored(BeanType bean);
66:
67: /**
68: * Executed when a bean was successfully deleted.
69: *
70: * @param objectId the identifier of the bean that was deleted
71: * @since 1.5
72: */
73: void deleted(int objectId);
74: }
|