PHP 클래스 AppserverIo\Appserver\ServletEngine\RequestHandler

상속: extends Thread
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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