|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ModuleEventListenerLog.java | 100% | 100% | 100% | 100% |
|
1 | /* $Id: ModuleEventListenerLog.java,v 1.2 2007/04/12 23:50:09 m31 Exp $ | |
2 | * | |
3 | * This file is part of the project "Hilbert II" - http://www.qedeq.org | |
4 | * | |
5 | * Copyright 2000-2007, Michael Meyling <mime@qedeq.org>. | |
6 | * | |
7 | * "Hilbert II" is free software; you can redistribute | |
8 | * it and/or modify it under the terms of the GNU General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | */ | |
17 | ||
18 | package org.qedeq.kernel.log; | |
19 | ||
20 | import org.qedeq.kernel.bo.module.ModuleProperties; | |
21 | ||
22 | /** | |
23 | * Listener that writes events to the {@link org.qedeq.kernel.log.QedeqLog}. | |
24 | * | |
25 | * @version $Revision: 1.2 $ | |
26 | * @author Michael Meyling | |
27 | */ | |
28 | public final class ModuleEventListenerLog implements ModuleEventListener { | |
29 | ||
30 | /** | |
31 | * Constructor. | |
32 | */ | |
33 | 3 | public ModuleEventListenerLog() { |
34 | } | |
35 | ||
36 | 17 | public void addModule(final ModuleProperties prop) { |
37 | 17 | QedeqLog.getInstance().logSuccessfulState("Module added", prop.getUrl()); |
38 | } | |
39 | ||
40 | 30 | public void stateChanged(final ModuleProperties prop) { |
41 | 30 | if (prop.getLoadingState().isFailure()) { |
42 | 7 | QedeqLog.getInstance().logFailureState("Module state changed: " |
43 | + prop.getStateDescription(), prop.getUrl(), prop.getException().getMessage()); | |
44 | } else { | |
45 | 23 | QedeqLog.getInstance().logSuccessfulState("Module state changed: " |
46 | + prop.getStateDescription(), prop.getUrl()); | |
47 | } | |
48 | } | |
49 | ||
50 | 1 | public void removeModule(final ModuleProperties prop) { |
51 | 1 | QedeqLog.getInstance().logSuccessfulState("Module removed", prop.getUrl()); |
52 | } | |
53 | ||
54 | } |
|