* @param servletContext the servlet context to be passed down
* @param eventClass the class to be passed down into the dispatching
* code
*/
private void dispatchInitDestroyEvent(Object servletContext, Class eventClass) {
ApplicationFactory appFac = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
FacesContext fc = null;
fc = FacesContext.getCurrentInstance();
if (fc == null) {
LifecycleFactory lifeFac = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
FacesContextFactory facFac = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
fc = facFac.getFacesContext(servletContext, new _SystemEventServletRequest(), new _SystemEventServletResponse(), lifeFac.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE));
}
appFac.getApplication().publishEvent(fc, eventClass, Application.class, appFac.getApplication());
}