Source Code Cross Referenced for KeyGenLockEJB.java in  » Workflow-Engines » wfmopen-2.1.1 » de » danet » an » util » 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 » Workflow Engines » wfmopen 2.1.1 » de.danet.an.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of the WfMOpen project.
003:         * Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
004:         * All rights reserved.
005:         *
006:         * This program is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU General Public License as published by
008:         * the Free Software Foundation; either version 2 of the License, or
009:         * (at your option) any later version.
010:         *
011:         * This program 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
014:         * GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
019:         *
020:         * $Id: KeyGenLockEJB.java,v 1.9 2007/06/26 12:29:50 drmlipp Exp $
021:         *
022:         * $Log: KeyGenLockEJB.java,v $
023:         * Revision 1.9  2007/06/26 12:29:50  drmlipp
024:         * Made constant schema compliant.
025:         *
026:         * Revision 1.8  2006/10/11 09:06:28  drmlipp
027:         * Fixed EJB naming.
028:         *
029:         * Revision 1.7  2006/09/29 12:32:08  drmlipp
030:         * Consistently using WfMOpen as projct name now.
031:         *
032:         * Revision 1.6  2005/04/08 11:28:02  drmlipp
033:         * Merged changes from 1.3 branch up to 1.3p6.
034:         *
035:         * Revision 1.4.2.2  2005/04/04 20:08:55  drmlipp
036:         * Changed WLS transaction isolation.
037:         *
038:         * Revision 1.5  2005/02/23 15:42:59  drmlipp
039:         * Synchronized with 1.3.
040:         *
041:         * Revision 1.4.2.1  2005/02/15 14:46:14  drmlipp
042:         * Fixed reentrant attribute (must be capitalized after all).
043:         *
044:         * Revision 1.4  2004/12/20 22:20:14  drmlipp
045:         * Fixed reentrant attribute.
046:         *
047:         * Revision 1.3  2004/09/17 13:27:39  drmlipp
048:         * Started J2EESDK port.
049:         *
050:         * Revision 1.2  2004/09/10 12:44:28  drmlipp
051:         * Enabled call by reference for weblogic by default.
052:         *
053:         * Revision 1.1.1.3  2004/08/18 15:17:34  drmlipp
054:         * Update to 1.2
055:         *
056:         * Revision 1.3  2004/06/23 15:06:38  lipp
057:         * Started JOnAS port.
058:         *
059:         * Revision 1.2  2004/01/14 07:59:44  lipp
060:         * Added transaction isolation attribute for WLS.
061:         *
062:         * Revision 1.1  2003/10/20 14:01:48  lipp
063:         * Better support for data bases without SELECT FOR UPDATE.
064:         *
065:         */
066:        package de.danet.an.util;
067:
068:        import javax.ejb.CreateException;
069:        import javax.ejb.EntityBean;
070:        import javax.ejb.EntityContext;
071:        import javax.ejb.FinderException;
072:
073:        /**
074:         * This class is a helper used to synchronize key generators within an
075:         * application server if the data base does not support SELECT FOR UPDATE.
076:         *
077:         * @author <a href="mailto:lipp@danet.de">Michael Lipp</a>
078:         * @version $Revision: 1.9 $
079:         * @ejb.bean name="KeyGenLock" display-name="Key Generator Lock"
080:         * jndi-name="ejb/@@@_Utility-EJBs_KeyGenLockEJB_JNDI_Name_@@@"
081:         * type="BMP" reentrant="false" view-type="remote"
082:         * @jonas.bean ejb-name="KeyGenLock"
083:         * @ejb.pk class="java.lang.String" generate="false"
084:         * @ejb.transaction type="Required"
085:         * @weblogic.enable-call-by-reference True
086:         */
087:        public class KeyGenLockEJB implements  EntityBean {
088:
089:            private static final org.apache.commons.logging.Log logger = org.apache.commons.logging.LogFactory
090:                    .getLog(KeyGenLockEJB.class);
091:
092:            /** Entity context. */
093:            private EntityContext ctx;
094:
095:            /**
096:             * Set the associated entity context. The container calls this method 
097:             * after the instance creation.
098:             * @see javax.ejb.EntityBean
099:             * @param context - A SessionContext interface for the instance
100:             */
101:            public void setEntityContext(EntityContext context) {
102:                ctx = context;
103:            }
104:
105:            /**
106:             * Unset the associated entity context. 
107:             * @see javax.ejb.EntityBean
108:             */
109:            public void unsetEntityContext() {
110:                ctx = null;
111:            }
112:
113:            /**
114:             * The activate method is called when the instance is activated from its 
115:             * "passive" state. The instance should acquire any resource that it has 
116:             * released earlier in the ejbPassivate() method.
117:             * This method gets the primary key from container.
118:             * @see javax.ejb.EntityBean
119:             */
120:            public void ejbActivate() {
121:            }
122:
123:            /**
124:             * The passivate method is called before the instance enters the 
125:             * "passive" state. The instance should release any resources that it 
126:             * can re-acquire later in the ejbActivate() method.
127:             * @see javax.ejb.EntityBean
128:             */
129:            public void ejbPassivate() {
130:            }
131:
132:            /**
133:             * A container invokes this method before it ends the life of the session 
134:             * object. This happens as a result of a client's invoking a remove 
135:             * operation, or when a container decides to terminate the session object 
136:             * after a timeout.
137:             * @see javax.ejb.EntityBean
138:             */
139:            public void ejbRemove() {
140:            }
141:
142:            /**
143:             * Called by the container to load persistent data.
144:             */
145:            public void ejbStore() {
146:            }
147:
148:            /**
149:             * Called by the container to save persistent data.
150:             */
151:            public void ejbLoad() {
152:            }
153:
154:            /**
155:             * Create an new instance. Not needed.
156:             * @param key the key
157:             * @return primary key of the bean
158:             * @throws CreateException thrown if the EJB cannot be create.
159:             */
160:            public String ejbCreate(String key) throws CreateException {
161:                return key;
162:            }
163:
164:            /**
165:             * Called after creating a new instance.
166:             * @param key the key
167:             * @throws CreateException if the EJB cannot be create.
168:             */
169:            public void ejbPostCreate(String key) throws CreateException {
170:            }
171:
172:            /**
173:             * Find an EJB.
174:             * @param pk The primary key of the bean
175:             * @return the primary key
176:             * @throws FinderException (<code>ObjectNotFoundException</code>)
177:             * if no EJB was found
178:             */
179:            public String ejbFindByPrimaryKey(String pk) throws FinderException {
180:                return pk;
181:            }
182:
183:            /**
184:             * Just a dummy method that return the key.
185:             * @return the key
186:             *
187:             * @ejb.interface-method view-type="remote"
188:             */
189:            public String key() {
190:                return (String) ctx.getPrimaryKey();
191:            }
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.