forked from andrewharmellaw/archaius-spring-adapter
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Harmel-Law
committed
Aug 11, 2014
1 parent
c8bc8d4
commit 24b0d2b
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** temporary */ | ||
DriverManagerDataSource ds = buildDataSourceFromConnectionDetailsMap(jdbcConnectionDetailMap); | ||
JDBCConfigurationSource source = buildJdbcConfigSourceFromConnectionDetailsMap(ds, jdbcConnectionDetailMap); | ||
FixedDelayPollingScheduler scheduler = new FixedDelayPollingScheduler(initialDelayMillis, delayMillis, ignoreDeletesFromSource); | ||
DynamicConfiguration dynamicConfiguration = new DynamicConfiguration(source, scheduler); | ||
/** temporary */ | ||
|
||
// DynamicConfiguration dynamicConfiguration = buildDynamicConfigFromConnectionDetailsMap(jdbcConnectionDetailMap, initialDelayMillis, delayMillis, ignoreDeletesFromSource); | ||
|
||
|
||
|
||
|
||
|
||
// TODO: the additional parameters are passed into this in the map anyway | ||
private DynamicConfiguration buildDynamicConfigFromConnectionDetailsMap(Map<String, String> jdbcConnectionDetailMap, int initialDelayMillis, int delayMillis, boolean ignoreDeletesFromSource) { | ||
DriverManagerDataSource ds = buildDataSourceFromConnectionDetailsMap(jdbcConnectionDetailMap); | ||
JDBCConfigurationSource source = buildJdbcConfigSourceFromConnectionDetailsMap(ds, jdbcConnectionDetailMap); | ||
FixedDelayPollingScheduler scheduler = new FixedDelayPollingScheduler(initialDelayMillis, delayMillis, ignoreDeletesFromSource); | ||
DynamicConfiguration dc = new DynamicConfiguration(source, scheduler); | ||
return dc; | ||
} | ||
|
||
private JDBCConfigurationSource buildJdbcConfigSourceFromConnectionDetailsMap(DriverManagerDataSource ds, Map<String, String> jdbcConnectionDetailMap) { | ||
JDBCConfigurationSource source = new JDBCConfigurationSource(ds, | ||
jdbcConnectionDetailMap.get(JdbcContants.SQL_QUERY), | ||
jdbcConnectionDetailMap.get(JdbcContants.KEY_COLUMN_NAME), | ||
jdbcConnectionDetailMap.get(JdbcContants.VALUE_COLUMN_NAME)); | ||
return source; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
**********TODO******* | ||
|
||
Get the spring property placeholder to support JDBC too - do it with duplicates - then move the common bits into the shared file | ||
make the JDBC URl use URL semantics ("?abc=123&wed=576" etc) | ||
Make all the "getStringProperty()" calls take a valid default rather than a repeat of the key | ||
add extensive javadoc to the placeholderconfigurers | ||
port the junit tests to spock | ||
derby shutdown exceptions | ||
|
||
*********TOO HARD************ | ||
make everything live in location/locations (jdbc et al) | ||
do a single entry with "jdbc:..." - we need to be able to add/register a new Spring Resource implementation to do this | ||
|
||
|
||
**********DONE**************** | ||
clean out the system.properties and evenMoreSystem.properties from src/main/resources |