1 | /* |
2 | * Copyright 2005-2006 The RbUtils Project |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | * |
16 | */ |
17 | |
18 | // $Id: ErrorCounter.java,v 1.3 2007/07/08 01:08:12 moishi Exp $ |
19 | |
20 | package org.ktc.rbutils.api.audit; |
21 | |
22 | import org.ktc.rbutils.api.audit.event.ProcessEvent; |
23 | |
24 | /** |
25 | * A logger that keeps track of errors. It counts both <code>Error</code> and |
26 | * <code>Exception</code>. |
27 | * @since RbUtils 0.6 |
28 | * @version $Revision: 1.3 $ |
29 | * @author moishi |
30 | * @author ktcguru |
31 | */ |
32 | public final class ErrorCounter extends EventCounter { |
33 | |
34 | /** Create a new errors counter. */ |
35 | public ErrorCounter() { |
36 | // Do Nothing |
37 | } |
38 | |
39 | /** {@inheritDoc} */ |
40 | public void addError(final ProcessEvent event) { |
41 | count++; |
42 | } |
43 | |
44 | /** {@inheritDoc} */ |
45 | public void addException(final Exception exception) { |
46 | count++; |
47 | } |
48 | |
49 | } |