avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-excalibur/fortress/src/tools/org/apache/avalon/fortress/tools ComponentMetaInfoCollector.java
Date Mon, 24 Mar 2003 22:03:55 GMT
bloritsch    2003/03/24 14:03:54

  Modified:    fortress/src/java/org/apache/avalon/fortress/impl/role
                        ServiceRoleManager.java
               fortress/src/tools/org/apache/avalon/fortress/tools
                        ComponentMetaInfoCollector.java
  Log:
  first cut at making Fortress more in line with my proposal--next cut is to make avalon.component
and avalon.service behave the same
  
  Revision  Changes    Path
  1.4       +12 -10    avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceRoleManager.java
  
  Index: ServiceRoleManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceRoleManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServiceRoleManager.java	23 Mar 2003 03:00:44 -0000	1.3
  +++ ServiceRoleManager.java	24 Mar 2003 22:03:54 -0000	1.4
  @@ -64,6 +64,7 @@
   import java.util.regex.Matcher;
   import java.util.regex.Pattern;
   import org.apache.avalon.fortress.RoleManager;
  +import org.apache.avalon.fortress.impl.handler.FactoryComponentHandler;
   import org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler;
   import org.apache.avalon.fortress.impl.handler.PoolableComponentHandler;
   import org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler;
  @@ -132,19 +133,20 @@
   public class ServiceRoleManager extends AbstractRoleManager implements Initializable
   {
       /** Translate from scope to component handler */
  -    private static final Map m_scopeMap;
  +    private static final Map m_lifecycleMap;
       /** Used to split words in class names */
       private static final Pattern upperCase = Pattern.compile( "([A-Z]+)" );
   
       // Initialize the scope map
       static
       {
  -        Map scopes = new HashMap();
  -        scopes.put( "container", ThreadSafeComponentHandler.class.getName() );
  -        scopes.put( "thread", PerThreadComponentHandler.class.getName() );
  -        scopes.put( "request", PoolableComponentHandler.class.getName() );
  +        Map lifecycleMap = new HashMap();
  +        lifecycleMap.put( "thread-safe", ThreadSafeComponentHandler.class.getName() );
  +        lifecycleMap.put( "per-thread", PerThreadComponentHandler.class.getName() );
  +        lifecycleMap.put( "pooled", PoolableComponentHandler.class.getName() );
  +        lifecycleMap.put( "factory", FactoryComponentHandler.class.getName() );
   
  -        m_scopeMap = Collections.unmodifiableMap( scopes );
  +        m_lifecycleMap = Collections.unmodifiableMap( lifecycleMap );
       }
   
       /**
  @@ -271,7 +273,7 @@
               return;
           }
   
  -        String shortName = meta.getProperty( "avalon.configname", createShortName( implementation
) );
  +        String shortName = meta.getProperty( "avalon-ext.name", createShortName( implementation
) );
           String handler = getHandler( meta );
   
           addRole( shortName, role, implementation, handler );
  @@ -285,12 +287,12 @@
        */
       private String getHandler( Properties meta )
       {
  -        String scope = meta.getProperty( "avalon.scope", null );
  +        String lifecycle = meta.getProperty( "avalon-ext.lifecycle", null );
           String handler = null;
   
  -        if( null != scope )
  +        if( null != lifecycle )
           {
  -            handler = (String)m_scopeMap.get( scope );
  +            handler = (String)m_lifecycleMap.get( lifecycle );
           }
           else
           {
  
  
  
  1.2       +5 -5      avalon-excalibur/fortress/src/tools/org/apache/avalon/fortress/tools/ComponentMetaInfoCollector.java
  
  Index: ComponentMetaInfoCollector.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/tools/org/apache/avalon/fortress/tools/ComponentMetaInfoCollector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ComponentMetaInfoCollector.java	18 Mar 2003 17:11:09 -0000	1.1
  +++ ComponentMetaInfoCollector.java	24 Mar 2003 22:03:54 -0000	1.2
  @@ -208,7 +208,7 @@
        */
       private void prepareMetaInfo(Properties meta, JavaClass javaClass)
       {
  -        DocletTag avalonScope = javaClass.getTagByName("avalon.scope");
  +        DocletTag avalonScope = javaClass.getTagByName("avalon-ext.lifecycle");
           DocletTag fortressHandler = javaClass.getTagByName("fortress.handler");
           String scope = null;
           String handler = null;
  @@ -243,13 +243,13 @@
               handler = (null == fortressHandler) ? PerThreadComponentHandler.class.getName()
: fortressHandler.getValue();
           }
           
  -        if ( null != scope ) meta.setProperty("avalon.scope", scope);
  +        if ( null != scope ) meta.setProperty("avalon-ext.lifecycle", scope);
           if ( null != handler ) meta.setProperty("fortress.handler", handler);
           
  -        DocletTag avalonConfigName = javaClass.getTagByName("avalon.configname");
  -        if ( null == avalonConfigName ) avalonConfigName = javaClass.getTagByName("fortress.configname");
  +        DocletTag avalonConfigName = javaClass.getTagByName("avalon-ext.name");
  +        if ( null == avalonConfigName ) avalonConfigName = javaClass.getTagByName("fortress.name");
   
  -        meta.setProperty("avalon.configname", (avalonConfigName == null) ? ServiceRoleManager.createShortName(javaClass.getName())
: avalonConfigName.getValue() );
  +        meta.setProperty("avalon-ext.name", (avalonConfigName == null) ? ServiceRoleManager.createShortName(javaClass.getName())
: avalonConfigName.getValue() );
       }
   
       /**
  
  
  

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


Mime
View raw message