taylor      2004/07/13 17:07:41

  Modified:    src/java/org/apache/jetspeed/services/registry
                        CastorRegistryService.java
  Log:
  exclude registry managed registries, even if they exist on the file system
  
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.40      +24 -1     
jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java
  
  Index: CastorRegistryService.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/registry/CastorRegistryService.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- CastorRegistryService.java        13 Jul 2004 22:53:44 -0000      1.39
  +++ CastorRegistryService.java        14 Jul 2004 00:07:40 -0000      1.40
  @@ -52,6 +52,7 @@
   import java.io.OutputStreamWriter;
   import java.io.Reader;
   import java.util.Enumeration;
  +import java.util.HashMap;
   import java.util.Hashtable;
   import java.util.Map;
   import java.util.Iterator;
  @@ -344,11 +345,17 @@
           // with at least one fragment
           try
           {
  +            Map databaseManaged = loadDatabaseManagedRegistries(serviceConf);
               ResourceService defaults = serviceConf.getResources("default");
               Iterator i = defaults.getKeys();
               while (i.hasNext())
               {
                   String name = (String) i.next();
  +                if (databaseManaged.containsKey(name))
  +                {
  +                    System.out.println("Skipping loading of registry: " + name);
  +                    continue;
  +                }
                   String fragmentFileName = defaults.getString(name);
   
                   String absFileName = new File(directory, fragmentFileName + 
extension).getCanonicalPath();
  @@ -454,6 +461,22 @@
   
       }
   
  +    protected Map loadDatabaseManagedRegistries(ResourceService serviceConf)
  +    {
  +        Map databaseManaged = new HashMap();
  +        ResourceService rs = serviceConf.getResources("database.default");        
  +        if (rs != null)
  +        {
  +            Iterator iterator = rs.getKeys();                
  +            while (iterator.hasNext())
  +            {
  +                String name = (String)iterator.next();
  +                databaseManaged.put(name, name);
  +            }
  +        }
  +        return databaseManaged;
  +    }
  +    
       protected Registry createRegistry(String name)
       {
           Registry registry = null;
  
  
  

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

Reply via email to