avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util ContextManager.java ExcaliburRoleManager.java OverridableContext.java
Date Wed, 24 Apr 2002 18:33:18 GMT
proyal      02/04/24 11:33:18

  Modified:    fortress/src/java/org/apache/excalibur/fortress/util
                        ContextManager.java ExcaliburRoleManager.java
                        OverridableContext.java
  Log:
   * ExcaliburRoleManager: Fixed SourceResolver to new package name
   * ContextManager: Fixed SourceResolver usages + enabled creation of RoleManager from config
or URI
   * OverridableContext: Actually override get/put now
  
  Revision  Changes    Path
  1.16      +30 -23    jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ContextManager.java	13 Apr 2002 01:39:57 -0000	1.15
  +++ ContextManager.java	24 Apr 2002 18:33:18 -0000	1.16
  @@ -16,10 +16,6 @@
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.avalon.excalibur.mpool.DefaultPoolManager;
   import org.apache.avalon.excalibur.mpool.PoolManager;
  -import org.apache.avalon.excalibur.source.ResourceSourceFactory;
  -import org.apache.avalon.excalibur.source.Source;
  -import org.apache.avalon.excalibur.source.SourceResolver;
  -import org.apache.avalon.excalibur.source.SourceResolverImpl;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.component.ComponentManager;
  @@ -34,6 +30,10 @@
   import org.apache.avalon.framework.context.DefaultContext;
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceResolver;
  +import org.apache.excalibur.source.impl.ResourceSourceFactory;
  +import org.apache.excalibur.source.impl.SourceResolverImpl;
   
   /**
    * The ContextManager is used to manage the values in a Container's Context.
  @@ -60,7 +60,8 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  - * @version CVS $Revision: 1.15 $ $Date: 2002/04/13 01:39:57 $
  + * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  + * @version CVS $Revision: 1.16 $ $Date: 2002/04/24 18:33:18 $
    * @since 4.1
    */
   public class ContextManager implements ContextManagerConstants
  @@ -345,29 +346,35 @@
           {
           }
   
  -        // Attempt to load config...
  -        //if (config == null)
  -        //{
  +        Configuration config = getConfiguration(ROLE_MANAGER_CONFIGURATION, ROLE_MANAGER_CONFIGURATION_URI);
   
  -        // See if we can inherit from the parent...
  -        try
  +        if (config == null)
           {
  -            childContext.get( ROLE_MANAGER );
  +            // See if we can inherit from the parent...
  +            try
  +            {
  +                childContext.get( ROLE_MANAGER );
   
  -            // OK, done.
  -            return;
  -        }
  -        catch( ContextException ce )
  -        {
  -            // No RoleManager available anywhere. (Set one up.)
  +                // OK, done.
  +                return;
  +            }
  +            catch( ContextException ce )
  +            {
  +                // No RoleManager available anywhere. (Set one up.)
  +
  +                RoleManager rm = new ExcaliburRoleManager();
  +
  +                assumeOwnership( rm );
  +                childContext.put( ROLE_MANAGER, rm );
  +
  +                return;
  +            }
           }
  -        //}
   
  -        //
  -        // TODO: Load configuration from ROLE_MANAGER_CONFIGURATION or ROLE_MANAGER_CONFIGURATION_URI
  -        //       and create a proper RM from those (ERM?). /LS
  -        //
  -        RoleManager rm = new ExcaliburRoleManager();
  +        ConfigurableRoleManager rm = new ConfigurableRoleManager(new ExcaliburRoleManager());
  +
  +        rm.configure(config);
  +
           assumeOwnership( rm );
           childContext.put( ROLE_MANAGER, rm );
       }
  
  
  
  1.9       +6 -5      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ExcaliburRoleManager.java
  
  Index: ExcaliburRoleManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ExcaliburRoleManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExcaliburRoleManager.java	13 Apr 2002 01:39:57 -0000	1.8
  +++ ExcaliburRoleManager.java	24 Apr 2002 18:33:18 -0000	1.9
  @@ -15,7 +15,8 @@
    * information is hard-coded.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.8 $ $Date: 2002/04/13 01:39:57 $
  + * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  + * @version CVS $Revision: 1.9 $ $Date: 2002/04/24 18:33:18 $
    * @since 4.1
    */
   public class ExcaliburRoleManager
  @@ -26,7 +27,7 @@
        */
       public ExcaliburRoleManager()
       {
  -        super( null );
  +        this( null );
       }
   
       /**
  @@ -37,7 +38,7 @@
        */
       public ExcaliburRoleManager( RoleManager parent )
       {
  -        super( parent, Thread.currentThread().getContextClassLoader() );
  +        this( parent, Thread.currentThread().getContextClassLoader() );
       }
   
       /**
  @@ -106,8 +107,8 @@
   
           /* Set up SourceResolver relations */
           setup( shorts, classes, handlers, "resolver",
  -               "org.apache.avalon.excalibur.source.SourceResolver",
  -               "org.apache.avalon.excalibur.source.SourceResolverImpl",
  +               "org.apache.excalibur.source.SourceResolver",
  +               "org.apache.excalibur.source.impl.SourceResolverImpl",
                  "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler" );
   
           /* Set up XML parser relations */
  
  
  
  1.7       +3 -3      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/OverridableContext.java
  
  Index: OverridableContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/OverridableContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- OverridableContext.java	4 Apr 2002 16:04:28 -0000	1.6
  +++ OverridableContext.java	24 Apr 2002 18:33:18 -0000	1.7
  @@ -16,7 +16,7 @@
    * in a parent context.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.6 $ $Date: 2002/04/04 16:04:28 $
  + * @version CVS $Revision: 1.7 $ $Date: 2002/04/24 18:33:18 $
    * @since 4.1
    */
   public final class OverridableContext extends DefaultContext
  @@ -33,7 +33,7 @@
           super( parent );
       }
   
  -    public Object get( String key )
  +    public Object get( Object key )
           throws ContextException
       {
           Object value = super.get( key );
  @@ -46,7 +46,7 @@
           return value;
       }
   
  -    public void put( String key, Object value )
  +    public void put( Object key, Object value )
       {
           super.put( key, ( value == null ) ? new Null() : value );
       }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message