StandortPrueferFactory.java
01 /*
02  * Created on 01.04.2004
03  */
04 package de.fub.tip.datenbank.factory;
05 
06 import javax.sql.DataSource;
07 
08 import de.fub.tip.datenbank.logik.StandortPruefer;
09 
10 /**
11  * Sinn: Fabrik zur Herstellung von <code>StandortPruefer</code>
12  * -Objekten
13  
14  @see de.fub.tip.datenbank.logik.StandortPruefer
15  
16  @author hirsch, 01.04.2004
17  @version 2004-04-01
18  * $Id: StandortPrueferFactory.java,v 1.1 2004/04/01 15:44:24 hirsch Exp $
19  
20  */
21 public class StandortPrueferFactory implements LogicFactory {
22   /** die eigentliche Singleton-Instanz */
23   private static StandortPrueferFactory instance = null;
24   /** Datenquelle, auf der das Logikobjekt arbeitet, das von der Fabrik gebaut wird*/
25   private DataSource datasource = null;
26 
27   /**
28    * erzeugt eine Fabrik als Singleton mit der übergebenen Datenquelle
29    @param ds Datenquelle für die Fabrik
30    */
31   private StandortPrueferFactory(DataSource ds) {
32     this.datasource = ds;
33   // end of class
34   
35   /**
36    
37    @param ds Datenquelle zum Weiterreichen an die Logk-Instanzen
38    @return FabrikObjekt
39    */
40   public static StandortPrueferFactory getInstance(DataSource ds) {
41     if (instance == nullinstance = new StandortPrueferFactory(ds);
42     return instance;
43   }  // end of getInstance
44 
45   /**
46    * gibt einen <code>StandortPruefer</code> zurück
47    @see de.fub.tip.datenbank.factory.LogicFactory#getLogicObject()
48    */
49   public LogicObject getLogicObject() {
50     return new StandortPruefer(this.datasource);
51   // end of getLogicObject
52 // end of class