Project

General

Profile

Revision e290270f

IDe290270f59f14a0a70a578736cdb802051e6196a
Parent c3149512
Child e0b7f901

Added by Andreas Müller about 2 months ago

cleanup

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationUtils.java
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9

  
10 9
package eu.etaxonomy.cdm.api.application;
11 10

  
12 11
import java.io.File;
......
30 29

  
31 30
    private static ApplicationContext applicationContext;
32 31

  
33

  
34 32
    //directory of the resources (configfiles etc.)
35 33
    static File fileResourceDir;
36 34
    static final String MUST_EXIST_FILE = CdmPersistentXMLSource.CDMSOURCE_PATH + CdmPersistentXMLSource.CDMSOURCE_FILE_NAME;
......
113 111
        return false;
114 112
    }
115 113

  
116
    /**
117
     * {@inheritDoc}
118
     */
119 114
    @Override
120 115
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
121
        this.applicationContext = applicationContext;
116
        CdmApplicationUtils.applicationContext = applicationContext;
122 117
    }
123

  
124

  
125
}
118
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/LocalHsqldb.java
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9

  
10 9
package eu.etaxonomy.cdm.database;
11 10

  
12 11
import java.io.File;
......
24 23

  
25 24
import eu.etaxonomy.cdm.api.application.CdmApplicationUtils;
26 25

  
27

  
28 26
/**
29 27
 * @author a.mueller
30
 *
31 28
 */
32

  
33 29
public class LocalHsqldb extends BasicDataSource {
34 30
	private static final Logger logger = Logger.getLogger(LocalHsqldb.class);
35 31

  
......
50 46
	/** default driver class name */
51 47
	protected String DEFAULT_DRIVER_CLASS_NAME = "org.hsqldb.jdbcDriver";
52 48

  
53

  
54
	/**
55
	 *
56
	 */
57 49
	public LocalHsqldb() {
58 50
		setDriverClassName(DEFAULT_DRIVER_CLASS_NAME);
59 51
		setComposedUrl();
60 52
	}
61 53

  
62
	/**
63
	 * @param url
64
	 * @throws CannotGetJdbcConnectionException
65
	 */
66 54
	public LocalHsqldb(String url) throws CannotGetJdbcConnectionException {
67 55
		super();
68 56
		this.setUrl(url);
69 57
		setDriverClassName(DEFAULT_DRIVER_CLASS_NAME);
70 58
	}
71 59

  
72
	/**
73
	 * @param url
74
	 * @param username
75
	 * @param password
76
	 * @throws CannotGetJdbcConnectionException
77
	 */
78 60
	public LocalHsqldb(String url, String username, String password)
79 61
			throws CannotGetJdbcConnectionException {
80 62
		super();
......
84 66
		this.setDriverClassName(DEFAULT_DRIVER_CLASS_NAME);
85 67
	}
86 68

  
87
	/**
88
	 * @param driverClassName
89
	 * @param url
90
	 * @param username
91
	 * @param password
92
	 * @throws CannotGetJdbcConnectionException
93
	 */
94 69
	public LocalHsqldb(String driverClassName, String url, String username,
95 70
			String password) throws CannotGetJdbcConnectionException {
96 71
		super();
......
110 85
		this.stopHsqldbServer();
111 86
	}
112 87

  
113

  
114
	/* (non-Javadoc)
115
	 * @see org.springframework.jdbc.datasource.BasicDataSource#getUrl()
116
	 */
117 88
	@Override
118 89
	public String getUrl() {
119 90
		return super.getUrl();
120 91
	}
121

  
122
	/* (non-Javadoc)
123
	 * @see org.springframework.jdbc.datasource.BasicDataSource#setUrl(java.lang.String)
124
	 */
125 92
	@Override
126 93
	public void setUrl(String url) {
127 94
		super.setUrl(url);
128 95
	}
129 96

  
130
	/**
131
	 * @return the pureUrl
132
	 */
133 97
	public String getPureUrl() {
134 98
		return pureUrl;
135 99
	}
136

  
137
	/**
138
	 * @param pureUrl the pureUrl to set
139
	 */
140 100
	public void setPureUrl(String pureUrl) {
141 101
		this.pureUrl = pureUrl;
142 102
		if (dbName != null){
......
144 104
		}
145 105
	}
146 106

  
147
	/**
148
	 * @return the dbName
149
	 */
150 107
	public String getDbName() {
151 108
		return dbName;
152 109
	}
153

  
154
	/**
155
	 * @param dbName the dbName to set
156
	 */
157 110
	public void setDbName(String dbName) {
158 111
		this.dbName = dbName;
159 112
		if (pureUrl != null){
......
224 177
		}
225 178
	}
226 179

  
227
	/**
228
	 * @return the dbPath
229
	 */
230 180
	public String getFilePath() {
231 181
		return databasePath;
232 182
	}
233

  
234
	/**
235
	 * @param dbPath the dbPath to set
236
	 */
237 183
	public void setFilePath(String filePath) {
238 184
		if (databasePath.endsWith(sep)){
239 185
			databasePath = databasePath + "localCdm";
......
241 187
		this.databasePath = filePath;
242 188
	}
243 189

  
244
	/**
245
	 * @return the isStartServer
246
	 */
247 190
	public boolean isStartServer() {
248 191
		return isStartServer;
249 192
	}
250

  
251
	/**
252
	 * @param isStartServer the isStartServer to set
253
	 */
254 193
	public void setStartServer(boolean isStartServer) {
255 194
		this.isStartServer = isStartServer;
256 195
	}
257 196

  
258
	/**
259
	 * @return the isSilent
260
	 */
261 197
	public boolean isSilent() {
262 198
		return isSilent;
263 199
	}
264

  
265
	/**
266
	 * @param isSilent the isSilent to set
267
	 */
268 200
	public void setSilent(boolean isSilent) {
269 201
		if (this.hsqldbServer != null){
270 202
			this.hsqldbServer.setSilent(isSilent);
271 203
		}
272 204
		this.isSilent = isSilent;
273 205
	}
274

  
275

  
276

  
277 206
}
cdmlib-services/pom.xml
60 60
      <artifactId>cdmlib-test</artifactId>
61 61
      <scope>test</scope>
62 62
    </dependency>
63
<!--     <dependency> -->
64
<!--       <groupId>eu.etaxonomy</groupId> -->
65
<!--       <artifactId>cdmlib-persistence</artifactId> -->
66
<!--       <type>test-jar</type> -->
67
<!--       <scope>test</scope> -->
68
<!--       <version>${project.version}</version> -->
69
<!--      </dependency> -->
70 63
    <dependency>
71 64
       <groupId>org.apache.lucene</groupId>
72 65
       <artifactId>lucene-highlighter</artifactId>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)