KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > ejb > cmp3 > xml > listeners > XMLEntityListener


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.ejb.cmp3.xml.listeners;
23
24 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener;
25
26 import java.lang.reflect.Method JavaDoc;
27
28 /**
29  * An XML specified entity listener.
30  *
31  * WIP - similar code in here as XMLEntityClassListener
32  *
33  * @author Guy Pelletier
34  * @since TopLink EJB 3.0 Reference Implementation
35  */

36 public class XMLEntityListener extends MetadataEntityListener {
37     /**
38      * INTERNAL:
39      */

40     public XMLEntityListener(Class JavaDoc listenerClass, Class JavaDoc entityClass) {
41         super(listenerClass, entityClass);
42     }
43     
44     /**
45      * INTERNAL:
46      * Set it only if the same method wasn't already set from XML. If this
47      * is a different method and one has already been set from XML, then an
48      * exception will be thrown from the set on the parent.
49      */

50     public void setPostBuildMethod(Method JavaDoc method) {
51         if (noCallbackMethodAlreadySetFor(POST_BUILD, method)) {
52             super.setPostBuildMethod(method);
53         }
54     }
55     
56     /**
57      * INTERNAL:
58      * Set it only if the same method wasn't already set from XML. If this
59      * is a different method and one has already been set from XML, then an
60      * exception will be thrown from the set on the parent.
61      */

62     public void setPostCloneMethod(Method JavaDoc method) {
63         if (noCallbackMethodAlreadySetFor(POST_CLONE, method)) {
64             super.setPostCloneMethod(method);
65         }
66     }
67
68     /**
69      * INTERNAL:
70      * Set it only if the same method wasn't already set from XML. If this
71      * is a different method and one has already been set from XML, then an
72      * exception will be thrown from the set on the parent.
73      */

74     public void setPostDeleteMethod(Method JavaDoc method) {
75         if (noCallbackMethodAlreadySetFor(POST_DELETE, method)) {
76             super.setPostDeleteMethod(method);
77         }
78     }
79
80     /**
81      * INTERNAL:
82      * Set it only if the same method wasn't already set from XML. If this
83      * is a different method and one has already been set from XML, then an
84      * exception will be thrown from the set on the parent.
85      */

86     public void setPostInsertMethod(Method JavaDoc method) {
87         if (noCallbackMethodAlreadySetFor(POST_INSERT, method)) {
88             super.setPostInsertMethod(method);
89         }
90     }
91
92     /**
93      * INTERNAL:
94      * Set it only if the same method wasn't already set from XML. If this
95      * is a different method and one has already been set from XML, then an
96      * exception will be thrown from the set on the parent.
97      */

98     public void setPostRefreshMethod(Method JavaDoc method) {
99         if (noCallbackMethodAlreadySetFor(POST_REFRESH, method)) {
100             super.setPostRefreshMethod(method);
101         }
102     }
103     
104     /**
105      * INTERNAL:
106      * Set it only if the same method wasn't already set from XML. If this
107      * is a different method and one has already been set from XML, then an
108      * exception will be thrown from the set on the parent.
109      */

110     public void setPostUpdateMethod(Method JavaDoc method) {
111         if (noCallbackMethodAlreadySetFor(POST_UPDATE, method)) {
112             super.setPostUpdateMethod(method);
113         }
114     }
115
116     /**
117      * INTERNAL:
118      * Set it only if the same method wasn't already set from XML. If this
119      * is a different method and one has already been set from XML, then an
120      * exception will be thrown from the set on the parent.
121      */

122     public void setPrePersistMethod(Method JavaDoc method) {
123         if (noCallbackMethodAlreadySetFor(PRE_PERSIST, method)) {
124             super.setPrePersistMethod(method);
125         }
126     }
127     
128     /**
129      * INTERNAL:
130      * Set it only if the same method wasn't already set from XML. If this
131      * is a different method and one has already been set from XML, then an
132      * exception will be thrown from the set on the parent.
133      */

134     public void setPreRemoveMethod(Method JavaDoc method) {
135         if (noCallbackMethodAlreadySetFor(PRE_REMOVE, method)) {
136             super.setPreRemoveMethod(method);
137         }
138     }
139     
140     /**
141      * INTERNAL:
142      * Set it only if the same method wasn't already set from XML. If this
143      * is a different method and one has already been set from XML, then an
144      * exception will be thrown from the set on the parent.
145      */

146     public void setPreUpdateWithChangesMethod(Method JavaDoc method) {
147         if (noCallbackMethodAlreadySetFor(PRE_UPDATE_WITH_CHANGES, method)) {
148             super.setPreUpdateWithChangesMethod(method);
149         }
150     }
151 }
152
Popular Tags