1 19 20 package org.apache.avalon.fortress.impl.role; 21 22 import java.util.ArrayList ; 23 import java.util.Properties ; 24 25 import org.apache.avalon.fortress.MetaInfoEntry; 26 import org.apache.avalon.fortress.MetaInfoManager; 27 28 34 public final class ECMMetaInfoManager extends AbstractMetaInfoManager 35 { 36 37 40 public ECMMetaInfoManager() 41 { 42 super( (MetaInfoManager) null ); 43 } 44 45 50 public ECMMetaInfoManager( final MetaInfoManager parent ) 51 { 52 super( parent ); 53 } 54 55 62 public ECMMetaInfoManager( final MetaInfoManager parent, final ClassLoader loader ) 63 { 64 super( parent, loader ); 65 } 66 67 70 public final void addSelectorComponent( final String role, 71 final String hint, 72 final String className, 73 final String handlerClassName ) 74 { 75 Properties props = new Properties (); 76 final String lifestyle; 77 if (MetaInfoEntry.THREADSAFE_HANDLER.equals(handlerClassName) ) 78 { 79 lifestyle = "singleton"; 80 } 81 else if ( MetaInfoEntry.PER_THREAD_HANDLER.equals(handlerClassName) ) 82 { 83 lifestyle = "thread"; 84 } 85 else if ( MetaInfoEntry.POOLABLE_HANDLER.equals(handlerClassName) ) 86 { 87 lifestyle = "pooled"; 88 } 89 else 90 { 91 lifestyle = "transient"; 92 } 93 94 props.setProperty("x-avalon.lifestyle", lifestyle); 95 props.setProperty("x-avalon.name", role + '/' + hint); 96 super.addComponent(role, className, props, new ArrayList ()); 97 98 } 99 } 100 | Popular Tags |