Java Code Examples for org.apache.catalina.Context#findFilterDefs()

The following examples show how to use org.apache.catalina.Context#findFilterDefs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebAnnotationSet.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Process the annotations for the filters.
 */
protected static void loadApplicationFilterAnnotations(Context context) {
    Class<?> classClass = null;
    FilterDef[] filterDefs = context.findFilterDefs();
    for (int i = 0; i < filterDefs.length; i++) {
        classClass = Introspection.loadClass(context,
                (filterDefs[i]).getFilterClass());
        if (classClass == null) {
            continue;
        }

        loadClassAnnotation(context, classClass);
        loadFieldsAnnotation(context, classClass);
        loadMethodsAnnotation(context, classClass);
    }
}
 
Example 2
Source File: WebAnnotationSet.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Process the annotations for the filters.
 */
protected static void loadApplicationFilterAnnotations(Context context) {
    Class<?> classClass = null;
    FilterDef[] filterDefs = context.findFilterDefs();
    for (int i = 0; i < filterDefs.length; i++) {
        classClass = Introspection.loadClass(context,
                (filterDefs[i]).getFilterClass());
        if (classClass == null) {
            continue;
        }

        loadClassAnnotation(context, classClass);
        loadFieldsAnnotation(context, classClass);
        loadMethodsAnnotation(context, classClass);
    }
}
 
Example 3
Source File: WebAnnotationSet.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Process the annotations for the filters.
 *
 * @param context The context which will have its annotations processed
 */
protected static void loadApplicationFilterAnnotations(Context context) {
    FilterDef[] filterDefs = context.findFilterDefs();
    for (FilterDef filterDef : filterDefs) {
        Class<?> clazz = Introspection.loadClass(context, filterDef.getFilterClass());
        if (clazz == null) {
            continue;
        }

        loadClassAnnotation(context, clazz);
        loadFieldsAnnotation(context, clazz);
        loadMethodsAnnotation(context, clazz);
    }
}
 
Example 4
Source File: ContextMBean.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Return the set of defined filters for this Context.
 * @return a string array with a representation of all
 *  the filter definitions
 * @throws MBeanException propagated from the managed resource access
 */
public String[] findFilterDefs() throws MBeanException {

    Context context = doGetManagedResource();

    FilterDef[] filterDefs = context.findFilterDefs();
    String[] stringFilters = new String[filterDefs.length];
    for (int counter = 0; counter < filterDefs.length; counter++) {
        stringFilters[counter] = filterDefs[counter].toString();
    }

    return stringFilters;
}