Source Code Cross Referenced for DelegatePMapper.java in  » Database-ORM » Speedo_1.4.5 » org » objectweb » speedo » mapper » lib » 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 » Database ORM » Speedo_1.4.5 » org.objectweb.speedo.mapper.lib 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (C) 2001-2004 France Telecom R&D
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
017:         */package org.objectweb.speedo.mapper.lib;
018:
019:        import org.objectweb.jorm.api.PMapper;
020:        import org.objectweb.jorm.api.PClassMapping;
021:        import org.objectweb.jorm.api.PException;
022:        import org.objectweb.jorm.api.PMappingStructuresManager;
023:        import org.objectweb.jorm.api.PMapperListener;
024:        import org.objectweb.jorm.api.PMapCluster;
025:        import org.objectweb.jorm.metainfo.api.Manager;
026:        import org.objectweb.jorm.type.api.PTypeSpace;
027:        import org.objectweb.jorm.util.io.api.PathExplorer;
028:        import org.objectweb.speedo.lib.Personality;
029:        import org.objectweb.speedo.mapper.api.JormFactory;
030:        import org.objectweb.speedo.api.ExceptionHelper;
031:        import org.objectweb.util.monolog.api.Logger;
032:        import org.objectweb.medor.eval.prefetch.api.PrefetchCache;
033:
034:        import java.util.ArrayList;
035:        import java.util.Collection;
036:
037:        /**
038:         * This class is an implementation of the PMapper interface delegating all
039:         * method to another PMapper, except for the lookup method. In this case the
040:         * lookup method is done by the use of the JormFactory. The aim is to always
041:         * have the PClassMapping instance. But only the JormFactory is able to build
042:         * the PClassMapping instance of a Persistent class.
043:         *
044:         * @author S.Chassande-Barrioz
045:         */
046:        public class DelegatePMapper implements  PMapper {
047:
048:            private JormFactory jf;
049:            private PMapper mapper;
050:            private Personality personality;
051:            private ClassLoader classLoader;
052:
053:            public DelegatePMapper(PMapper mapper, Personality p) {
054:                this .mapper = mapper;
055:                personality = p;
056:            }
057:
058:            public JormFactory getJormFactory() {
059:                return jf;
060:            }
061:
062:            public void setJormFactory(JormFactory jf) {
063:                this .jf = jf;
064:            }
065:
066:            public PMapper getMapper() {
067:                return mapper;
068:            }
069:
070:            public void setMapper(PMapper mapper) {
071:                this .mapper = mapper;
072:            }
073:
074:            public ClassLoader getClassLoader() {
075:                return classLoader;
076:            }
077:
078:            public void setClassLoader(ClassLoader classLoader) {
079:                this .classLoader = classLoader;
080:            }
081:
082:            // IMPLEMENTATION OF THE PMapper INTERFACE //
083:
084:            public PClassMapping lookup(String s) {
085:                try {
086:                    return jf.getPClassMapping(s, classLoader);
087:                } catch (PException e) {
088:                    throw personality.newRuntimeException(
089:                            "Impossible to initialize the persistent class '"
090:                                    + s + "': ", ExceptionHelper.getNested(e));
091:                }
092:            }
093:
094:            public void setPMapper(PMapper pm) {
095:                mapper.setPMapper(pm);
096:            }
097:
098:            public void setLogger(Logger l) {
099:                mapper.setLogger(l);
100:            }
101:
102:            public void setDTDLocations(ArrayList dtdlocs) {
103:                mapper.setDTDLocations(dtdlocs);
104:            }
105:
106:            public void setPathsToPdFiles(PathExplorer paths) {
107:                mapper.setPathsToPdFiles(paths);
108:            }
109:
110:            public void setPrefetchCache(PrefetchCache prefetchCache)
111:                    throws PException {
112:                mapper.setPrefetchCache(prefetchCache);
113:            }
114:
115:            public PrefetchCache getPrefetchCache() {
116:                return mapper.getPrefetchCache();
117:            }
118:
119:            public void closeConnection(Object o) throws PException {
120:                mapper.closeConnection(o);
121:            }
122:
123:            public String cn2mn(String s) {
124:                return mapper.cn2mn(s);
125:            }
126:
127:            public Object getConnection() throws PException {
128:                return mapper.getConnection();
129:            }
130:
131:            public Object getConnection(Object o) throws PException {
132:                return mapper.getConnection(o);
133:            }
134:
135:            public Object getConnection(Object connectionContext, Object user)
136:                    throws PException {
137:                return mapper.getConnection(connectionContext, user);
138:            }
139:
140:            public String getMapperName() {
141:                return mapper.getMapperName();
142:            }
143:
144:            public PMappingStructuresManager getPMappingStructuresManager() {
145:                return mapper.getPMappingStructuresManager();
146:            }
147:
148:            public void map(PClassMapping pClassMapping) throws PException {
149:                mapper.map(pClassMapping);
150:            }
151:
152:            public void map(Object o, PClassMapping pClassMapping)
153:                    throws PException {
154:                mapper.map(o, pClassMapping);
155:            }
156:
157:            public void map(Object o, PClassMapping pClassMapping, boolean b)
158:                    throws PException {
159:                mapper.map(o, pClassMapping, b);
160:            }
161:
162:            public void setConnectionFactory(Object o) throws PException {
163:                mapper.setConnectionFactory(o);
164:            }
165:
166:            public Object getConnectionFactory() {
167:                return mapper.getConnectionFactory();
168:            }
169:
170:            public void setMapperName(String s) {
171:                mapper.setMapperName(s);
172:            }
173:
174:            public Manager getMetaInfoManager() {
175:                return mapper.getMetaInfoManager();
176:            }
177:
178:            public PTypeSpace getPTypeSpace() {
179:                return mapper.getPTypeSpace();
180:            }
181:
182:            public void start() throws PException {
183:                mapper.start();
184:            }
185:
186:            public void stop() throws PException {
187:                mapper.stop();
188:            }
189:
190:            public void unmap(String s) throws PException {
191:                mapper.unmap(s);
192:            }
193:
194:            public void clean() throws PException {
195:                mapper.clean();
196:            }
197:
198:            public void addMapperEventListener(PMapperListener pMapperListener) {
199:                mapper.addMapperEventListener(pMapperListener);
200:            }
201:
202:            public void removeMapperEventListener(
203:                    PMapperListener pMapperListener) {
204:                mapper.removeMapperEventListener(pMapperListener);
205:            }
206:
207:            public PClassMapping createGenClassMapping() throws PException {
208:                return mapper.createGenClassMapping();
209:            }
210:
211:            public PMapCluster getPMapCluster(String s) throws PException {
212:                return mapper.getPMapCluster(s);
213:            }
214:
215:            public Collection getPMapClusters() {
216:                return mapper.getPMapClusters();
217:            }
218:
219:            public void addDependency(String s, String s1) throws PException {
220:                mapper.addDependency(s, s1);
221:            }
222:
223:            public void classDefined(String s) throws PException {
224:                mapper.classDefined(s);
225:            }
226:
227:            public void declareClass(String jcname) {
228:                mapper.declareClass(jcname);
229:            }
230:
231:            public String[] getMappedClasses() {
232:                return mapper.getMappedClasses();
233:            }
234:
235:            public void clear() throws PException {
236:                mapper.clear();
237:            }
238:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.