1 10 11 package org.mule.impl.container; 12 13 import java.io.Reader ; 14 15 import org.mule.umo.manager.ObjectNotFoundException; 16 import org.mule.util.ClassUtils; 17 18 24 public class MuleContainerContext extends AbstractContainerContext 25 { 26 public static final String MULE_CONTAINER_NAME = "mule"; 27 28 public MuleContainerContext() 29 { 30 super(MULE_CONTAINER_NAME); 31 } 32 33 38 public Object getComponent(Object key) throws ObjectNotFoundException 39 { 40 if (key == null) 41 { 42 throw new ObjectNotFoundException("Component not found for null key"); 43 } 44 try 45 { 46 Class clazz; 47 if (key instanceof Class ) 48 { 49 clazz = (Class )key; 50 } 51 else 52 { 53 clazz = ClassUtils.loadClass(key.toString(), getClass()); 54 } 55 return clazz.newInstance(); 56 } 57 catch (Exception e) 58 { 59 throw new ObjectNotFoundException(key.toString() + " (" + e.getMessage() + ")"); 60 } 61 } 62 63 public void configure(Reader configuration) 64 { 65 throw new UnsupportedOperationException ("configure(Reader)"); 66 } 67 68 } 69 | Popular Tags |