001    package hirondelle.web4j.config;
002    
003    import hirondelle.web4j.database.ConnectionSource;
004    import hirondelle.web4j.database.DAOException;
005    
006    import java.sql.Connection;
007    import java.util.Collections;
008    import java.util.Map;
009    import java.util.Set;
010    
011    /** 
012    * Implementation of {@link ConnectionSource}, required by WEB4J.
013    * 
014    * <P>This implementation returns empty and null items.
015    */
016    public final class ConnectionSrc implements ConnectionSource  {
017    
018      /** This implementation is empty.  */
019      public void init(Map<String, String> aConfig){
020        //emtpy    
021      }
022      
023      /** Returns an empty set, to indicate to web4j that no database is used in this app. */
024      public Set<String> getDatabaseNames(){
025        return Collections.EMPTY_SET;
026      }
027      
028      /** Returns null */
029      public Connection getConnection() throws DAOException {
030        return null;
031      }
032    
033      /** Returns null. */
034      public Connection getConnection(String aDatabaseName) throws DAOException {
035        return null;
036      }
037    }
038