public synchronized Class getClass(String type) { if (!initialized) { initialize(); } Class clazz = (Class) this.classes.get(type); if (clazz == null) { clazz = ClassUtil.forName(type); this.classes.put(type, clazz); } return clazz; }
public S2Container build(String path) { try { S2Container container = new S2ContainerImpl(); Properties props = new Properties(); props.load(ResourceUtil.getResourceAsStream(path)); for (Iterator it = props.keySet().iterator(); it.hasNext(); ) { String name = (String) it.next(); container.register(ClassUtil.forName(props.getProperty(name)), name); } return container; } catch (IOException e) { throw new RuntimeException(e); } }