this.contentRoot = contentRoot; RequestHandler.Evaluator.add(this, "onGet", resourcePattern);
/** * Creates a new session manager using the given channel and path. * The manager handles only requests that match the given pattern. * The handler is registered with the given priority. * * This constructor can be used if special handling of top level * requests is needed. * * @param componentChannel the component channel * @param pattern the path part of a {@link ResourcePattern} * @param priority the priority * @param path the path */ public SessionManager(Channel componentChannel, String pattern, int priority, String path) { super(componentChannel); this.path = path; RequestHandler.Evaluator.add(this, "onRequest", pattern, priority); MBeanView.addManager(this); }
/** * Creates a new language selector component with its channel set * to the given channel and the scope to the given scope. * * @param componentChannel the component channel * @param scope the scope */ @SuppressWarnings("PMD.AvoidLiteralsInIfCondition") public LanguageSelector(Channel componentChannel, String scope) { super(componentChannel); if ("/".equals(scope) || !scope.endsWith("/")) { path = scope; } else { path = scope.substring(0, scope.length() - 1); } String pattern; if ("/".equals(path)) { pattern = "/**"; } else { pattern = path + "," + path + "/**"; } RequestHandler.Evaluator.add(this, "onRequest", pattern); }
/** * Adds the given method of the given component as a * dynamic handler for a specific pattern. Other informations * are taken from the annotation. * * @param component the component * @param method the name of the method that implements the handler * @param pattern the pattern */ public static void add(ComponentType component, String method, String pattern) { add(component, method, pattern, null); }
/** * Adds the given method of the given component as a * dynamic handler for a specific pattern with the specified * priority. Other informations are taken from the annotation. * * @param component the component * @param method the name of the method that implements the handler * @param pattern the pattern * @param priority the priority */ public static void add(ComponentType component, String method, String pattern, int priority) { add(component, method, pattern, Integer.valueOf(priority)); }