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