Source code: openfuture/masterdata/test/MyMasterDataService.java
1 package openfuture.masterdata.test;
2
3 import openfuture.masterdata.*;
4
5 /**
6 * This class extends the <tt>DefaultMasterDataService</tt> to add some
7 * more behavior for the example: the <tt>intialize()</tt> method fills
8 * the master data cache with some example data
9 *
10 * Creation date: (10.09.00 09:41:52)
11 * @author: Markus Giebeler
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.<p>
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.<p>
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA<br>
26 * http://www.gnu.org/copyleft/lesser.html"
27 */
28 public class MyMasterDataService extends DefaultMasterDataService {
29 /**
30 * Constructor
31 */
32 public MyMasterDataService() {
33 super();
34 }
35 /**
36 * Initialize the Master Data cache
37 *
38 * <p>This subclass is a simple exampe how master data can be initialized.
39 *
40 * <p>You might want to create an instance of this class at start-up
41 * of your (server) application and initialize is in order to fetch some data,
42 * e.g. from a legacy system or interface.
43 *
44 * Creation date: (10.09.00 09:38:20)
45 */
46 public void initialize() {
47 super.initialize();
48 addMasterDataContainer("Paint", new PaintDataSource().getMasterData("Paint"));
49 addMasterDataContainer("Language", new LanguageDataSource().getMasterData("Language"));
50 addMasterDataContainer("Manufacturer", new ManufacturerDataSource().getMasterData("Manufacturer"));
51 }
52 }