class InterfacesApplicationContext implements WebMvcConfigurer {
    private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

    @Value("${uploadDirectory}")
    public String uploadDirectory;

    @Value("${parseFailureDirectory}")
    public String parseFailureDirectory;

    @Autowired
    public EntityManager entityManager;

    @Bean
    public MessageSource messageSource() {
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasename("messages");
        return messageSource;
    }

    @Bean
    public FixedLocaleResolver localeResolver() {
        FixedLocaleResolver fixedLocaleResolver = new FixedLocaleResolver();
        fixedLocaleResolver.setDefaultLocale(Locale.ENGLISH);
        return fixedLocaleResolver;
    }

    @Bean
    public CargoTrackingController cargoTrackingController(MessageSource messageSource, CargoRepository cargoRepository, HandlingEventRepository handlingEventRepository) {
        return new CargoTrackingController(cargoRepository, handlingEventRepository, messageSource);
    }

    @Bean
    public CargoTrackingRestService cargoTrackingRestService(CargoRepository cargoRepository, HandlingEventRepository handlingEventRepository, MessageSource messageSource) {
        return new CargoTrackingRestService(cargoRepository, handlingEventRepository, messageSource);
    }

    @Bean
    public TrackCommandValidator trackCommandValidator() {
        return new TrackCommandValidator();
    }

    @Bean
    public CargoAdminController cargoAdminController(BookingServiceFacade bookingServiceFacade) {
        return new CargoAdminController(bookingServiceFacade);
    }

    @Bean
    public BookingServiceFacade bookingServiceFacade(BookingService bookingService, LocationRepository locationRepository, CargoRepository cargoRepository, VoyageRepository voyageRepository) {
        return new BookingServiceFacadeImpl(bookingService, locationRepository, cargoRepository, voyageRepository);
    }

    @Bean
    public UploadDirectoryScanner uploadDirectoryScanner(ApplicationEvents applicationEvents) {<FILL_FUNCTION_BODY>}

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        OpenEntityManagerInViewInterceptor openSessionInViewInterceptor = new OpenEntityManagerInViewInterceptor();
        openSessionInViewInterceptor.setEntityManagerFactory(entityManager.getEntityManagerFactory());
        registry.addWebRequestInterceptor(openSessionInViewInterceptor);
    }

    @Bean
    public ThreadPoolTaskScheduler myScheduler(@Nullable UploadDirectoryScanner scanner) {
        if (scanner == null) {
            log.info("No UploadDirectoryScannerBean found, skipping creation of scheduler.");
            return null;
        }
        ThreadPoolTaskScheduler threadPoolTaskScheduler
                = new ThreadPoolTaskScheduler();
        threadPoolTaskScheduler.setPoolSize(10);
        threadPoolTaskScheduler.setThreadNamePrefix(
                "ThreadPoolTaskScheduler");
        threadPoolTaskScheduler.initialize();
        threadPoolTaskScheduler.scheduleAtFixedRate(scanner, 5000);
        return threadPoolTaskScheduler;
    }
}

        File uploadDirectoryFile = new File(uploadDirectory);
        File parseFailureDirectoryFile = new File(parseFailureDirectory);
        return new UploadDirectoryScanner(uploadDirectoryFile, parseFailureDirectoryFile, applicationEvents);
    
<no_super_class>