KernelController controller = kernel.getController();
try
{
AbstractBeanMetaData bean = new AbstractBeanMetaData("bean", RareBean.class.getName());
bean.setMode(ControllerMode.MANUAL);
DemandMetaData demand = new AbstractDemandMetaData("foobar");
((AbstractDemandMetaData)demand).setWhenRequired(ControllerState.INSTANTIATED);
bean.setDemands(Collections.singleton(demand));
KernelControllerContext beanContext = controller.install(bean);
controller.change(beanContext, ControllerState.NOT_INSTALLED);