class WrapperCreatorReceiverDecorator implements IMessageReceiver {

    @Override
    public void receive(final IMessageProcessor processor)
            throws MessageReceiveException, AsynchronousOperationException {
        try {
            IObject stepArgs = processor.getSequence().getCurrentReceiverArguments();
            IObject wrapperConfigObject = (IObject) stepArgs.getValue(wrapperFieldName);

            if (null != wrapperConfigObject) {
                // stepArgs object is used as key for strategy cache as if the wrapperConfigObject was used the entry would not be ever
                // garbage-collected (even if wrapperStrategies stores keys by weak references): wrapper resolution strategy has a strong
                // reference to configuration object
                IResolveDependencyStrategy conf = wrapperStrategies.get(stepArgs);

                if (null == conf) {
                    conf = IOC.resolve(strategyDependencyKey, wrapperConfigObject);
                    wrapperStrategies.put(stepArgs, conf);
                }

                processor.pushEnvironment(conf.resolve(processor.getEnvironment()));
            }

            underlyingReceiver.receive(processor);
        } catch (ReadValueException | InvalidArgumentException | ResolutionException | ResolveDependencyStrategyException e) {
            throw new MessageReceiveException(e);
        }
    }

    public  WrapperCreatorReceiverDecorator(
            final IMessageReceiver underlyingReceiver,
            final Map<Object, IResolveDependencyStrategy> wrapperStrategiesMap,
            final String strategyDependencyName);

}