/** * {@code HazelcastHttpSession instance} creation is split off to a separate method to allow subclasses to return a * customized / extended version of {@code HazelcastHttpSession}. * * @param id the session id * @param originalSession the original session * @return a new HazelcastHttpSession instance */ protected HazelcastHttpSession createHazelcastHttpSession(String id, HttpSession originalSession) { return new HazelcastHttpSession(this, id, originalSession, config.isDeferredWrite(), config.isStickySession(), config.getTransientAttributes()); }
/** * {@code HazelcastHttpSession instance} creation is split off to a separate method to allow subclasses to return a * customized / extended version of {@code HazelcastHttpSession}. * * @param id the session id * @param originalSession the original session * @return a new HazelcastHttpSession instance */ protected HazelcastHttpSession createHazelcastHttpSession(String id, HttpSession originalSession) { return new HazelcastHttpSession(this, id, originalSession, config.isDeferredWrite(), config.isStickySession(), config.getTransientAttributes()); }
private static HazelcastInstance createClient(ClusteredSessionService sessionService, WebFilterConfig filterConfig) throws ServletException { LOGGER.warning("Creating a new HazelcastClient for session replication..."); LOGGER.warning("make sure this client has access to an already running cluster..."); ClientConfig clientConfig; if (filterConfig.getConfigUrl() == null) { clientConfig = new ClientConfig(); } else { try { clientConfig = new XmlClientConfigBuilder(filterConfig.getConfigUrl()).build(); } catch (IOException e) { throw new ServletException("Failed to load client config XML file [" + filterConfig.getConfigUrl() + "]:" + e.getMessage(), e); } } if (filterConfig.isStickySession()) { clientConfig.getNetworkConfig().setConnectionAttemptLimit(1); } clientConfig.addListenerConfig(new ListenerConfig(new ClientLifecycleListener(sessionService))); return HazelcastClient.newHazelcastClient(clientConfig); }
private static HazelcastInstance createClient(ClusteredSessionService sessionService, WebFilterConfig filterConfig) throws ServletException { LOGGER.warning("Creating a new HazelcastClient for session replication..."); LOGGER.warning("make sure this client has access to an already running cluster..."); ClientConfig clientConfig; if (filterConfig.getConfigUrl() == null) { clientConfig = new ClientConfig(); } else { try { clientConfig = new XmlClientConfigBuilder(filterConfig.getConfigUrl()).build(); } catch (IOException e) { throw new ServletException("Failed to load client config XML file [" + filterConfig.getConfigUrl() + "]:" + e.getMessage(), e); } } if (filterConfig.isStickySession()) { clientConfig.getNetworkConfig().setConnectionAttemptLimit(1); } clientConfig.addListenerConfig(new ListenerConfig(new ClientLifecycleListener(sessionService))); return HazelcastClient.newHazelcastClient(clientConfig); }