/* $$ Clover has instrumented this file $$ */// Copyright 2004 The Apache Software Foundation
//
// Licensed 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.tapestry.services.impl;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.tapestry.Constants;
import org.apache.tapestry.IEngine;
import org.apache.tapestry.request.RequestContext;
import org.apache.tapestry.services.EngineManager;
import org.apache.tapestry.services.Infrastructure;
import org.apache.tapestry.services.RequestServicer;
import org.apache.tapestry.spec.IApplicationSpecification;
/**
* The terminatior for the <code>tapestry.RequestProcessor</code> pipeline,
* this service is responsible for locating the correct engine instance and
* letting it to the rest of the request.
*
* @author Howard Lewis Ship
* @since 3.1
*/
public class InvokeEngineTerminator implements RequestServicer
{public static com.cortexeb.tools.clover.d __CLOVER_318_0 = com.cortexeb.tools.clover.aq.getRecorder(new char[] {67,58,92,119,111,114,107,115,112,97,99,101,92,106,97,107,97,114,116,97,45,116,97,112,101,115,116,114,121,92,102,114,97,109,101,119,111,114,107,92,116,97,114,103,101,116,92,99,108,111,118,101,114,45,100,98},1096998272901L);
private HttpServlet _servlet;
private EngineManager _engineManager;
private IApplicationSpecification _specification;
private Infrastructure _infrastructure;
public void service(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{try { __CLOVER_318_0.M[1570]++;
__CLOVER_318_0.S[7368]++;IEngine engine = _engineManager.getEngineInstance();
__CLOVER_318_0.S[7369]++;request.setAttribute(Constants.INFRASTRUCTURE_KEY, _infrastructure);
__CLOVER_318_0.S[7370]++;RequestContext context = new RequestContext(_servlet, request, response, _specification);
__CLOVER_318_0.S[7371]++;try
{
__CLOVER_318_0.S[7372]++;engine.service(context);
}
finally
{
__CLOVER_318_0.S[7373]++;_engineManager.storeEngineInstance(engine);
__CLOVER_318_0.S[7374]++;context.cleanup();
}
} finally { }}
public void setEngineManager(EngineManager manager)
{try { __CLOVER_318_0.M[1571]++;
__CLOVER_318_0.S[7375]++;_engineManager = manager;
} finally { }}
public void setServlet(HttpServlet servlet)
{try { __CLOVER_318_0.M[1572]++;
__CLOVER_318_0.S[7376]++;_servlet = servlet;
} finally { }}
public void setSpecification(IApplicationSpecification specification)
{try { __CLOVER_318_0.M[1573]++;
__CLOVER_318_0.S[7377]++;_specification = specification;
} finally { }}
public void setInfrastructure(Infrastructure infrastructure)
{try { __CLOVER_318_0.M[1574]++;
__CLOVER_318_0.S[7378]++;_infrastructure = infrastructure;
} finally { }}
}