Revision 654938a3
Added by Andreas Müller over 12 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmIoBase.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.lang.reflect.Constructor; |
13 | 13 |
import java.lang.reflect.InvocationTargetException; |
14 |
import java.util.ArrayList; |
|
15 | 14 |
import java.util.HashSet; |
16 |
import java.util.List; |
|
17 | 15 |
import java.util.Set; |
18 | 16 |
|
17 |
import org.apache.commons.lang.StringUtils; |
|
19 | 18 |
import org.apache.log4j.Logger; |
20 | 19 |
import org.hibernate.SessionFactory; |
21 | 20 |
import org.springframework.beans.factory.annotation.Autowired; |
... | ... | |
24 | 23 |
import org.springframework.transaction.TransactionStatus; |
25 | 24 |
import org.springframework.transaction.support.DefaultTransactionDefinition; |
26 | 25 |
|
27 |
import com.mysql.jdbc.AssertionFailedException; |
|
28 |
|
|
29 | 26 |
import eu.etaxonomy.cdm.api.application.CdmApplicationDefaultConfiguration; |
30 | 27 |
import eu.etaxonomy.cdm.common.IProgressMonitor; |
31 | 28 |
import eu.etaxonomy.cdm.io.common.events.IIoEvent; |
... | ... | |
45 | 42 |
private Set<IIoObserver> observers = new HashSet<IIoObserver>(); |
46 | 43 |
protected String ioName = null; |
47 | 44 |
|
45 |
|
|
46 |
/** |
|
47 |
* |
|
48 |
*/ |
|
49 |
public CdmIoBase() { |
|
50 |
super(); |
|
51 |
this.ioName = this.getClass().getSimpleName(); |
|
52 |
} |
|
53 |
|
|
48 | 54 |
//******************** Observers ********************************************************* |
49 | 55 |
|
50 | 56 |
/* (non-Javadoc) |
... | ... | |
162 | 168 |
txManager.commit(txStatus); |
163 | 169 |
return; |
164 | 170 |
} |
165 |
|
|
166 |
/** |
|
167 |
* |
|
168 |
*/ |
|
169 |
public CdmIoBase() { |
|
170 |
super(); |
|
171 |
this.ioName = this.getClass().getSimpleName(); |
|
172 |
} |
|
171 |
|
|
173 | 172 |
|
174 | 173 |
/* (non-Javadoc) |
175 | 174 |
* @see eu.etaxonomy.cdm.io.common.ICdmIO#check(eu.etaxonomy.cdm.io.common.IIoConfigurator) |
... | ... | |
278 | 277 |
event.setThrowingClass(this.getClass()); |
279 | 278 |
event.setMessage(message); |
280 | 279 |
event.setLocation(location); |
281 |
int linenumber = new Exception().getStackTrace()[0].getLineNumber(); |
|
280 |
// int linenumber = new Exception().getStackTrace()[0].getLineNumber();
|
|
282 | 281 |
fire(event); |
283 | 282 |
} |
284 | 283 |
|
... | ... | |
304 | 303 |
fire(event); |
305 | 304 |
} |
306 | 305 |
|
306 |
protected boolean isBlank(String str){ |
|
307 |
return StringUtils.isBlank(str); |
|
308 |
} |
|
309 |
|
|
310 |
protected boolean isNotBlank(String str){ |
|
311 |
return StringUtils.isNotBlank(str); |
|
312 |
} |
|
313 |
|
|
314 |
|
|
307 | 315 |
// /** |
308 | 316 |
// * Returns the first stack trace element of the first class not equal to "StackTraceUtils" or "LogUtils" and aClass. <br /> |
309 | 317 |
// * Stored in array of the callstack. <br /> |
Also available in: Unified diff
isBlank and isNotBlank to IOBase