001 /* 002 * $Id: CollResourcesFactory.java 354761 2005-12-07 15:11:58Z niallp $ 003 * $Revision: 354761 $ 004 * $Date: 2005-12-07 15:11:58 +0000 (Wed, 07 Dec 2005) $ 005 * 006 * ==================================================================== 007 * 008 * Copyright 2003-2005 The Apache Software Foundation 009 * 010 * Licensed under the Apache License, Version 2.0 (the "License"); 011 * you may not use this file except in compliance with the License. 012 * You may obtain a copy of the License at 013 * 014 * http://www.apache.org/licenses/LICENSE-2.0 015 * 016 * Unless required by applicable law or agreed to in writing, software 017 * distributed under the License is distributed on an "AS IS" BASIS, 018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 019 * See the License for the specific language governing permissions and 020 * limitations under the License. 021 * 022 */ 023 024 package org.apache.commons.resources.impl; 025 026 import org.apache.commons.resources.Resources; 027 import org.apache.commons.resources.ResourcesException; 028 029 /** 030 * <p>Concrete implementation of {@link ResourcesFactory} for unit tests.</p> 031 */ 032 public class CollResourcesFactory extends ResourcesFactoryBase { 033 034 035 // --------------------------------------------------------- Public Methods 036 037 038 // ------------------------------------------------------ Protected Methods 039 040 041 /** 042 * <p>Create and return a new {@link Resources} instance with the 043 * specified logical name, after calling its <code>init()</code> 044 * method.</p> 045 * 046 * @param name Logical name of the {@link Resources} instance to create 047 * @param config Configuration string for this resource (if any) 048 * 049 * @exception ResourcesException if a {@link Resources} instance 050 * of the specified logical name cannot be created. 051 */ 052 protected Resources createResources(String name, String config) 053 throws ResourcesException { 054 055 Resources res = new CollResources(name, config); 056 res.init(); 057 res.setReturnNull(isReturnNull()); 058 return (res); 059 060 } 061 062 063 }