Source Code Cross Referenced for SynchronizerResourceBean.java in  » Groupware » LibreSource » org » libresource » so6 » server » ls » ejb » 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 » Groupware » LibreSource » org.libresource.so6.server.ls.ejb 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * LibreSource
003:         * Copyright (C) 2004-2008 Artenum SARL / INRIA
004:         * http://www.libresource.org - contact@artenum.com
005:         *
006:         * This file is part of the LibreSource software, 
007:         * which can be used and distributed under license conditions.
008:         * The license conditions are provided in the LICENSE.TXT file 
009:         * at the root path of the packaging that enclose this file. 
010:         * More information can be found at 
011:         * - http://dev.libresource.org/home/license
012:         *
013:         * Initial authors :
014:         *
015:         * Guillaume Bort / INRIA
016:         * Francois Charoy / Universite Nancy 2
017:         * Julien Forest / Artenum
018:         * Claude Godart / Universite Henry Poincare
019:         * Florent Jouille / INRIA
020:         * Sebastien Jourdain / INRIA / Artenum
021:         * Yves Lerumeur / Artenum
022:         * Pascal Molli / Universite Henry Poincare
023:         * Gerald Oster / INRIA
024:         * Mariarosa Penzi / Artenum
025:         * Gerard Sookahet / Artenum
026:         * Raphael Tani / INRIA
027:         *
028:         * Contributors :
029:         *
030:         * Stephane Bagnier / Artenum
031:         * Amadou Dia / Artenum-IUP Blois
032:         * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033:         */package org.libresource.so6.server.ls.ejb;
034:
035:        import org.libresource.LibresourceResourceBase;
036:
037:        import org.libresource.so6.server.ls.util.SynchronizerResourceUtil;
038:
039:        import java.sql.Connection;
040:        import java.sql.Statement;
041:
042:        import javax.ejb.CreateException;
043:
044:        /**
045:         * A libresource Synchronizer
046:         *
047:         * @author <a href="mailto:jourdain@loria.fr">Sebastien Jourdain</a> - <a
048:         *         href="http://www.inria.fr">INRIA Lorraine</a>
049:         *
050:         * @libresource.resource name="Synchronizer" service="LibresourceSynchronizer"
051:         *
052:         * @ejb.finder signature= "java.util.Collection findAll()" query ="SELECT
053:         *             OBJECT(s) FROM SynchronizerResource s"
054:         *             transaction-type="Supports"
055:         */
056:        public abstract class SynchronizerResourceBean extends
057:                LibresourceResourceBase {
058:            /**
059:             * @ejb.create-method
060:             */
061:            public String ejbCreate(String name, String description)
062:                    throws CreateException {
063:                setId(SynchronizerResourceUtil.generateGUID(this ));
064:                setName(name);
065:                setDescription(description);
066:                setFileEncoding("utf-8");
067:
068:                return null;
069:            }
070:
071:            /**
072:             * @ejb.create-method
073:             */
074:            public String ejbCreate(String name, String description,
075:                    String encoding) throws CreateException {
076:                setId(SynchronizerResourceUtil.generateGUID(this ));
077:                setName(name);
078:                setDescription(description);
079:                setFileEncoding(encoding);
080:
081:                return null;
082:            }
083:
084:            public void ejbPostCreate(String name, String description)
085:                    throws CreateException {
086:                try {
087:                    // Create the patch table
088:                    Connection conn = LibresourceSynchronizerServiceBean
089:                            .getConnection();
090:                    Statement stmt = conn.createStatement();
091:                    stmt.executeUpdate(LibresourceSynchronizerServiceBean
092:                            .getCreatePatchTableQuery(getId()));
093:                    stmt.close();
094:                    conn.close();
095:                } catch (Exception e) {
096:                    e.printStackTrace();
097:                    ctx.setRollbackOnly();
098:                    throw new CreateException("Command table not created : "
099:                            + e.getMessage());
100:                }
101:            }
102:
103:            public void ejbPostCreate(String name, String description,
104:                    String encoding) {
105:                try {
106:                    // Create the patch table
107:                    Connection conn = LibresourceSynchronizerServiceBean
108:                            .getConnection();
109:                    Statement stmt = conn.createStatement();
110:                    stmt.executeUpdate(LibresourceSynchronizerServiceBean
111:                            .getCreatePatchTableQuery(getId()));
112:                    stmt.close();
113:                    conn.close();
114:                } catch (Exception e) {
115:                    e.printStackTrace();
116:
117:                    //ctx.setRollbackOnly();
118:                    // throw new CreateException("Command table not created : " +
119:                    // e.getMessage());
120:                }
121:            }
122:
123:            // persistents fields
124:
125:            /**
126:             * @ejb.persistent-field
127:             * @ejb.interface-method
128:             * @ejb.value-object match="libresource"
129:             * @ejb.transaction type="Supports"
130:             */
131:            public abstract String getId();
132:
133:            /**
134:             * @ejb.persistent-field
135:             * @ejb.interface-method
136:             * @ejb.transaction type="Mandatory"
137:             */
138:            public abstract void setId(String id);
139:
140:            /**
141:             * @ejb.interface-method
142:             * @ejb.value-object match="libresource"
143:             * @ejb.transaction type="Supports"
144:             */
145:            public String getShortResourceName() {
146:                return getName();
147:            }
148:
149:            /**
150:             * @ejb.persistent-field
151:             * @ejb.interface-method
152:             * @ejb.value-object match="libresource"
153:             * @ejb.transaction type="Supports"
154:             */
155:            public abstract String getName();
156:
157:            /**
158:             * @ejb.persistent-field
159:             * @ejb.interface-method
160:             * @ejb.transaction type="Mandatory"
161:             */
162:            public abstract void setName(String name);
163:
164:            /**
165:             * @ejb.persistent-field
166:             * @ejb.interface-method
167:             * @ejb.value-object match="libresource"
168:             * @ejb.transaction type="Supports"
169:             */
170:            public abstract String getDescription();
171:
172:            /**
173:             * @ejb.persistent-field
174:             * @ejb.interface-method
175:             * @ejb.transaction type="Mandatory"
176:             */
177:            public abstract void setDescription(String description);
178:
179:            /**
180:             * @ejb.persistent-field
181:             * @ejb.interface-method
182:             * @ejb.value-object match="libresource"
183:             * @ejb.transaction type="Supports"
184:             */
185:            public abstract long getLastTicket();
186:
187:            /**
188:             * @ejb.persistent-field
189:             * @ejb.interface-method
190:             * @ejb.transaction type="Mandatory"
191:             */
192:            public abstract void setLastTicket(long lastTicket);
193:
194:            /**
195:             * @ejb.persistent-field
196:             * @ejb.interface-method
197:             * @ejb.value-object match="libresource"
198:             * @ejb.transaction type="Supports"
199:             */
200:            public abstract String getFileEncoding();
201:
202:            /**
203:             * @ejb.persistent-field
204:             * @ejb.interface-method
205:             * @ejb.transaction type="Mandatory"
206:             */
207:            public abstract void setFileEncoding(String fileEncoding);
208:
209:            /**
210:             * @ejb.persistent-field
211:             * @ejb.interface-method
212:             * @ejb.value-object match="libresource"
213:             * @ejb.transaction type="Supports"
214:             */
215:            public abstract String getBinaryExtention();
216:
217:            /**
218:             * @ejb.persistent-field
219:             * @ejb.interface-method
220:             * @ejb.transaction type="Mandatory"
221:             */
222:            public abstract void setBinaryExtention(String binExt);
223:
224:            /**
225:             * @ejb.interface-method
226:             * @ejb.relation name="SynchronizerConnection"
227:             *               role-name="Synchronizer-of-Connections"
228:             * @ejb.transaction type="Supports"
229:             *
230:             * @ejb.value-object aggregate="org.libresource.so6.server.ls.ejb.model.WsConnectionResourceValue"
231:             *                   aggregate-name="WsConnection"
232:             *                   members="org.libresource.so6.server.ls.interfaces.WsConnectionResourceLocal"
233:             *                   members-name="WsConnectionResource"
234:             *                   type="java.util.Collection" match="libresource"
235:             *                   relation="external"
236:             */
237:            public abstract java.util.Collection getWsConnections();
238:
239:            /**
240:             * @ejb.interface-method
241:             * @ejb.transaction type="Mandatory"
242:             */
243:            public abstract void setWsConnections(
244:                    java.util.Collection wsConnections);
245:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.