class EnvironmentHandler implements IEnvironmentHandler {

    public void handle(final IObject environment, final IReceiverChain receiverChain, final IAction<Throwable> callback)
            throws EnvironmentHandleException {
        try {
            IMessageProcessingSequence processingSequence =
                    IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessingSequence"), stackDepth, receiverChain);
            IMessageProcessor messageProcessor =
                    IOC.resolve(Keys.getOrAdd("info.smart_tools.smartactors.message_processing_interfaces.message_processing.IMessageProcessor"), taskQueue, processingSequence);

            IObject message = (IObject) environment.getValue(this.messageFieldName);
            IObject context = (IObject) environment.getValue(this.contextFieldName);
            context.setValue(this.fromExternalFieldName, true);
            messageProcessor.process(message, context);
        } catch (ResolutionException | InvalidArgumentException | ReadValueException | ChangeValueException
                | MessageProcessorProcessException e) {
            throw new EnvironmentHandleException(e);
        }
    }

    public  EnvironmentHandler(final IQueue<ITask> taskQueue, final int stackDepth);

}