1 // re/mind - Remote Reminder Software
2 // Copyright (C) 2002 Moritz Petersen
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 //
18 // $Id: Storage.java,v 1.1.1.1 2002/09/29 17:26:04 powerpete Exp $
19 package de.jface.remind.io;
20
21 import de.jface.remind.Config;
22
23 import java.util.Collection;
24
25 import org.apache.log4j.Logger;
26
27 /***
28 * The <code>Storage</code>...
29 *
30 * @author Moritz Petersen
31 * @version $Revision: 1.1.1.1 $
32 */
33 public abstract class Storage
34 {
35 private static final Logger log4j = Logger.getLogger(Storage.class);
36
37 public abstract Collection readNotes()
38 throws StorageException;
39
40 public abstract void writeNotes(Collection notes)
41 throws StorageException;
42
43 /***
44 * Returns the Storage instance.
45 */
46 public static Storage getInstance()
47 {
48 try
49 {
50 return (Storage) Class.forName(Config.STORAGE_CLASS).newInstance();
51 }
52 catch (Exception e)
53 {
54 log4j.fatal("Unable to create instance", e);
55
56 // TODO: Throw an exception?
57 return null;
58 }
59 }
60 }
This page was automatically generated by Maven