class HttpRequestHandler extends EndpointHandler<ChannelHandlerContext, FullHttpRequest> {

    @Override
    protected IObject getEnvironment(final ChannelHandlerContext ctx, final FullHttpRequest request)
            throws RequestHandlerDataException, RequestHandlerInternalException, ReadValueException {
        try {
            IObject message = IOC.resolve(Keys.getOrAdd("EmptyIObject"));
            if (!request.method().toString().equals("GET")) {
                IDeserializeStrategy deserializeStrategy = IOC.resolve(
                        Keys.getOrAdd("info.smart_tools.smartactors.endpoint.interfaces.ideserialize_strategy.IDeserializeStrategy"),
                        IOC.resolve(Keys.getOrAdd("http_request_key_for_deserialize"), request),
                        name
                );

                //resolving body of the request
                try {
                    message = deserializeStrategy.deserialize(request);
                } catch (DeserializationException e) {
                    IObject exception = IOC.resolve(Keys.getOrAdd("HttpPostParametersToIObjectException"));
                    ctx.writeAndFlush(formExceptionalResponse(exception));
                    throw new RequestHandlerDataException(e);
                }
            }

            //resolving uri and another request parameters of the request
            IAddRequestParametersToIObject requestParametersToIObject = IOC.resolve(
                    Keys.getOrAdd("info.smart_tools.smartactors.endpoint.interfaces.ideserialize_strategy.IDeserializeStrategy"),
                    "HTTP_GET",
                    name
            );
            try {
                requestParametersToIObject.extract(message, request);
            } catch (Exception e) {
                IObject exceptionalResponse = IOC.resolve(Keys.getOrAdd("HttpRequestParametersToIObjectException"));

                throw new RequestHandlerDataException(e);
            }

            IObject environment = IOC.resolve(Keys.getOrAdd("EmptyIObject"));

            IChannelHandler channelHandler = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.http_endpoint.channel_handler_netty.ChannelHandlerNetty"), ctx);
            //create context of the MP
            IObject context = IOC.resolve(Keys.getOrAdd("EmptyIObject"));
            context.setValue(channelFieldName, channelHandler);
            context.setValue(cookiesFieldName, new ArrayList<IObject>());
            context.setValue(headersFieldName, new ArrayList<IObject>());
            context.setValue(requestFieldName, request);
            context.setValue(endpointName, name);
            context.setValue(responseStrategyName, IOC.resolve(Keys.getOrAdd("endpoint response strategy")));

            context.setValue(httpResponseIsSentFieldName, false);
            IAction<IObject> httpFinalAction = new IAction<IObject>() {
                @Override
                public void execute(final IObject environment) throws ActionExecuteException, InvalidArgumentException {
                    try {
                        IObject context = (IObject) environment.getValue(contextFieldName);
                        if (null != context) {
                            if ((boolean) context.getValue(httpResponseIsSentFieldName)) {
                                return;
                            }
                        }
                        IFieldName channelFieldName = IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.iobject.ifield_name.IFieldName"), "channel");
                        IChannelHandler channelHandler = (IChannelHandler)
                                context.getValue(channelFieldName);

                        IResponse response = IOC.resolve(Keys.getOrAdd(IResponse.class.getCanonicalName()));
                        response.setContent("".getBytes());

                        IResponseSender sender = IOC.resolve(Keys.getOrAdd(IResponseSender.class.getCanonicalName()),
                                IOC.resolve(Keys.getOrAdd("http_request_key_for_response_sender"), environment),
                                name);
                        // ToDo: need refactoring. Need create hashMap - errorName to statusCode
                        Boolean accessForbidden = (Boolean) context.getValue(accessForbiddenFieldName);
                        if (accessForbidden != null && accessForbidden) {
                            context.setValue(httpResponseStatusCodeFieldName, NOT_FOUND_ERROR_STATUS_CODE);
                        } else {
                            context.setValue(httpResponseStatusCodeFieldName, INTERNAL_SERVER_ERROR_STATUS_CODE);
                        }
                        sender.send(response, environment, channelHandler);
                    } catch (ResolutionException | ReadValueException | ResponseSendingException | ChangeValueException e) {
                        throw new ActionExecuteException("Could not execute final http action.");
                    }
                }
            };

            ArrayList<IAction<IObject>> finalActions = new ArrayList<>();
            finalActions.add(httpFinalAction);
            context.setValue(finalActionsFieldName, finalActions);

            //create environment
            environment.setValue(messageFieldName, message);
            environment.setValue(contextFieldName, context);
            return environment;
        } catch (InvalidArgumentException | SerializeException | ChangeValueException | ResolutionException e) {
            try {
                IObject exception = IOC.resolve(Keys.getOrAdd("HttpInternalException"), e);
                ctx.writeAndFlush(formExceptionalResponse(exception));
                throw new RequestHandlerInternalException(e);
            } catch (SerializeException | ResolutionException | InvalidArgumentException e1) {
                throw new RequestHandlerInternalException("Failed to send response", e);
            }
        } finally {
            request.release();
        }
    }

    public  HttpRequestHandler(
            final IScope scope, final IEnvironmentHandler environmentHandler, final IReceiverChain receiver,
            final String name, final IUpCounter upCounter);

}