juergen     01/04/03 06:42:37

  Modified:    src/share/org/apache/slide/common Namespace.java
  Log:
  added an additional method getStore, which does not perform a connect (see 
retrieveStore)
  
  Revision  Changes    Path
  1.28      +29 -9     jakarta-slide/src/share/org/apache/slide/common/Namespace.java
  
  Index: Namespace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Namespace.java    2001/04/03 08:43:36     1.27
  +++ Namespace.java    2001/04/03 13:42:37     1.28
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.27 
2001/04/03 08:43:36 juergen Exp $
  - * $Revision: 1.27 $
  - * $Date: 2001/04/03 08:43:36 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/Namespace.java,v 1.28 
2001/04/03 13:42:37 juergen Exp $
  + * $Revision: 1.28 $
  + * $Date: 2001/04/03 13:42:37 $
    *
    * ====================================================================
    *
  @@ -93,7 +93,7 @@
    * Namespace class.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
  - * @version $Revision: 1.27 $
  + * @version $Revision: 1.28 $
    */
   public final class Namespace {
       
  @@ -213,14 +213,16 @@
       }
       
       
  +    
       /**
  -     ** Get all scopes managed by this namespace.
  +     ** Enumerate all scopes managed by this namespace.
        **
        ** @return     return an enumeration of all scopes
        **/
  -    public Enumeration getScopes() {
  +    public Enumeration enumerateScopes() {
           return stores.keys();
       }
  +
       
       
       /**
  @@ -488,8 +490,27 @@
       }
       
       
  +    
  +    
       /**
        * Get the Data Source associated with the given scope, if any.
  +     * In contrary to the retrieveStore method, this methos does not
  +     * perform a connection.
  +     *
  +     * @param scope Scope to match
  +     */
  +    public Store getStore(Scope scope) {
  +        Store store = null;
  +        if (stores.containsKey(scope)) {
  +            store = (Store) stores.get(scope);
  +        }
  +        return store;
  +    }
  +    
  +    
  +    /**
  +     * Get the Data Source associated with the given scope, if any and
  +     * connect to the store.
        *
        * @param scope Scope to match
        * @exception ServiceConnectionFailedException Connection to Store failed
  @@ -497,9 +518,8 @@
        */
       public Store retrieveStore(Scope scope)
           throws ServiceConnectionFailedException, ServiceAccessException {
  -        Store store = null;
  -        if (stores.containsKey(scope)) {
  -            store = (Store) stores.get(scope);
  +        Store store = getStore(scope);
  +        if (store != null) {
               connectService(store);
           }
           return store;
  
  
  

Reply via email to