Source Code Cross Referenced for Callbacks.java in  » Web-Framework » rife-1.6.1 » com » uwyn » rife » database » querymanagers » generic » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » rife 1.6.1 » com.uwyn.rife.database.querymanagers.generic 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003:         * Distributed under the terms of either:
004:         * - the common development and distribution license (CDDL), v1.0; or
005:         * - the GNU Lesser General Public License, v2.1 or later
006:         * $Id: Callbacks.java 3634 2007-01-08 21:42:24Z gbevin $
007:         */
008:        package com.uwyn.rife.database.querymanagers.generic;
009:
010:        /**
011:         * Callbacks are hooks that are being called when beans are manipulated
012:         * through the {@link
013:         * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager} or other
014:         * query managers that are based on it ({@link
015:         * com.uwyn.rife.cmf.dam.ContentQueryManager}, for instance). They can either
016:         * be implemented directly by implementing this interface, or they can be
017:         * provided by a bean by implementing the {@link
018:         * com.uwyn.rife.database.querymanagers.generic.CallbacksProvider} interface.
019:         * <p>This can for example be used to delete associated and dependent objects
020:         * when delete is called (by implementing {@link #beforeDelete(int)}), or to
021:         * clear a cache when an object has been modified (by implementing {@link
022:         * #afterSave(Object, boolean)} and {@link #afterDelete(int, boolean)}).
023:         * <p>The return value of callbacks can be used to cancel actions. When the
024:         * <code>before*</code> callbacks return <code>false</code>, the associated
025:         * actions are cancelled. When the <code>after*</code> callbacks return
026:         * <code>false</code>, the execution of the action is interrupted at that step
027:         * and no further callbacks will be called.
028:         * 
029:         * @author Geert Bevin (gbevin[remove] at uwyn dot com)
030:         * @version $Revision: 3634 $
031:         * @see com.uwyn.rife.database.querymanagers.generic.GenericQueryManager
032:         * @since 1.0
033:         */
034:        public interface Callbacks<BeanType> {
035:            /**
036:             * Is called before {@link
037:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#validate(Validated)}.
038:             * 
039:             * @param object the bean instance that will be validated
040:             * @return <code>true</code> if the execution should continue as normal;
041:             * or
042:             * <p><code>false</code> if the execution should be interrupted
043:             * @since 1.3
044:             */
045:            public boolean beforeValidate(BeanType object);
046:
047:            /**
048:             * Is called before {@link
049:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#insert(Object)},
050:             * or in the beginning of {@link
051:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}
052:             * if a new bean is being saved.
053:             * 
054:             * @param object the bean instance that will be inserted
055:             * @return <code>true</code> if the execution should continue as normal;
056:             * or
057:             * <p><code>false</code> if the execution should be interrupted
058:             * @since 1.0
059:             */
060:            public boolean beforeInsert(BeanType object);
061:
062:            /**
063:             * Is called before {@link
064:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#delete(int)}.
065:             * 
066:             * @param objectId the id of the bean that will be deleted
067:             * @return <code>true</code> if the execution should continue as normal;
068:             * or
069:             * <p><code>false</code> if the execution should be interrupted
070:             * @since 1.0
071:             */
072:            public boolean beforeDelete(int objectId);
073:
074:            /**
075:             * Is called before {@link
076:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}.
077:             * 
078:             * @param object the bean instance that will be saved
079:             * @return <code>true</code> if the execution should continue as normal;
080:             * or
081:             * <p><code>false</code> if the execution should be interrupted
082:             * @since 1.0
083:             */
084:            public boolean beforeSave(BeanType object);
085:
086:            /**
087:             * Is called before {@link
088:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#update(Object)},
089:             * or in the beginning of {@link
090:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}
091:             * if an existing bean is being saved.
092:             * 
093:             * @param object the bean instance that will be updated
094:             * @return <code>true</code> if the execution should continue as normal;
095:             * or
096:             * <p><code>false</code> if the execution should be interrupted
097:             * @since 1.0
098:             */
099:            public boolean beforeUpdate(BeanType object);
100:
101:            /**
102:             * Is called after {@link
103:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#validate(Validated)}.
104:             * 
105:             * @param object the bean instance that was validated
106:             * @return <code>true</code> if the execution should continue as normal;
107:             * or
108:             * <p><code>false</code> if the execution should be interrupted
109:             * @since 1.3
110:             */
111:            public boolean afterValidate(BeanType object);
112:
113:            /**
114:             * Is called after {@link
115:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#insert(Object)},
116:             * or at the end of {@link
117:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}
118:             * if a new bean was saved.
119:             * 
120:             * @param object the bean instance that was inserted
121:             * @param success <code>true</code> if the insert was successful; or
122:             * <p><code>false</code> otherwise
123:             * @return <code>true</code> if the execution should continue as normal;
124:             * or
125:             * <p><code>false</code> if the execution should be interrupted
126:             * @since 1.0
127:             */
128:            public boolean afterInsert(BeanType object, boolean success);
129:
130:            /**
131:             * Is called after {@link
132:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#delete(int)}.
133:             * 
134:             * @param objectId the id of the bean instance that was deleted
135:             * @param success <code>true</code> if the delete was successful; or
136:             * <p><code>false</code> otherwise
137:             * @return <code>true</code> if the execution should continue as normal;
138:             * or
139:             * <p><code>false</code> if the execution should be interrupted
140:             * @since 1.0
141:             */
142:            public boolean afterDelete(int objectId, boolean success);
143:
144:            /**
145:             * Is called after {@link
146:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}.
147:             * 
148:             * @param object the bean instance that was saved
149:             * @param success <code>true</code> if the save was successful; or
150:             * <p><code>false</code> otherwise
151:             * @return <code>true</code> if the execution should continue as normal;
152:             * or
153:             * <p><code>false</code> if the execution should be interrupted
154:             * @since 1.0
155:             */
156:            public boolean afterSave(BeanType object, boolean success);
157:
158:            /**
159:             * Is called after {@link
160:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#update(Object)},
161:             * or at the end of {@link
162:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#save(Object)}
163:             * if an existing bean was saved.
164:             * 
165:             * @param object the bean instance that was updated
166:             * @param success <code>true</code> if the update was successful; or
167:             * <p><code>false</code> otherwise
168:             * @return <code>true</code> if the execution should continue as normal;
169:             * or
170:             * <p><code>false</code> if the execution should be interrupted
171:             * @since 1.0
172:             */
173:            public boolean afterUpdate(BeanType object, boolean success);
174:
175:            /**
176:             * Is called after {@link
177:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#restore(int)}
178:             * and {@link
179:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#restoreFirst(RestoreQuery)},
180:             * and for every instance restored during {@link
181:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#restore()}
182:             * and {@link
183:             * com.uwyn.rife.database.querymanagers.generic.GenericQueryManager#restore(RestoreQuery)}.
184:             * 
185:             * @param object the bean instance that was restored
186:             * @return <code>true</code> if the execution should continue as normal;
187:             * or
188:             * <p><code>false</code> if the execution should be interrupted
189:             * @since 1.0
190:             */
191:            public boolean afterRestore(BeanType object);
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.