1 /*
2 * $Id: CollResourcesFactory.java 354761 2005-12-07 15:11:58Z niallp $
3 * $Revision: 354761 $
4 * $Date: 2005-12-07 15:11:58 +0000 (Wed, 07 Dec 2005) $
5 *
6 * ====================================================================
7 *
8 * Copyright 2003-2005 The Apache Software Foundation
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */
23
24 package org.apache.commons.resources.impl;
25
26 import org.apache.commons.resources.Resources;
27 import org.apache.commons.resources.ResourcesException;
28
29 /**
30 * <p>Concrete implementation of {@link ResourcesFactory} for unit tests.</p>
31 */
32 public class CollResourcesFactory extends ResourcesFactoryBase {
33
34
35 // --------------------------------------------------------- Public Methods
36
37
38 // ------------------------------------------------------ Protected Methods
39
40
41 /**
42 * <p>Create and return a new {@link Resources} instance with the
43 * specified logical name, after calling its <code>init()</code>
44 * method.</p>
45 *
46 * @param name Logical name of the {@link Resources} instance to create
47 * @param config Configuration string for this resource (if any)
48 *
49 * @exception ResourcesException if a {@link Resources} instance
50 * of the specified logical name cannot be created.
51 */
52 protected Resources createResources(String name, String config)
53 throws ResourcesException {
54
55 Resources res = new CollResources(name, config);
56 res.init();
57 res.setReturnNull(isReturnNull());
58 return (res);
59
60 }
61
62
63 }