1 23 24 package org.objectweb.fractal.adl.implementations; 25 26 import java.util.HashMap ; 27 import java.util.Map ; 28 29 32 33 public class JavaImplementationBuilder implements ImplementationBuilder { 34 35 39 public Object createComponent ( 40 final Object type, 41 final String name, 42 final String definition, 43 final Object controllerDesc, 44 final Object contentDesc, 45 final Object context) throws Exception 46 { 47 ClassLoader loader = null; 48 if (context instanceof Map ) { 49 loader = (ClassLoader )((Map )context).get("classloader"); 50 } 51 if (loader == null) { 52 loader = getClass().getClassLoader(); 53 } 54 55 if (contentDesc == null) { 56 return new HashMap (); 57 } else { 58 String c = (String )contentDesc; 59 return loader.loadClass(c).newInstance(); 60 } 61 } 62 } 63 | Popular Tags |