@Override public String getVirtualServerName() { String[] hosts = getVirtualHosts(); if (hosts != null && hosts.length > 0) return hosts[0]; return null; } }
boolean hasVirtualHost() { for (ContextHandler context:_contexts) if (context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) return true; return false; }
@Override public String getVirtualServerName() { String[] hosts = getVirtualHosts(); if (hosts!=null && hosts.length>0) return hosts[0]; return null; } }
boolean hasVirtualHost() { for (ContextHandler context:_contexts) if (context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) return true; return false; }
boolean hasVirtualHost() { for (ContextHandler context:_contexts) if (context.getVirtualHosts()!=null && context.getVirtualHosts().length>0) return true; return false; }
protected final String getVirtualHost() { final String vhost = "0.0.0.0"; if (_context == null) { return vhost; } final String[] vhosts = _context.getContextHandler().getVirtualHosts(); if (vhosts == null || vhosts.length == 0 || vhosts[0] == null) { return vhost; } return vhosts[0]; }
protected final String getVirtualHost() { String vhost = "0.0.0.0"; if (_context == null) return vhost; String[] vhosts = _context.getContextHandler().getVirtualHosts(); if (vhosts == null || vhosts.length == 0 || vhosts[0] == null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private static String getVirtualHost (ContextHandler.Context context) { String vhost = "0.0.0.0"; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
/** * Get the first virtual host for the context. * * Used to help identify the exact session/contextPath. * * @return 0.0.0.0 if no virtual host is defined */ private String canonicalizeVHost (Context context) { String vhost = NULL_VHOST; if (context==null) return vhost; String [] vhosts = context.getContextHandler().getVirtualHosts(); if (vhosts==null || vhosts.length==0 || vhosts[0]==null) return vhost; return vhosts[0]; }
@Override public String toString() { String[] vhosts = getVirtualHosts(); StringBuilder b = new StringBuilder(); Package pkg = getClass().getPackage(); if (pkg != null) { String p = pkg.getName(); if (p != null && p.length() > 0) { String[] ss = p.split("\\."); for (String s : ss) b.append(s.charAt(0)).append('.'); } } b.append(getClass().getSimpleName()).append('@').append(Integer.toString(hashCode(),16)); b.append('{').append(getContextPath()).append(',').append(getBaseResource()).append(',').append(_availability); if (vhosts != null && vhosts.length > 0) b.append(',').append(vhosts[0]); b.append('}'); return b.toString(); }
@Override public String toString() { String[] vhosts = getVirtualHosts(); StringBuilder b = new StringBuilder(); Package pkg = getClass().getPackage(); if (pkg != null) { String p = pkg.getName(); if (p != null && p.length() > 0) { String[] ss = p.split("\\."); for (String s : ss) b.append(s.charAt(0)).append('.'); } } b.append(getClass().getSimpleName()); b.append('{').append(getContextPath()).append(',').append(getBaseResource()); if (vhosts != null && vhosts.length > 0) b.append(',').append(vhosts[0]); b.append('}'); return b.toString(); }
@Override public void doStart() throws Exception { LOG.info("HazelcastSessionManager.doStart()"); super.doStart(); String[] hosts = getContextHandler().getVirtualHosts(); if (hosts == null || hosts.length == 0) { // IPv6 equiv of 0.0.0.0 hosts = new String[]{"::"}; } String contextPath = getContext().getContextPath(); if (contextPath == null || "".equals(contextPath)) { contextPath = "*"; } LOG.debug("HazelcastSessionManager:doStart():contextpath: " + contextPath); contextId = createContextId(hosts, contextPath); LOG.debug("HazelcastSessionManager:doStart():contextId: " + contextId); sessions = ((HazelcastSessionIdManager) getSessionIdManager()).getSessions(); }