class EmbeddedPiranha implements Piranha {

    public void service(ServletRequest servletRequest, ServletResponse servletResponse)
            throws IOException, ServletException {
        if (servletRequest.getServletContext() == null
                && servletRequest instanceof EmbeddedRequest) {
            EmbeddedRequest embeddedRequest = (EmbeddedRequest) servletRequest;
            embeddedRequest.setWebApplication(webApplication);
        }
        if (servletResponse instanceof EmbeddedResponse) {
            EmbeddedResponse embeddedResponse = (EmbeddedResponse) servletResponse;
            embeddedResponse.setWebApplication(webApplication);
        }
        webApplication.linkRequestAndResponse(servletRequest, servletResponse);
        webApplication.service(servletRequest, servletResponse);
        webApplication.unlinkRequestAndResponse(servletRequest, servletResponse);
    }

    public  EmbeddedPiranha();

}