avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: avalon-excalibur/fortress/container-impl/src/java/org/apache/avalon/fortress/impl DefaultECMContainer.java
Date Mon, 05 Apr 2004 11:07:09 GMT
cziegeler    2004/04/05 04:07:09

  Modified:    fortress/container-impl/src/java/org/apache/avalon/fortress/util
                        ContextManager.java
               fortress/container-impl/src/java/org/apache/avalon/fortress/impl
                        DefaultECMContainer.java
  Log:
  ECM Support for roles containing hints
  
  Revision  Changes    Path
  1.54      +18 -7     avalon-excalibur/fortress/container-impl/src/java/org/apache/avalon/fortress/util/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/container-impl/src/java/org/apache/avalon/fortress/util/ContextManager.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- ContextManager.java	3 Apr 2004 18:10:34 -0000	1.53
  +++ ContextManager.java	5 Apr 2004 11:07:08 -0000	1.54
  @@ -22,6 +22,7 @@
   import org.apache.avalon.fortress.MetaInfoManager;
   import org.apache.avalon.fortress.RoleManager;
   import org.apache.avalon.fortress.impl.role.ConfigurableRoleManager;
  +import org.apache.avalon.fortress.impl.role.ECMRoleManager;
   import org.apache.avalon.fortress.impl.role.FortressRoleManager;
   import org.apache.avalon.fortress.impl.role.Role2MetaInfoManager;
   import org.apache.avalon.fortress.impl.role.ServiceMetaManager;
  @@ -665,13 +666,23 @@
                   roleManager = newRoleManager;
               }
   
  -            final ServiceMetaManager metaManager =
  -                    new ServiceMetaManager( new Role2MetaInfoManager( roleManager ), classLoader
);
  +            final MetaInfoManager mim;
  +            // if we use the ecm role manager then we don't wrap it inside a service meta
manager!
  +            if ( roleManager instanceof ECMRoleManager )
  +            {
  +                mim = new Role2MetaInfoManager( roleManager );                
  +            }
  +            else
  +            {
  +                final ServiceMetaManager metaManager =
  +                      new ServiceMetaManager( new Role2MetaInfoManager( roleManager ),
classLoader );
  +                metaManager.enableLogging( m_loggerManager.getLoggerForCategory( "system.meta"
) );
  +                metaManager.initialize();
  +                mim = metaManager;
  +            }
   
  -            metaManager.enableLogging( m_loggerManager.getLoggerForCategory( "system.meta"
) );
  -            metaManager.initialize();
  -            assumeOwnership( metaManager );
  -            m_metaInfoManager = metaManager;
  +            assumeOwnership( mim );
  +            m_metaInfoManager = mim;
           }
       }
   
  
  
  
  1.4       +6 -2      avalon-excalibur/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultECMContainer.java
  
  Index: DefaultECMContainer.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/container-impl/src/java/org/apache/avalon/fortress/impl/DefaultECMContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultECMContainer.java	5 Apr 2004 10:16:56 -0000	1.3
  +++ DefaultECMContainer.java	5 Apr 2004 11:07:09 -0000	1.4
  @@ -145,8 +145,12 @@
                   new ComponentHandlerMetaData( hint, className, element, activation );
   
               // figure out Role
  -            final String role = getRole( element );
  -
  +            String role = getRole( element );
  +            final int pos = role.indexOf('/');
  +            if ( pos != -1 ) {
  +                hint = role.substring(pos+1);
  +                role = role.substring(0, pos);
  +            }
               try 
               {
                   final MetaInfoEntry metaEntry = m_metaManager.getMetaInfoForClassname(
className );
  
  
  

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


Mime
View raw message