| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| OptimisticLockException |
|
| 1.0;1 |
| 1 | package org.apache.ojb.broker; | |
| 2 | ||
| 3 | /* Copyright 2002-2005 The Apache Software Foundation | |
| 4 | * | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 | * you may not use this file except in compliance with the License. | |
| 7 | * You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | ||
| 18 | ||
| 19 | /** | |
| 20 | * Exception that is thrown if a violation of an optimistic lock was detected. | |
| 21 | * | |
| 22 | * @author Thomas Mahler | |
| 23 | * @version $Id: OptimisticLockException.java,v 1.1 2007-08-24 22:17:35 ewestfal Exp $ | |
| 24 | */ | |
| 25 | public class OptimisticLockException extends PersistenceBrokerException | |
| 26 | { | |
| 27 | /** The violating object. */ | |
| 28 | private Object sourceObject; | |
| 29 | ||
| 30 | /** | |
| 31 | * Creates a new exception instance. | |
| 32 | */ | |
| 33 | public OptimisticLockException() | |
| 34 | { | |
| 35 | super(); | |
| 36 | } | |
| 37 | ||
| 38 | /** | |
| 39 | * Creates a new exception instance. | |
| 40 | * | |
| 41 | * @param msg The exception message | |
| 42 | */ | |
| 43 | public OptimisticLockException(String msg) | |
| 44 | { | |
| 45 | super(msg); | |
| 46 | } | |
| 47 | ||
| 48 | /** | |
| 49 | * Creates a new exception instance. | |
| 50 | * | |
| 51 | * @param msg The exception message | |
| 52 | * @param source The violating object | |
| 53 | */ | |
| 54 | public OptimisticLockException(String msg, Object source) | |
| 55 | { | |
| 56 | super(msg); | |
| 57 | sourceObject = source; | |
| 58 | } | |
| 59 | ||
| 60 | /** | |
| 61 | * Creates a new exception instance. | |
| 62 | * | |
| 63 | * @param cause The base exception | |
| 64 | */ | |
| 65 | public OptimisticLockException(Throwable cause) | |
| 66 | { | |
| 67 | super(cause); | |
| 68 | } | |
| 69 | ||
| 70 | /** | |
| 71 | * Gets the violating object. | |
| 72 | * | |
| 73 | * @return The object | |
| 74 | */ | |
| 75 | public Object getSourceObject() | |
| 76 | { | |
| 77 | return sourceObject; | |
| 78 | } | |
| 79 | ||
| 80 | /** | |
| 81 | * Sets the violating object. | |
| 82 | * | |
| 83 | * @param sourceObject The object | |
| 84 | */ | |
| 85 | public void setSourceObject(Object sourceObject) | |
| 86 | { | |
| 87 | this.sourceObject = sourceObject; | |
| 88 | } | |
| 89 | ||
| 90 | } |