org.eclipse.jetty.ee8.nested.Handler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jetty-ee8-nested Show documentation
Show all versions of jetty-ee8-nested Show documentation
The jetty core handler adapted to legacy ee8 handler.
The newest version!
//
// ========================================================================
// Copyright (c) 1995 Mort Bay Consulting Pty Ltd and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
// ========================================================================
//
package org.eclipse.jetty.ee8.nested;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.ManagedOperation;
import org.eclipse.jetty.util.component.Destroyable;
import org.eclipse.jetty.util.component.LifeCycle;
/**
* A Jetty Server Handler.
*
* A Handler instance is required by a {@link Server} to handle incoming
* HTTP requests.
*
* A Handler may:
*
* - Completely generate the HTTP Response
* - Examine/modify the request and call another Handler (see {@link HandlerWrapper}).
*
- Pass the request to one or more other Handlers (see {@link HandlerCollection}).
*
*
* Handlers are passed the servlet API request and response object, but are
* not Servlets. The servlet container is implemented by handlers for
* context, security, session and servlet that modify the request object
* before passing it to the next stage of handling.
*/
@ManagedObject("Jetty Handler")
public interface Handler extends LifeCycle, Destroyable {
/**
* Handle a request.
*
* @param target The target of the request - either a URI or a name.
* @param baseRequest The original unwrapped request object.
* @param request The request either as the {@link Request} object or a wrapper of that request.
* @param response The response as the {@link Response} object or a wrapper of that request.
* @throws IOException if unable to handle the request or response processing
* @throws ServletException if unable to handle the request or response due to underlying servlet issue
*/
void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException;
void setServer(Server server);
@ManagedAttribute(value = "the jetty server for this handler", readonly = true)
Server getServer();
@ManagedOperation(value = "destroy associated resources", impact = "ACTION")
@Override
void destroy();
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy