final KernelController controller = getController();
try
{
AbstractBeanMetaData guicePlugin = new AbstractBeanMetaData("GuicePlugin", GuiceKernelRegistryEntryPlugin.class.getName());
AbstractConstructorMetaData constructor = new AbstractConstructorMetaData();
AbstractArrayMetaData arrayMetaData = new AbstractArrayMetaData();
final Singleton singleton = new Singleton();
final Key<Prototype> prototypeKey = Key.get(Prototype.class, Names.named("prototype"));
final Prototype prototype = new Prototype();
Module module = new AbstractModule()
{
protected void configure()
{
bind(Singleton.class).toInstance(singleton);
bind(prototypeKey).toInstance(prototype);
}
};
arrayMetaData.add(new AbstractValueMetaData(module));
constructor.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(arrayMetaData)));
guicePlugin.setConstructor(constructor);
controller.install(guicePlugin);
BeanMetaData holderBean = new AbstractBeanMetaData("holder", SingletonHolder.class.getName());