Map<String, Object> applicationMap = externalContext.getApplicationMap();
Application application = facesContext.getApplication();
// get RuntimeConfig and LifecycleProvider
RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext);
LifecycleProvider lifecycleProvider = LifecycleProviderFactory
.getLifecycleProviderFactory(externalContext).getLifecycleProvider(externalContext);
// create ManagedBeanDestroyer
ManagedBeanDestroyer mbDestroyer
= new ManagedBeanDestroyer(lifecycleProvider, runtimeConfig);