PHP Класс AppserverIo\Appserver\ServletEngine\RequestHandler

Автор: Tim Wagner ([email protected])
Наследование: extends Thread
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$applicationContext AppserverIo\Psr\Application\ApplicationInterface The prepared application context.
$requestContext AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The prepared request context.

Открытые методы

Метод Описание
addError ( Error $error ) : void Append the passed error to the request handler's stack.
copyToHttpResponse ( AppserverIo\Psr\HttpMessage\ResponseInterface $httpResponse ) : void Copies the values from the request handler back to the passed HTTP response instance.
errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : boolean PHP error handler implemenation that replaces the defaulf PHP error handling.
getApplicationContext ( ) : AppserverIo\Psr\Application\ApplicationInterface Returns the actual application instance thatrepresents the application context of this request.
getErrors ( ) : array Return's the array with the request handler's error stack.
getRequestContext ( ) : AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface Returns the actual servlet request instance that has been prepared to handle the actual request and represents the context of this request.
injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void Injects the application of the request to be handled
injectRequest ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest ) : void Inject the actual servlet request.
injectResponse ( AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void Inject the actual servlet response.
injectValves ( array $valves ) : void Injects the valves to be processed.
run ( ) : void The main method that handles the thread in a separate context.
shutdown ( ) : void Does shutdown logic for request handler if something went wrong and produces a fatal error for example.

Описание методов

addError() публичный метод

Append the passed error to the request handler's stack.
public addError ( Error $error ) : void
$error AppserverIo\Appserver\ServletEngine\Utils\Error The error to append
Результат void

copyToHttpResponse() публичный метод

Copies the values from the request handler back to the passed HTTP response instance.
public copyToHttpResponse ( AppserverIo\Psr\HttpMessage\ResponseInterface $httpResponse ) : void
$httpResponse AppserverIo\Psr\HttpMessage\ResponseInterface A HTTP response object
Результат void

errorHandler() публичный метод

As this method will NOT handle Fatal Errors with code E_ERROR or E_USER, so these have to be processed by the shutdown handler itself.
public errorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) : boolean
$errno integer The intern PHP error number
$errstr string The error message itself
$errfile string The file where the error occurs
$errline integer The line where the error occurs
Результат boolean Always return TRUE, because we want to disable default PHP error handling

getApplicationContext() публичный статический метод

Returns the actual application instance thatrepresents the application context of this request.
public static getApplicationContext ( ) : AppserverIo\Psr\Application\ApplicationInterface
Результат AppserverIo\Psr\Application\ApplicationInterface The actual application context

getErrors() публичный метод

Return's the array with the request handler's error stack.
public getErrors ( ) : array
Результат array The stack with the request handler's errors

getRequestContext() публичный статический метод

Returns the actual servlet request instance that has been prepared to handle the actual request and represents the context of this request.
public static getRequestContext ( ) : AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface
Результат AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The prepared request context

injectApplication() публичный метод

Injects the application of the request to be handled
public injectApplication ( AppserverIo\Psr\Application\ApplicationInterface $application ) : void
$application AppserverIo\Psr\Application\ApplicationInterface The application instance
Результат void

injectRequest() публичный метод

Inject the actual servlet request.
public injectRequest ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest ) : void
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The actual request instance
Результат void

injectResponse() публичный метод

Inject the actual servlet response.
public injectResponse ( AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void
$servletResponse AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface The actual response instance
Результат void

injectValves() публичный метод

Injects the valves to be processed.
public injectValves ( array $valves ) : void
$valves array The valves to process
Результат void

run() публичный метод

The main method that handles the thread in a separate context.
public run ( ) : void
Результат void

shutdown() публичный метод

Does shutdown logic for request handler if something went wrong and produces a fatal error for example.
public shutdown ( ) : void
Результат void

Описание свойств

$applicationContext публичное статическое свойство

The prepared application context.
public static ApplicationInterface,AppserverIo\Psr\Application $applicationContext
Результат AppserverIo\Psr\Application\ApplicationInterface

$requestContext публичное статическое свойство

The prepared request context.
public static HttpServletRequestInterface,AppserverIo\Psr\Servlet\Http $requestContext
Результат AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface