01: /*
02: This file is part of the PolePosition database benchmark
03: http://www.polepos.org
04:
05: This program is free software; you can redistribute it and/or
06: modify it under the terms of the GNU General Public License
07: as published by the Free Software Foundation; either version 2
08: of the License, or (at your option) any later version.
09:
10: This program is distributed in the hope that it will be useful,
11: but WITHOUT ANY WARRANTY; without even the implied warranty of
12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: GNU General Public License for more details.
14:
15: You should have received a copy of the GNU General Public
16: License along with this program; if not, write to the Free
17: Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18: MA 02111-1307, USA. */
19:
20: package org.polepos.teams.jdo;
21:
22: import java.util.*;
23:
24: import org.polepos.framework.*;
25:
26: public class JdoTeam extends Team {
27:
28: private final Car[] mCars;
29:
30: public JdoTeam() {
31:
32: String[] impls = Jdo.settings().getJdoImplementations();
33:
34: if (impls == null) {
35: System.out.println("No JDO engine configured.");
36: mCars = new Car[0];
37: } else {
38:
39: List<Car> cars = new ArrayList<Car>();
40:
41: for (String impl : impls) {
42:
43: String[] jdosqldbs = Jdo.settings().getJdbc(impl);
44:
45: if (jdosqldbs != null && jdosqldbs.length > 0) {
46: for (String sqldb : jdosqldbs) {
47: try {
48: cars.add(new JdoCar(impl, sqldb));
49: } catch (Exception e) {
50: e.printStackTrace();
51: }
52: }
53: } else {
54: try {
55: cars.add(new JdoCar(impl, null));
56: } catch (Exception e) {
57: e.printStackTrace();
58: }
59: }
60: }
61:
62: mCars = new Car[cars.size()];
63: cars.toArray(mCars);
64: }
65:
66: }
67:
68: @Override
69: public String name() {
70: return "JDO";
71: }
72:
73: @Override
74: public String description() {
75: return "the JDO team";
76: }
77:
78: @Override
79: public Car[] cars() {
80: return mCars;
81: }
82:
83: @Override
84: public Driver[] drivers() {
85: return new Driver[] { new MelbourneJdo(), new SepangJdo(),
86: new BahrainJdo(), new ImolaJdo(), new BarcelonaJdo() };
87: }
88:
89: @Override
90: public String website() {
91: return null;
92: }
93:
94: }
|