Java 类org.apache.catalina.ContainerServlet 实例源码

项目:tomcat7    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (ContainerServlet.class.isAssignableFrom(clazz)) {
        throw new SecurityException(sm.getString(
                "defaultInstanceManager.restrictedContainerServlet", clazz));
    }
    while (clazz != null) {
        if (restrictedClasses.contains(clazz.getName())) {
            throw new SecurityException(sm.getString(
                    "defaultInstanceManager.restrictedClass", clazz));
        }
        clazz = clazz.getSuperclass();
    }
}
项目:tomcat7    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:jerrydog    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if loading this servlet is allowed.
 */
private boolean isServletAllowed(Object servlet) {

    if (servlet instanceof ContainerServlet) {
        if (((Context) getParent()).getPrivileged()
            || (servlet.getClass().getName().equals
                ("org.apache.catalina.servlets.InvokerServlet"))) {
            return (true);
        } else {
            return (false);
        }
    }

    return (true);

}
项目:apache-tomcat-7.0.73-with-comment    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (ContainerServlet.class.isAssignableFrom(clazz)) {
        throw new SecurityException(sm.getString(
                "defaultInstanceManager.restrictedContainerServlet", clazz));
    }
    while (clazz != null) {
        if (restrictedClasses.contains(clazz.getName())) {
            throw new SecurityException(sm.getString(
                    "defaultInstanceManager.restrictedClass", clazz));
        }
        clazz = clazz.getSuperclass();
    }
}
项目:class-guard    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (Filter.class.isAssignableFrom(clazz)) {
        checkAccess(clazz, restrictedFilters);
    } else if (Servlet.class.isAssignableFrom(clazz)) {
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            throw new SecurityException("Restricted (ContainerServlet) " +
                    clazz);
        }
        checkAccess(clazz, restrictedServlets);
    } else {
        checkAccess(clazz, restrictedListeners);
    }
}
项目:class-guard    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:apache-tomcat-7.0.57    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (Filter.class.isAssignableFrom(clazz)) {
        checkAccess(clazz, restrictedFilters);
    } else if (Servlet.class.isAssignableFrom(clazz)) {
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            throw new SecurityException("Restricted (ContainerServlet) " +
                    clazz);
        }
        checkAccess(clazz, restrictedServlets);
    } else {
        checkAccess(clazz, restrictedListeners);
    }
}
项目:apache-tomcat-7.0.57    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:apache-tomcat-7.0.57    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (Filter.class.isAssignableFrom(clazz)) {
        checkAccess(clazz, restrictedFilters);
    } else if (Servlet.class.isAssignableFrom(clazz)) {
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            throw new SecurityException("Restricted (ContainerServlet) " +
                    clazz);
        }
        checkAccess(clazz, restrictedServlets);
    } else {
        checkAccess(clazz, restrictedListeners);
    }
}
项目:apache-tomcat-7.0.57    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:HowTomcatWorks    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if loading this servlet is allowed.
 */
private boolean isServletAllowed(Object servlet) {

    if (servlet instanceof ContainerServlet) {
        if (((Context) getParent()).getPrivileged()
            || (servlet.getClass().getName().equals
                ("org.apache.catalina.servlets.InvokerServlet"))) {
            return (true);
        } else {
            return (false);
        }
    }

    return (true);

}
项目:WBSAirback    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:tomcat7    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:lams    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        //ignore
    }
    return classLoader.loadClass(className);
}
项目:lams    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param classname Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        return (false);
    }

}
项目:jerrydog    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param name Name of the class to be checked
 */
private boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        return (false);
    }

}
项目:apache-tomcat-7.0.73-with-comment    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:lazycat    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:lazycat    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) {
        return;
    }
    if (ContainerServlet.class.isAssignableFrom(clazz)) {
        throw new SecurityException(sm.getString("defaultInstanceManager.restrictedContainerServlet", clazz));
    }
    while (clazz != null) {
        if (restrictedClasses.contains(clazz.getName())) {
            throw new SecurityException(sm.getString("defaultInstanceManager.restrictedClass", clazz));
        }
        clazz = clazz.getSuperclass();
    }
}
项目:lazycat    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the server
 * class loader.
 *
 * @param classname
 *            Name of the class to be checked
 */
protected boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class<?> clazz = this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        return (false);
    }

}
项目:class-guard    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:apache-tomcat-7.0.57    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:apache-tomcat-7.0.57    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:HowTomcatWorks    文件:StandardWrapper.java   
/**
 * Return <code>true</code> if the specified class name represents a
 * container provided servlet class that should be loaded by the
 * server class loader.
 *
 * @param name Name of the class to be checked
 */
private boolean isContainerProvidedServlet(String classname) {

    if (classname.startsWith("org.apache.catalina.")) {
        return (true);
    }
    try {
        Class clazz =
            this.getClass().getClassLoader().loadClass(classname);
        return (ContainerServlet.class.isAssignableFrom(clazz));
    } catch (Throwable t) {
        return (false);
    }

}
项目:WBSAirback    文件:DefaultInstanceManager.java   
protected Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
    if (className.startsWith("org.apache.catalina")) {
        return containerClassLoader.loadClass(className);
    }
    try {
        Class<?> clazz = containerClassLoader.loadClass(className);
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            return clazz;
        }
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
    }
    return classLoader.loadClass(className);
}
项目:WBSAirback    文件:DefaultInstanceManager.java   
private void checkAccess(Class<?> clazz) {
    if (privileged) return;
    if (Filter.class.isAssignableFrom(clazz)) {
        checkAccess(clazz, restrictedFilters);
    } else if (Servlet.class.isAssignableFrom(clazz)) {
        if (ContainerServlet.class.isAssignableFrom(clazz)) {
            throw new SecurityException("Restricted (ContainerServlet) " +
                    clazz);
        }
        checkAccess(clazz, restrictedServlets);
    } else {
        checkAccess(clazz, restrictedListeners);
    }
}