Attached is the new CatalogFactory interface that I proposed a while back. I welcome any comments, concerns or objections. I will be providing a default implentation (as Craig has suggested) but I'd like to get feedback on the interface first.

Thanks,
sean
/*
 * Copyright 1999-2004 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.chain;

/**
 * <p>A [EMAIL PROTECTED] CatalogFactory} is a class used to store and retrieve [EMAIL PROTECTED] Catalog}s.  The factory allows for a default 
 * [EMAIL PROTECTED] Catalog} as well as [EMAIL PROTECTED] Catalog}s stored with a name key.  Follows the Factory pattern (see GoF).</p>
 *
 * @author Sean Schofield 
 * @version 
 */
public interface CatalogFactory {

    /**
     * Returns a instance of CatalogFactory.  
     * @return an instance of CatalogFactory
     */
    public CatalogFactory getInstance();

    /**
     * Gets the default instance of Catalog associated with the factory.
     * @return the default Catalog instance
     */
    public Catalog getCatalog();

    /**
     * Sets the default instance of Catalog associated with the factory.
     * @param catalog the default Catalog instance
     */
    public void setCatalog(Catalog catalog);

    /**
     * Retrieves a Catalog instance by name.
     * @param name the name of the Catalog to retrieve
     * @return the specified Catalog
     */
    public Catalog getCatalog(String name);

    /**
     * Adds a named instance of Catalog to the factory (for subsequent retrieval later).
     * @param name the name of the Catalog to add
     * @param catalog the Catalog to add
     */
    public void addCatalog(String name, Catalog catalog);
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to