use of org.apache.catalina.core.ServletRegistrationImpl in project Payara by payara.
the class DynamicWebServletRegistrationImpl method contextListenerStart.
@Override
protected void contextListenerStart() {
ServletContext servletContext = getServletContext();
WebBundleDescriptor wbd = getWebBundleDescriptor();
try {
// for jsf injection
servletContext.setAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE, getWebModuleConfig().getDeploymentContext());
// null check for OSGi/HTTP
if (wbd != null) {
servletContext.setAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE, wbd.isDistributable());
}
servletContext.setAttribute(Constants.ENABLE_HA_ATTRIBUTE, Boolean.valueOf(webContainer.getServerConfigLookup().calculateWebAvailabilityEnabledFromConfig(this)));
super.contextListenerStart();
} finally {
servletContext.removeAttribute(Constants.DEPLOYMENT_CONTEXT_ATTRIBUTE);
servletContext.removeAttribute(Constants.IS_DISTRIBUTABLE_ATTRIBUTE);
servletContext.removeAttribute(Constants.ENABLE_HA_ATTRIBUTE);
}
for (ServletRegistrationImpl srImpl : servletRegisMap.values()) {
if (srImpl instanceof DynamicWebServletRegistrationImpl) {
DynamicWebServletRegistrationImpl dwsrImpl = (DynamicWebServletRegistrationImpl) srImpl;
dwsrImpl.postProcessAnnotations();
}
}
webContainer.afterServletContextInitializedEvent(wbd);
}
Aggregations