001: /**
002: * Copyright (C) 2001-2005 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.ejb;
018:
019: import javax.persistence.PersistenceException;
020:
021: import org.objectweb.speedo.lib.Personality;
022: import org.objectweb.speedo.pm.ejb.api.EJBPOManagerFactoryItf;
023: import org.objectweb.speedo.pm.ejb.api.EJBPOManagerItf;
024:
025: public final class EJBPersonality extends Personality {
026:
027: private static final long serialVersionUID = 9783432421432544L;
028:
029: public RuntimeException newRuntimeException() {
030: return new PersistenceException();
031: }
032:
033: public RuntimeException newRuntimeException(String msg) {
034: return new PersistenceException(msg);
035: }
036:
037: public RuntimeException newRuntimeException(String msg,
038: Throwable[] nested) {
039: if (nested.length == 0) {
040: return new PersistenceException(msg);
041: }
042: return new PersistenceException(msg, nested[0]);
043: }
044:
045: public RuntimeException newRuntimeException(String msg,
046: Throwable nested) {
047: return new PersistenceException(msg, nested);
048: }
049:
050: public RuntimeException newRuntimeException(String msg,
051: Object failed) {
052: return new PersistenceException(msg);
053: }
054:
055: public RuntimeException newRuntimeException(String msg,
056: Throwable[] nested, Object failed) {
057: if (nested.length == 0) {
058: return new PersistenceException(msg);
059: }
060: return new PersistenceException(msg, nested[0]);
061: }
062:
063: public RuntimeException newRuntimeException(String msg,
064: Throwable nested, Object failed) {
065: return new PersistenceException(msg, nested);
066: }
067:
068: public RuntimeException newRuntimeException(Throwable nested) {
069: return new PersistenceException(nested);
070: }
071:
072: public Class getRuntimeExceptionClass() {
073: return PersistenceException.class;
074: }
075:
076: public RuntimeException newUserRuntimeException() {
077: return new PersistenceException();
078: }
079:
080: public RuntimeException newUserRuntimeException(String msg) {
081: return new PersistenceException(msg);
082: }
083:
084: public RuntimeException newUserRuntimeException(String msg,
085: Throwable[] nested) {
086: if (nested.length == 0) {
087: return new PersistenceException(msg);
088: }
089: return new PersistenceException(msg, nested[0]);
090: }
091:
092: public RuntimeException newUserRuntimeException(String msg,
093: Throwable nested) {
094: return new PersistenceException(msg, nested);
095: }
096:
097: public RuntimeException newUserRuntimeException(String msg,
098: Object failed) {
099: return new PersistenceException(msg);
100: }
101:
102: public RuntimeException newUserRuntimeException(String msg,
103: Throwable[] nested, Object failed) {
104: if (nested.length == 0) {
105: return new PersistenceException(msg);
106: }
107: return new PersistenceException(msg, nested[0]);
108: }
109:
110: public RuntimeException newUserRuntimeException(String msg,
111: Throwable nested, Object failed) {
112: return new PersistenceException(msg, nested);
113: }
114:
115: public RuntimeException newUserRuntimeException(Throwable nested) {
116: return new PersistenceException(nested);
117: }
118:
119: public Class getUserRuntimeExceptionClass() {
120: return PersistenceException.class;
121: }
122:
123: public RuntimeException newFatalRuntimeException() {
124: return new PersistenceException();
125: }
126:
127: public RuntimeException newFatalRuntimeException(String msg) {
128: return new PersistenceException(msg);
129: }
130:
131: public RuntimeException newFatalRuntimeException(String msg,
132: Throwable[] nested) {
133: if (nested.length == 0) {
134: return new PersistenceException(msg);
135: }
136: return new PersistenceException(msg, nested[0]);
137: }
138:
139: public RuntimeException newFatalRuntimeException(String msg,
140: Throwable nested) {
141: return new PersistenceException(msg, nested);
142: }
143:
144: public RuntimeException newFatalRuntimeException(String msg,
145: Object failed) {
146: return new PersistenceException(msg);
147: }
148:
149: public RuntimeException newFatalRuntimeException(String msg,
150: Throwable[] nested, Object failed) {
151: if (nested.length == 0) {
152: return new PersistenceException(msg);
153: }
154: return new PersistenceException(msg, nested[0]);
155: }
156:
157: public RuntimeException newFatalRuntimeException(String msg,
158: Throwable nested, Object failed) {
159: return new PersistenceException(msg, nested);
160: }
161:
162: public RuntimeException newFatalRuntimeException(Throwable nested) {
163: return new PersistenceException(nested);
164: }
165:
166: public Class getFatalRuntimeExceptionClass() {
167: return PersistenceException.class;
168: }
169:
170: public RuntimeException newFatalDataStoreRuntimeException() {
171: return new PersistenceException();
172: }
173:
174: public RuntimeException newFatalDataStoreRuntimeException(
175: String msg, Object failed) {
176: return new PersistenceException(msg);
177: }
178:
179: public RuntimeException newFatalDataStoreRuntimeException(
180: String msg, Throwable nested, Object failed) {
181: return new PersistenceException(msg, nested);
182: }
183:
184: public RuntimeException newFatalDataStoreRuntimeException(
185: String msg, Throwable nested) {
186: return new PersistenceException(msg, nested);
187: }
188:
189: public RuntimeException newFatalDataStoreRuntimeException(
190: String msg, Throwable[] nested, Object failed) {
191: if (nested.length == 0) {
192: return new PersistenceException(msg);
193: }
194: return new PersistenceException(msg, nested[0]);
195: }
196:
197: public RuntimeException newFatalDataStoreRuntimeException(
198: String msg, Throwable[] nested) {
199: if (nested.length == 0) {
200: return new PersistenceException(msg);
201: }
202: return new PersistenceException(msg, nested[0]);
203: }
204:
205: public RuntimeException newFatalDataStoreRuntimeException(String msg) {
206: return new PersistenceException(msg);
207: }
208:
209: public RuntimeException newFatalDataStoreRuntimeException(
210: Throwable nested) {
211: return new PersistenceException(nested);
212: }
213:
214: public RuntimeException newDataStoreRuntimeException(String msg,
215: Throwable nested) {
216: return new PersistenceException(msg, nested);
217: }
218:
219: public RuntimeException newDataStoreRuntimeException(String msg) {
220: return new PersistenceException(msg);
221: }
222:
223: public Class getDetachedFieldAccessRuntimeExceptionClass() {
224: return PersistenceException.class;
225: }
226:
227: public Class getPOMClass() {
228: return EJBPOManagerItf.class;
229: }
230:
231: public Class getPOMFClass() {
232: return EJBPOManagerFactoryItf.class;
233: }
234: }
|