Refine search
/** * Un-registers all {@link WebSocketApplication} instances with the * {@link WebSocketEngine}. */ public synchronized void unregisterAll() { applicationMap.clear(); fullPathToApplication.clear(); contextApplications.clear(); applications.clear(); mapper = new Mapper(); mapper.setDefaultHostName("localhost"); }
/** * Add a new Wrapper to an existing Context. * * @param hostName Virtual host name this wrapper belongs to * @param contextPath Context path this wrapper belongs to * @param path Wrapper mapping * @param wrapper Wrapper object */ public void addWrapper(String hostName, String contextPath, String path, Object wrapper) { addWrapper(hostName, contextPath, path, wrapper, false); }
/** * Add a new Context to an existing Host. * * @param hostName Virtual host name this context belongs to * @param path Context path * @param context Context object * @param welcomeResources Welcome files defined for this context * @param resources Static resources of the context */ public void addContext (String hostName, String path, Object context, String[] welcomeResources, NamingContext resources) { addContext(hostName, path, context, welcomeResources, resources, null); }
final MappingData mappingData, int semicolonPos) throws Exception { final CharChunk charChunk = decodedURI.getCharChunk(); final int oldEnd = charChunk.getEnd(); semicolonPos = decodedURI.indexOf(';', 0); localDecodedURI.duplicate(decodedURI); map(requestPacket, localDecodedURI, mappingData); charChunk.setEnd(oldEnd);
int pos = findIgnoreCase(newHosts, hostName); if( pos <0 ) { addHost(hostName, new String[0], ""); newHosts = hosts; pos = findIgnoreCase(newHosts, hostName); int slashCount = slashCount(path); newContext.resources = resources; newContext.alternateDocBases = alternateDocBases; Context oldElem = (Context) insertMap(contexts, newContexts, newContext); if (oldElem == null) { host.contextList.contexts = newContexts;
mapper.mapUriWithSemicolon(request, request.getRequestURIRef().getDecodedRequestURIBC(), data, glassfishMapper.mapUriWithSemicolon(request, request.getRequestURIRef().getDecodedRequestURIBC(), data, data.contextPath.isNull() ? null : data);
final String contextPath = mapping.getContextPath(); mapper.removeWrapper(LOCAL_HOST, contextPath, mapping.getUrlPattern()); if (mapper.getWrapperNames(LOCAL_HOST, name).length == 0) { mapper.removeContext(LOCAL_HOST, contextPath);
public synchronized void unregister(WebSocketApplication app) { String fullPath = applicationMap.remove(app); if (fullPath != null) { fullPathToApplication.remove(fullPath); String[] parts = fullPath.split("\\|"); mapper.removeWrapper("localhost", parts[0], parts[1]); List<WebSocketApplication> apps = contextApplications.get(parts[0]); apps.remove(app); if (apps.isEmpty()) { mapper.removeContext("localhost", parts[0]); contextApplications.remove(parts[0]); } return; } applications.remove(app); }
/** * Configures the given virtual server with the given default context path. * * The given default path corresponds to the context path of one of the * web contexts deployed on the virtual server that has been designated as * the virtual server's new default-web-module. * * @throws Exception if there is no web context deployed on the given * virtual server that matches the given default context path */ public void setDefaultContextPath(String hostName, String defaultContextPath) throws Exception { if (defaultContextPath != null) { defaultContextPathsMap.put(hostName, defaultContextPath); } int pos = findIgnoreCase(hosts, hostName); if (pos < 0) { return; } hosts[pos].defaultContextPaths[0] = defaultContextPath; if (defaultContextPath != null) { addDefaultContext(hosts[pos], defaultContextPath); } else { hosts[pos].defaultContexts[0] = null; defaultContextPathsMap.remove(hostName); } }
/** * Remove a wrapper from the context associated with this wrapper. * * @param path Wrapper mapping */ public void removeWrapper(String path) { removeWrapper(context, path); }
mapper.mapUriWithSemicolon(request.getRequest(), decodedURI, mappingData,
/** * {@inheritDoc} */ @Override public synchronized void addHost(final String name, final String[] aliases, final Object host) { super.addHost(name, aliases, host); if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Host-Host: {0} aliases {1} host {2}", new Object[]{name, Arrays.toString(aliases), host}); } }
final MappingData mappingData, int semicolonPos) throws Exception { final CharChunk charChunk = decodedURI.getCharChunk(); final int oldEnd = charChunk.getEnd(); semicolonPos = decodedURI.indexOf(';', 0); localDecodedURI.duplicate(decodedURI); map(requestPacket, localDecodedURI, mappingData); charChunk.setEnd(oldEnd);
int pos = findIgnoreCase(newHosts, hostName); if( pos <0 ) { addHost(hostName, new String[0], ""); newHosts = hosts; pos = findIgnoreCase(newHosts, hostName); int slashCount = slashCount(path); newContext.resources = resources; newContext.alternateDocBases = alternateDocBases; Context oldElem = (Context) insertMap(contexts, newContexts, newContext); if (oldElem == null) { host.contextList.contexts = newContexts;
mapper.mapUriWithSemicolon(request, request.getRequestURIRef().getDecodedRequestURIBC(), data, glassfishMapper.mapUriWithSemicolon(request, request.getRequestURIRef().getDecodedRequestURIBC(), data, data.contextPath.isNull() ? null : data);
final String contextPath = mapping.getContextPath(); mapper.removeWrapper(LOCAL_HOST, contextPath, mapping.getUrlPattern()); if (mapper.getWrapperNames(LOCAL_HOST, name).length == 0) { mapper.removeContext(LOCAL_HOST, contextPath);
public synchronized void unregister(WebSocketApplication app) { String fullPath = applicationMap.remove(app); if (fullPath != null) { fullPathToApplication.remove(fullPath); String[] parts = fullPath.split("\\|"); mapper.removeWrapper("localhost", parts[0], parts[1]); List<WebSocketApplication> apps = contextApplications.get(parts[0]); apps.remove(app); if (apps.isEmpty()) { mapper.removeContext("localhost", parts[0]); contextApplications.remove(parts[0]); } return; } applications.remove(app); }
/** * Configures the given virtual server with the given default context path. * * The given default path corresponds to the context path of one of the * web contexts deployed on the virtual server that has been designated as * the virtual server's new default-web-module. * * @throws Exception if there is no web context deployed on the given * virtual server that matches the given default context path */ public void setDefaultContextPath(String hostName, String defaultContextPath) throws Exception { if (defaultContextPath != null) { defaultContextPathsMap.put(hostName, defaultContextPath); } int pos = findIgnoreCase(hosts, hostName); if (pos < 0) { return; } hosts[pos].defaultContextPaths[0] = defaultContextPath; if (defaultContextPath != null) { addDefaultContext(hosts[pos], defaultContextPath); } else { hosts[pos].defaultContexts[0] = null; defaultContextPathsMap.remove(hostName); } }
/** * Remove a wrapper from the context associated with this wrapper. * * @param path Wrapper mapping */ public void removeWrapper(String path) { removeWrapper(context, path); }