Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractTemplateLoader |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (C) 1998-2000 Semiotek Inc. All Rights Reserved. | |
3 | * | |
4 | * Redistribution and use in source and binary forms, with or without | |
5 | * modification, are permitted under the terms of either of the following | |
6 | * Open Source licenses: | |
7 | * | |
8 | * The GNU General Public License, version 2, or any later version, as | |
9 | * published by the Free Software Foundation | |
10 | * (http://www.fsf.org/copyleft/gpl.html); | |
11 | * | |
12 | * or | |
13 | * | |
14 | * The Semiotek Public License (http://webmacro.org/LICENSE.) | |
15 | * | |
16 | * This software is provided "as is", with NO WARRANTY, not even the | |
17 | * implied warranties of fitness to purpose, or merchantability. You | |
18 | * assume all risks and liabilities associated with its use. | |
19 | * | |
20 | * See www.webmacro.org for more information on the WebMacro project. | |
21 | */ | |
22 | package org.webmacro.resource; | |
23 | ||
24 | import org.slf4j.Logger; | |
25 | import org.slf4j.LoggerFactory; | |
26 | import org.webmacro.Broker; | |
27 | import org.webmacro.InitException; | |
28 | import org.webmacro.util.Settings; | |
29 | ||
30 | /** | |
31 | * Abstract implementation of TemplateLoader, that stores broker | |
32 | * and path and provides a ReloadDelayDecorator and a common log | |
33 | * object. | |
34 | * @author Sebastian Kanthak <skanthak@muehlheim.de> | |
35 | */ | |
36 | 0 | public abstract class AbstractTemplateLoader implements TemplateLoader |
37 | { | |
38 | ||
39 | /** Our broker */ | |
40 | protected Broker broker; | |
41 | ||
42 | /** Logger to use */ | |
43 | 0 | static Logger _log = LoggerFactory.getLogger(AbstractTemplateLoader.class); |
44 | ||
45 | /** Helper class for loading templates from files or URLs */ | |
46 | protected TemplateLoaderHelper helper; | |
47 | ||
48 | /** | |
49 | * Sets up broker, reloadDelayDecorator and log. | |
50 | * Don't forget to call super.init() if you override this | |
51 | * method. | |
52 | */ | |
53 | public void init (Broker b, Settings config) throws InitException | |
54 | { | |
55 | 0 | this.broker = b; |
56 | 0 | helper = new TemplateLoaderHelper(); |
57 | 0 | helper.init(b, config); |
58 | 0 | } |
59 | } |