Package org.apache.geronimo.tomcat.valve

Source Code of org.apache.geronimo.tomcat.valve.ThreadCleanerValve

/**
*  Licensed to the Apache Software Foundation (ASF) under one or more
*  contributor license agreements.  See the NOTICE file distributed with
*  this work for additional information regarding copyright ownership.
*  The ASF licenses this file to You under the Apache License, Version 2.0
*  (the "License"); you may not use this file except in compliance with
*  the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/

package org.apache.geronimo.tomcat.valve;

import java.io.IOException;

import javax.servlet.ServletException;

import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.ValveBase;
import org.apache.geronimo.security.Callers;
import org.apache.geronimo.security.ContextManager;

/**
*  A hacker valve used to clean up the security association before returning the thread to the pool.
*  Please refer to GERONIMO-4748 for details
@version $Rev: 799120 $ $Date: 2009-07-29 19:23:25 -0400 (Wed, 29 Jul 2009) $
*/
public class ThreadCleanerValve extends ValveBase {

    public void invoke(Request request, Response response) throws IOException, ServletException {
        Callers oldCallers = ContextManager.getCallers();
        try {
            getNext().invoke(request, response);
        } finally {
            ContextManager.popCallers(oldCallers);
        }
    }
}
TOP

Related Classes of org.apache.geronimo.tomcat.valve.ThreadCleanerValve

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.