View Javadoc
1   /*
2    * Copyright 2010 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  
21  import org.springframework.beans.factory.annotation.Autowired;
22  
23  import com.hack23.cia.model.internal.application.data.impl.WorldBankDataSources;
24  import com.hack23.cia.service.component.agent.impl.common.jms.JmsSender;
25  import com.hack23.cia.service.component.agent.impl.worldbank.workgenerator.data.WorldbankImportService;
26  
27  /**
28   * The Class AbstractWorldBankDataSourcesWorkGenerator.
29   */
30  public abstract class AbstractWorldBankDataSourcesWorkGenerator implements WorldBankDataSourcesWorkGenerator {
31  
32  	@Autowired
33  	private JmsSender jmsSender;
34  
35  	/** The import service. */
36  	@Autowired
37  	private WorldbankImportService importService;
38  
39  	/** The datasource. */
40  	private final WorldBankDataSources datasource;
41  
42  	/**
43  	 * Instantiates a new abstract world bank data sources work generator.
44  	 *
45  	 * @param datasource
46  	 *            the datasource
47  	 */
48  	public AbstractWorldBankDataSourcesWorkGenerator(final WorldBankDataSources datasource) {
49  		super();
50  		this.datasource = datasource;
51  	}
52  
53  	@Override
54  	public final boolean matches(final WorldBankDataSources datasource) {
55  		return this.datasource == datasource;
56  	}
57  
58  	/**
59  	 * Gets the import service.
60  	 *
61  	 * @return the import service
62  	 */
63  	protected final WorldbankImportService getImportService() {
64  		return importService;
65  	}
66  
67  	/**
68  	 * Gets the jms sender.
69  	 *
70  	 * @return the jms sender
71  	 */
72  	protected final JmsSender getJmsSender() {
73  		return jmsSender;
74  	}
75  
76  }