CtMethod getInstance = pcClass.getMethod("getInstance", "()Lorg/rhq/core/pc/PluginContainer;");
getInstance.setBody("return (org.rhq.core.pc.PluginContainer) INSTANCES.get(CURRENT_INSTANCE_NAME);");
CtMethod setContainerInstance = CtMethod.make("public static void setContainerInstance(java.lang.String name) { CURRENT_INSTANCE_NAME = name; if (!INSTANCES.containsKey((Object)name)) { INSTANCES.put(name, new org.rhq.core.pc.PluginContainer());}}", pcClass);
pcClass.addMethod(setContainerInstance);
CtMethod createContainerInstance = CtMethod.make("public static org.rhq.core.pc.PluginContainer getContainerInstance(java.lang.String name) { org.rhq.core.pc.PluginContainer inst = (org.rhq.core.pc.PluginContainer) INSTANCES.get(name); if (inst == null) { inst = new org.rhq.core.pc.PluginContainer(); INSTANCES.put(name, inst);} return inst;}", pcClass);
pcClass.addMethod(createContainerInstance);
pcClass.toClass(cl, null);