AbstractWorldBankDataSourcesWorkGenerator.java

  1. /*
  2.  * Copyright 2010-2024 James Pether Sörling
  3.  *
  4.  * Licensed under the Apache License, Version 2.0 (the "License");
  5.  * you may not use this file except in compliance with the License.
  6.  * You may obtain a copy of the License at
  7.  *
  8.  *   http://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  * Unless required by applicable law or agreed to in writing, software
  11.  * distributed under the License is distributed on an "AS IS" BASIS,
  12.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  * See the License for the specific language governing permissions and
  14.  * limitations under the License.
  15.  *
  16.  *  $Id$
  17.  *  $HeadURL$
  18. */
  19. package com.hack23.cia.service.component.agent.impl.worldbank.workgenerator;

  20. import org.springframework.beans.factory.annotation.Autowired;

  21. import com.hack23.cia.model.internal.application.data.impl.WorldBankDataSources;
  22. import com.hack23.cia.service.component.agent.impl.common.jms.JmsSender;
  23. import com.hack23.cia.service.component.agent.impl.worldbank.workgenerator.data.WorldbankImportService;

  24. /**
  25.  * The Class AbstractWorldBankDataSourcesWorkGenerator.
  26.  */
  27. public abstract class AbstractWorldBankDataSourcesWorkGenerator implements WorldBankDataSourcesWorkGenerator {

  28.     /** The jms sender. */
  29.     @Autowired
  30.     private JmsSender jmsSender;

  31.     /** The import service. */
  32.     @Autowired
  33.     private WorldbankImportService importService;

  34.     /** The datasource. */
  35.     private final WorldBankDataSources datasource;

  36.     /**
  37.      * Instantiates a new abstract world bank data sources work generator.
  38.      *
  39.      * @param datasource
  40.      *            the datasource
  41.      */
  42.     public AbstractWorldBankDataSourcesWorkGenerator(final WorldBankDataSources datasource) {
  43.         super();
  44.         this.datasource = datasource;
  45.     }

  46.     @Override
  47.     public final boolean matches(final WorldBankDataSources datasource) {
  48.         return this.datasource == datasource;
  49.     }

  50.     /**
  51.      * Gets the import service.
  52.      *
  53.      * @return the import service
  54.      */
  55.     protected final WorldbankImportService getImportService() {
  56.         return importService;
  57.     }

  58.     /**
  59.      * Gets the jms sender.
  60.      *
  61.      * @return the jms sender
  62.      */
  63.     protected final JmsSender getJmsSender() {
  64.         return jmsSender;
  65.     }

  66. }