public StoredErrorReceiver exec(final TaskContext taskContext,
                                    final RefStreamDefinition refStreamDefinition) {
        this.taskContext = taskContext;
        final StoredErrorReceiver storedErrorReceiver = new StoredErrorReceiver();

        if (!taskContext.isTerminated() && !Thread.currentThread().isInterrupted()) {
            securityContext.secure(() -> {
                // Elevate user permissions so that inherited pipelines that the user only has 'Use' permission
                // on can be read.
                securityContext.useAsRead(() -> {
                    errorReceiver = new ErrorReceiverIdDecorator(getClass().getSimpleName(), storedErrorReceiver);
                    errorReceiverProxy.setErrorReceiver(errorReceiver);

                    LOGGER.debug("Loading reference data: {}", refStreamDefinition);
                    taskContext.info(() -> LogUtil.message(
                            "Loading reference data stream {}:{}",
                            refStreamDefinition.getStreamId(),
                            refStreamDefinition.getPartNumber()));

                    loadReferenceData(taskContext, refStreamDefinition);
                });
            });
        }
        return storedErrorReceiver;
    }
Loads reference data that meets the supplied criteria into the current
reference data key, value maps.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/ReferenceDataLoadTaskHandler.java