Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(378)

Issue 3213042: Injecting Provider<DefaultConfig> allowing it to be overridden (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 11 months ago by gagan.goku
Modified:
14 years, 11 months ago
Reviewers:
johnfargo, dev
CC:
cool-shindig-committers_googlegroups.com
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

Use case: - per container overriding of DefaultConfig. Currently not possible, but with this patch, one should be able to add a provider which can provide different values for DefaultConfig (say for different containers). Here is a sample snippet which allows the same: protected void configure() { bind(DefaultConfig.class)..toProvider(DefaultConfigProvider.class); } public static class DefaultConfigProvider implements Provider<DefaultConfig> { public DefaultConfig get() { if (container == accel) { // Override return new DefaultConfig( ... ); // override default params } else { return defaultConfig; } } }

Patch Set 1 #

Patch Set 2 : adding provider #

Patch Set 3 : another try #

Patch Set 4 : another try #

Patch Set 5 : almost good to go #

Patch Set 6 : reverted sample implementation of DefaultConfigProvider #

Patch Set 7 : reverting unnecessary files #

Patch Set 8 : svn up #

Patch Set 9 : svn up #

Messages

Total messages: 4
satya3656
LGTM, Can you also give sample Provide<T> class example in the description, so that it ...
14 years, 11 months ago (2010-11-26 11:22:56 UTC) #1
gagan.goku
On 2010/11/26 11:22:56, satya3656 wrote: > LGTM, Can you also give sample Provide<T> class example ...
14 years, 11 months ago (2010-11-26 14:27:32 UTC) #2
gagan.goku
On 2010/11/26 14:27:32, gagan.goku wrote: > On 2010/11/26 11:22:56, satya3656 wrote: > > LGTM, Can ...
14 years, 11 months ago (2010-11-27 21:13:43 UTC) #3
johnfargo
14 years, 11 months ago (2010-11-29 17:12:41 UTC) #4
LGTM
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b