getRequestContext() public static method

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
return AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The prepared request context
Esempio n. 1
0
 /**
  * This returns a proxy to the requested session bean.
  *
  * @param string $lookupName The lookup name for the requested session bean
  * @param string $sessionId  The session-ID if available
  *
  * @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance
  */
 public function lookupProxy($lookupName, $sessionId = null)
 {
     // load the initial context instance
     $initialContext = $this->getInitialContext();
     // query whether a request context is available
     if ($servletRequest = RequestHandler::getRequestContext()) {
         // inject the servlet request to handle SFSBs correctly
         $initialContext->injectServletRequest($servletRequest);
     }
     // lookup the proxy by the name and session ID if available
     return $initialContext->lookup($lookupName, $sessionId);
 }