use of org.glassfish.web.deployment.runtime.SessionManager in project Payara by payara.
the class DynamicWebServletRegistrationImpl method configureSessionSettings.
/**
* Create and configure the session manager for this web application
* according to the persistence type specified.
*
* Also configure the other aspects of session management for this
* web application according to the values specified in the session-config
* element of sun-web.xml (and whether app is distributable)
*/
protected void configureSessionSettings(WebBundleDescriptor wbd, WebModuleConfig wmInfo) {
SessionConfig cfg = null;
SessionManager smBean = null;
SessionProperties sessionPropsBean = null;
CookieProperties cookieBean = null;
if (iasBean != null) {
cfg = iasBean.getSessionConfig();
if (cfg != null) {
smBean = cfg.getSessionManager();
sessionPropsBean = cfg.getSessionProperties();
cookieBean = cfg.getCookieProperties();
}
}
configureSessionManager(smBean, wbd, wmInfo);
configureSession(sessionPropsBean, wbd);
configureCookieProperties(cookieBean);
}
use of org.glassfish.web.deployment.runtime.SessionManager in project Payara by payara.
the class WebApplication method stopCoherenceWeb.
private void stopCoherenceWeb() {
if (wmInfo.getDescriptor() != null && wmInfo.getDescriptor().getSunDescriptor() != null) {
SunWebAppImpl sunWebApp = (SunWebAppImpl) wmInfo.getDescriptor().getSunDescriptor();
if (sunWebApp.getSessionConfig() != null && sunWebApp.getSessionConfig().getSessionManager() != null) {
SessionManager sessionManager = sunWebApp.getSessionConfig().getSessionManager();
String persistenceType = sessionManager.getAttributeValue(SessionManager.PERSISTENCE_TYPE);
if (PersistenceType.COHERENCE_WEB.getType().equals(persistenceType)) {
ClassLoader cloader = wmInfo.getAppClassLoader();
try {
Class<?> cacheFactoryClass = cloader.loadClass("com.tangosol.net.CacheFactory");
if (cacheFactoryClass != null) {
Method shutdownMethod = cacheFactoryClass.getMethod("shutdown");
if (shutdownMethod != null) {
shutdownMethod.invoke(null);
}
}
} catch (Exception ex) {
if (logger.isLoggable(Level.WARNING)) {
String msg = rb.getString(LogFacade.EXCEPTION_SHUTDOWN_COHERENCE_WEB);
msg = MessageFormat.format(msg, wmInfo.getDescriptor().getName());
logger.log(Level.WARNING, msg, ex);
}
}
}
}
}
}
Aggregations