// 此处的 chainName 就是 antPath publicvoidcreateChain(String chainName, String chainDefinition) { if (!StringUtils.hasText(chainName)) { thrownewNullPointerException("chainName cannot be null or empty."); } if (!StringUtils.hasText(chainDefinition)) { thrownewNullPointerException("chainDefinition cannot be null or empty."); }
if (log.isDebugEnabled()) { log.debug("Creating chain [" + chainName + "] with global filters " + globalFilterNames + " and from String definition [" + chainDefinition + "]"); }
publicvoidaddToChain(String chainName, String filterName, String chainSpecificFilterConfig) { if (!StringUtils.hasText(chainName)) { thrownewIllegalArgumentException("chainName cannot be null or empty."); } Filterfilter= getFilter(filterName); if (filter == null) { thrownewIllegalArgumentException("There is no filter with name '" + filterName + "' to apply to chain [" + chainName + "] in the pool of available Filters. Ensure a " + "filter with that name/path has first been registered with the addFilter method(s)."); }