commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/chain/src/java/org/apache/commons/chain CatalogFactory.java
Date Sun, 17 Oct 2004 01:23:02 GMT
craigmcc    2004/10/16 18:23:02

  Modified:    chain/src/java/org/apache/commons/chain CatalogFactory.java
  Log:
  Per discussion on the Commons Developer list, remove the getInstance() method
  that doesn't really belong here.  Also, add a getNames() method to iterate
  over the names of all known catalogs, similar to how Catalog can iterate over
  the names of all known commands.
  
  Finally, change line endings from DOS to UNIX (which will probably make the
  diff report unreadable, but only this time) since I'm committing on a Unix
  system.
  
  Revision  Changes    Path
  1.2       +80 -76    jakarta-commons/chain/src/java/org/apache/commons/chain/CatalogFactory.java
  
  Index: CatalogFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/chain/src/java/org/apache/commons/chain/CatalogFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CatalogFactory.java	2 Oct 2004 19:20:55 -0000	1.1
  +++ CatalogFactory.java	17 Oct 2004 01:23:01 -0000	1.2
  @@ -1,76 +1,80 @@
  -/*
  - * 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 {@link CatalogFactory} is a class used to store and retrieve
  - * {@link Catalog}s.  The factory allows for a default {@link Catalog}
  - * as well as {@link Catalog}s stored with a name key.  Follows the
  - * Factory pattern (see GoF).</p>
  - *
  - * @author Sean Schofield 
  - * @version $Revision$ $Date$
  - */
  -
  -public interface CatalogFactory {
  -
  -
  -    /**
  -     * <p>Returns a instance of CatalogFactory.</p>
  -     *
  -     * @return an instance of CatalogFactory
  -     */
  -    public CatalogFactory getInstance();
  -
  -
  -    /**
  -     * <p>Gets the default instance of Catalog associated with the factory.</p>
  -     *
  -     * @return the default Catalog instance
  -     */
  -    public Catalog getCatalog();
  -
  -
  -    /**
  -     * <p>Sets the default instance of Catalog associated with the factory.</p>
  -     *
  -     * @param catalog the default Catalog instance
  -     */
  -    public void setCatalog(Catalog catalog);
  -
  -
  -    /**
  -     * <p>Retrieves a Catalog instance by name.</p>
  -     *
  -     * @param name the name of the Catalog to retrieve
  -     * @return the specified Catalog
  -     */
  -    public Catalog getCatalog(String name);
  -
  -
  -    /**
  -     * <p>Adds a named instance of Catalog to the factory (for subsequent
  -     * retrieval later).</p>
  -     *
  -     * @param name the name of the Catalog to add
  -     * @param catalog the Catalog to add
  -     */
  -    public void addCatalog(String name, Catalog catalog);
  -
  -
  -}
  -
  -
  +/*
  + * 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;
  +
  +
  +import java.util.Iterator;
  +
  +
  +/**
  + * <p>A {@link CatalogFactory} is a class used to store and retrieve
  + * {@link Catalog}s.  The factory allows for a default {@link Catalog}
  + * as well as {@link Catalog}s stored with a name key.  Follows the
  + * Factory pattern (see GoF).</p>
  + *
  + * @author Sean Schofield 
  + * @version $Revision$ $Date$
  + */
  +
  +public interface CatalogFactory {
  +
  +
  +    /**
  +     * <p>Gets the default instance of Catalog associated with the factory.</p>
  +     *
  +     * @return the default Catalog instance
  +     */
  +    public Catalog getCatalog();
  +
  +
  +    /**
  +     * <p>Sets the default instance of Catalog associated with the factory.</p>
  +     *
  +     * @param catalog the default Catalog instance
  +     */
  +    public void setCatalog(Catalog catalog);
  +
  +
  +    /**
  +     * <p>Retrieves a Catalog instance by name.</p>
  +     *
  +     * @param name the name of the Catalog to retrieve
  +     * @return the specified Catalog
  +     */
  +    public Catalog getCatalog(String name);
  +
  +
  +    /**
  +     * <p>Adds a named instance of Catalog to the factory (for subsequent
  +     * retrieval later).</p>
  +     *
  +     * @param name the name of the Catalog to add
  +     * @param catalog the Catalog to add
  +     */
  +    public void addCatalog(String name, Catalog catalog);
  +
  +
  +    /**
  +     * <p>Return an <code>Iterator</code> over the set of named
  +     * {@link Catalog}s known to this {@link CatalogFactory}.
  +     * If there are no known catalogs, an empty Iterator is returned.</p>
  +     */
  +    public Iterator getNames();
  +
  +
  +}
  +
  +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message