Source Code Cross Referenced for CallbackLogger.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » tests » common » ejbs » entity » callbacklogger » 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 » J2EE » ow2 easybeans » org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * EasyBeans
003:         * Copyright (C) 2006 Bull S.A.S.
004:         * Contact: easybeans@ow2.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: CallbackLogger.java 1970 2007-10-16 11:49:25Z benoitf $
023:         * --------------------------------------------------------------------------
024:         */package org.ow2.easybeans.tests.common.ejbs.entity.callbacklogger;
025:
026:        import java.io.Serializable;
027:        import java.text.MessageFormat;
028:
029:        import javax.persistence.DiscriminatorValue;
030:        import javax.persistence.Entity;
031:        import javax.persistence.EnumType;
032:        import javax.persistence.Enumerated;
033:        import javax.persistence.GeneratedValue;
034:        import javax.persistence.GenerationType;
035:        import javax.persistence.Id;
036:        import javax.persistence.Inheritance;
037:        import javax.persistence.InheritanceType;
038:        import javax.persistence.NamedQueries;
039:        import javax.persistence.NamedQuery;
040:        import javax.persistence.Table;
041:        import javax.persistence.TableGenerator;
042:
043:        /**
044:         * Used to log the callback events.
045:         * @author Gisele Pinheiro Souza
046:         * @author Eduardo Studzinski Estima de Castro
047:         *
048:         */
049:        @Entity
050:        @Table(name="CALLBACKLOGGER")
051:        @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
052:        @DiscriminatorValue("Type")
053:        @TableGenerator(name="MANAGER_SEQ",allocationSize=1)
054:        @NamedQueries({@NamedQuery(name="findAll",query="SELECT e FROM CallbackLogger e "),@NamedQuery(name="findLifecycleEvent",query="SELECT e FROM CallbackLogger e WHERE e.className = :className AND" + " e.callbackEvent= :event"),@NamedQuery(name="findLifecycleEventByClass",query="SELECT e FROM CallbackLogger e WHERE e.className = :className"),@NamedQuery(name="findLifecycleEventByCallbackMethod",query="SELECT e FROM CallbackLogger e " + "WHERE e.className = :className AND e.callbackClassName= :callbackClassName AND e.callbackEvent= :event")})
055:        public class CallbackLogger implements  Serializable {
056:
057:            /**
058:             * Class ID.
059:             */
060:            private static final long serialVersionUID = 5508063145575159629L;
061:
062:            /**
063:             * The logger identifier.
064:             */
065:            private int id;
066:
067:            /**
068:             * The class for which the callback method was called.
069:             */
070:            private String className;
071:
072:            /**
073:             * The callback event.
074:             */
075:            private CallbackType callbackEvent;
076:
077:            /**
078:             * The time in milliseconds when the callback event was called.
079:             */
080:            private long insertionDate;
081:
082:            /**
083:             * The class that contains the method callback.
084:             */
085:            private String callbackClassName;
086:
087:            /**
088:             * Gets the name of the class that has the callback method.
089:             * @return the class name.
090:             */
091:            public String getCallbackClassName() {
092:                return callbackClassName;
093:            }
094:
095:            /**
096:             * Sets the cname of the class that has the callback method.
097:             * @param callbackClassName the class name.
098:             */
099:            public void setCallbackClassName(final String callbackClassName) {
100:                this .callbackClassName = callbackClassName;
101:            }
102:
103:            /**
104:             * Gets the callback event type.
105:             * @return the callback event type.
106:             */
107:            @Enumerated(EnumType.STRING)
108:            public CallbackType getCallbackEvent() {
109:                return callbackEvent;
110:            }
111:
112:            /**
113:             * Sets the callback event type.
114:             * @param callbackEvent the callback event.
115:             */
116:            public void setCallbackEvent(final CallbackType callbackEvent) {
117:                this .callbackEvent = callbackEvent;
118:            }
119:
120:            /**
121:             * Gets the name of the class that was intercepted by the callback method.
122:             * @return the class name.
123:             */
124:            public String getClassName() {
125:                return className;
126:            }
127:
128:            /**
129:             * Sets the name of the class that was intercepted by the callback method.
130:             * @param className the class name.
131:             */
132:            public void setClassName(final String className) {
133:                this .className = className;
134:            }
135:
136:            /**
137:             * Gets the entity identifier.
138:             * @return the identifier.
139:             */
140:            @Id
141:            @GeneratedValue(strategy=GenerationType.TABLE,generator="MANAGER_SEQ")
142:            public int getId() {
143:                return id;
144:            }
145:
146:            /**
147:             * Sets the entity identifier.
148:             * @param id the identifier.
149:             */
150:            public void setId(final int id) {
151:                this .id = id;
152:            }
153:
154:            /**
155:             * Gets the time in millisencodes in which the entity was inserted in the database.
156:             * @return the time.
157:             */
158:            public long getInsertionDate() {
159:                return insertionDate;
160:            }
161:
162:            /**
163:             * Gets the time in millisencodes in which the entity is inserted in the database.
164:             * @param insertionDate the date.
165:             */
166:            public void setInsertionDate(final long insertionDate) {
167:                this .insertionDate = insertionDate;
168:            }
169:
170:            /**
171:             * String representation of the object.
172:             * @return object representation
173:             */
174:            @SuppressWarnings("boxing")
175:            @Override
176:            public String toString() {
177:                return MessageFormat
178:                        .format(
179:                                "{0}, ID = {1}, ClassName = {2}, CallbackClassName = {3}, CallbackEvent = {4}, Date = {5}",
180:                                CallbackLogger.class.getName(), id, className,
181:                                callbackClassName, callbackEvent, insertionDate);
182:            }
183:        }
www__.___j__a_v_a__2s__.c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.