System property loader for RegistryConfig

This change allows registries to customize the values returned by
RegistryConfig methods without needing to edit Domain Registry code in a
forked repository. This is accomplished by defining a custom
RegistryConfig implementation and specifying its name as a system
property in appengine-web.xml.

This change also open-sources the production configuration values that
Google has chosen to use for these methods. TestRegistryConfig was
hitherto used for production configuration in the open source world,
which is misleading and inappropriate, considering it tunes values such
as the number of commit log buckets to 1.

Another important benefit of this change is that it helps registry_tool
work out of the box in the open source world.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129022675
This commit is contained in:
Justine Tunney 2016-08-01 13:52:34 -07:00
parent e3bb5dc9b0
commit 3f471a32e2
5 changed files with 317 additions and 5 deletions

View file

@ -47,6 +47,10 @@ import org.joda.time.Duration;
* in the user's repository. For this to work, other files need to be copied too, such as
* {@link google.registry.module.backend.BackendComponent BackendComponent}. This allows modules to
* be substituted at the {@code @Component} level.
*
* <p>There's also a deprecated configuration class that needs to be overridden and supplied via a
* system property. See the instructions in {@link ProductionRegistryConfigExample} and
* {@link RegistryConfigLoader}.
*/
@Module
public final class ConfigModule {