You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -16,18 +16,18 @@
16
16
</pre>
17
17
18
18
### Example Spring XML Configuration ###
19
-
* See _src/main/resources/spring-reloadableProperties.xml_ for example configuration
19
+
* See [spring-reloadableProperties.xml](https://github.com/jamesemorgan/DynamicPropertyLoader/blob/master/src/main/resources/spring/spring-reloadableProperties.xml) for example configuration
20
20
* All main components can be extended or replaced if required
21
21
22
22
### How it Works ###
23
-
When the spring Application Context is started an implementation of Springs PropertySourcesPlaceholderConfigurer is instantiated to perform additional logic when loading and setting values from a given set of properties files. (see:ReadablePropertySourcesPlaceholderConfigurer.class)
23
+
When the spring Application Context is started an implementation of Springs [PropertySourcesPlaceholderConfigurer](http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.html) is instantiated to perform additional logic when loading and setting values from a given set of properties files. (see:[ReadablePropertySourcesPlaceholderConfigurer](https://github.com/jamesemorgan/DynamicPropertyLoader/blob/master/src/main/java/com/morgan/design/properties/internal/ReadablePropertySourcesPlaceholderConfigurer.java))
24
24
25
-
During the time of ApplicationContext start also a new instance of InstantiationAwareBeanPostProcessorAdapter.class is created that allows post bean processing.
25
+
During the time of ApplicationContext start also a new instance of [InstantiationAwareBeanPostProcessorAdapter](http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.html) is created that allows post bean processing.
26
26
27
-
Google Guava is used to implement a simple Publish & Subscribe (Pub-Sub) Pattern so that beans can be updated once created, i.e. a bean can subscribe to events. (see: EventBus)
28
-
EventBus was chosen as it is a very easy and simplistic way to implement loosely couple object structure. (see: blog)
27
+
Google Guava is used to implement a simple Publish & Subscribe (Pub-Sub) Pattern so that beans can be updated once created, i.e. a bean can subscribe to events. (see: [EventBus](http://code.google.com/p/guava-libraries/wiki/EventBusExplained))
28
+
EventBus was chosen as it is a very easy and simplistic way to implement loosely couple object structure. (see: [blog](http://codingjunkie.net/guava-eventbus/))
29
29
30
-
When each properties file resource is loaded a PropertiesWatcher.class (see:FaileWatch.class) is started and attached to the given resource set, reporting on any java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY events from the host operating system
30
+
When each properties file resource is loaded a [PropertiesWatcher](https://github.com/jamesemorgan/DynamicPropertyLoader/blob/master/src/main/java/com/morgan/design/properties/internal/PropertiesWatcher.java) is started and attached to the given resource set, reporting on any [java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY](http://docs.oracle.com/javase/7/docs/api/java/nio/file/StandardWatchEventKinds.html#ENTRY_MODIFY) events from the host operating system
31
31
32
32
When an ENTRY_MODIFY event is fired firstly the resource changed is checked for property value changes then any bean subscribing to changes to the modified property has the specified field value updated with the new property
33
33
@@ -39,23 +39,22 @@ A set of integration and unit tests can be found in _src/test/java_ (tests) & _s
39
39
### TODO (Unfinished) ###
40
40
* Update test method names
41
41
* Creation of any test utilities or helper classes
42
-
* Add test for modifying file in directory which is not a properties file
43
42
* Replace callback EventHandler with Guava EventBus
44
43
45
44
### Why? ###
46
45
* Useful for web applications which often need configuration changes but you don't always want to restart the application before new properties are used.
47
46
* Can be used to define several layers of properties which can aid in defining multiple application configurations e.g sandbox/development/testing/production.
48
47
* A pet project of mine I have been intending to implement for a while
49
48
* A test of the new Java 7 WatchService API
50
-
* Another dive in Spring & general investigation of Google Guava's EventBus, a class which I believe is the extremely useful and easy to use
49
+
* Another dive in Spring & general investigation of Google Guava's EventBus
51
50
* The project is aimed to be open to modification if required
0 commit comments