class BundleService {

    public BundleMessagesRequestDto callExecutors(final DlmsConnectionManager conn, final DlmsDevice device,
            final BundleMessagesRequestDto bundleMessagesRequest) {

        final List<ActionDto> actionList = bundleMessagesRequest.getActionList();
        for (final ActionDto actionDto : actionList) {

            // Only execute the request when there is no response available yet.
            // Because it could be a retry.
            if (actionDto.getResponse() == null) {

                final Class<? extends ActionRequestDto> actionRequestClass = actionDto.getRequest().getClass();

                final CommandExecutor<?, ?> executor = this.bundleCommandExecutorMap
                        .getCommandExecutor(actionRequestClass);

                final String executorName = executor == null ? "null" : executor.getClass().getSimpleName();

                try {

                    this.checkIfExecutorExists(actionRequestClass, executor);

                    LOGGER.debug("**************************************************");
                    LOGGER.info("Calling executor in bundle {}", executorName);
                    LOGGER.debug("**************************************************");
                    actionDto.setResponse(executor.executeBundleAction(conn, device, actionDto.getRequest()));
                } catch (final ConnectionException connectionException) {
                    LOGGER.warn("A connection exception occurred while executing {}", executorName,
                            connectionException);

                    final List<ActionDto> remainingActionDtoList = actionList
                            .subList(actionList.indexOf(actionDto), actionList.size());

                    for (final ActionDto remainingActionDto : remainingActionDtoList) {
                        LOGGER.debug("Skipping: {}", remainingActionDto.getRequest().getClass().getSimpleName());
                    }

                    actionDto.setResponse(null);
                    throw connectionException;
                } catch (final Exception exception) {

                    LOGGER.error("Error while executing bundle action for {} with {}", actionRequestClass.getName(),
                            executorName, exception);
                    final String responseMessage = executor == null ? "Unable to handle request" :
                            "Error handling request with " + executorName;

                    this.addFaultResponse(actionDto, exception, responseMessage, device);
                }
            }
        }

        return bundleMessagesRequest;
    }

}