class RetryingToTakeResourceExceptionHandler extends ExceptionHandlingReceiver {

    @Override
    public void receive(final IMessageProcessor processor)
            throws MessageReceiveException {
        try {
            IObject context = processor.getContext();
            OutOfResourceException exception = (OutOfResourceException) getException(context);

            processor.getSequence().goTo(getCauseLevel(context), getCauseStep(context));

            processor.pauseProcess();

            exception.getSource().onAvailable(() -> {
                try {
                    processor.continueProcess(null);
                } catch (AsynchronousOperationException e) {
                    throw new ActionExecuteException(e);
                }
            });
        } catch (ReadValueException | InvalidArgumentException | AsynchronousOperationException e) {
            throw new MessageReceiveException(e);
        }
    }

    public  RetryingToTakeResourceExceptionHandler();

}