litesoft
Diff Revisions
473
vs
474
for /trunk/Java/GWT/Server/src/org/litesoft/GWT/server/AbstractServerApp.java
|
@@ -11,6 +11,7 @@ |
11 |
11 |
|
import org.litesoft.core.simpletypes.temporal.*; |
12 |
12 |
|
import org.litesoft.logger.*; |
13 |
13 |
|
import org.litesoft.logger.nonpublic.*; |
|
14 |
+ |
import org.litesoft.loggerconfig.*; |
14 |
15 |
|
import org.litesoft.reports.*; |
15 |
16 |
|
import org.litesoft.util.*; |
16 |
17 |
|
import org.litesoft.util.template.*; |
|
@@ -18,6 +19,7 @@ |
18 |
19 |
|
import com.google.gwt.user.client.rpc.*; |
19 |
20 |
|
import com.google.gwt.user.server.rpc.*; |
20 |
21 |
|
|
|
22 |
+ |
@SuppressWarnings({"UnusedDeclaration"}) |
21 |
23 |
|
public abstract class AbstractServerApp extends RemoteServiceServlet // don't forget this! |
22 |
24 |
|
{ |
23 |
25 |
|
protected static final String PLUS_OVERFLOW_HIDDEN = " overflow: hidden;"; |
|
@@ -51,6 +53,13 @@ |
51 |
53 |
|
sOneTimeInitException = pOneTimeInitException; |
52 |
54 |
|
} |
53 |
55 |
|
|
|
56 |
+ |
protected final String mAppName; |
|
57 |
+ |
|
|
58 |
+ |
protected AbstractServerApp( String pAppName ) |
|
59 |
+ |
{ |
|
60 |
+ |
mAppName = pAppName; |
|
61 |
+ |
} |
|
62 |
+ |
|
54 |
63 |
|
@Override |
55 |
64 |
|
public void init() |
56 |
65 |
|
throws ServletException |
|
@@ -153,9 +162,29 @@ |
153 |
162 |
|
mConfigurationLoadingWarning.add( pWarning ); |
154 |
163 |
|
} |
155 |
164 |
|
|
156 |
|
- |
abstract protected String getApplicationVersion(); |
|
165 |
+ |
protected LoggerLevel instantiateConfiguration() |
|
166 |
+ |
{ |
|
167 |
+ |
instantiateServerConfiguration(); |
|
168 |
+ |
return new ConfigurationLoggerLevel(); |
|
169 |
+ |
} |
157 |
170 |
|
|
158 |
|
- |
abstract protected LoggerLevel instantiateConfiguration(); |
|
171 |
+ |
protected void instantiateServerConfiguration() |
|
172 |
+ |
{ |
|
173 |
+ |
ConfigDataAccessorFactory zFactory = new WebInfConfigAccessorLocator( mAppName ); |
|
174 |
+ |
zFactory = new ServerConfigDataAccessorFactoryProxy( zFactory ); |
|
175 |
+ |
new ServerConfiguration( zFactory );// force creation & self registration of Configuration |
|
176 |
+ |
if ( (null != Utils.noEmpty( Configuration.getString( "databaseURL" ) )) && (System.getProperty( "HSQL" ) != null) ) |
|
177 |
+ |
{ |
|
178 |
+ |
// JDBC HSQL stuff: |
|
179 |
+ |
Configuration.setKeyValue( ConfigDataAccessor.Level.RUN, "databaseDriverClassName", "org.hsqldb.jdbcDriver" ); |
|
180 |
+ |
Configuration.setKeyValue( ConfigDataAccessor.Level.RUN, "databaseURL", "jdbc:hsqldb:mem:production_pos" ); |
|
181 |
+ |
Configuration.setKeyValue( ConfigDataAccessor.Level.RUN, "databaseUserName", "sa" ); |
|
182 |
+ |
Configuration.setKeyValue( ConfigDataAccessor.Level.RUN, "databaseUserPassword", "" ); // Must treat "" as No Password! |
|
183 |
+ |
Configuration.setKeyValue( ConfigDataAccessor.Level.RUN, "populateDatabase", "true" ); |
|
184 |
+ |
} |
|
185 |
+ |
} |
|
186 |
+ |
|
|
187 |
+ |
abstract protected String getApplicationVersion(); |
159 |
188 |
|
|
160 |
189 |
|
abstract protected void startUpApplication(); |
161 |
190 |
|
|