Skip to content

Commit

Permalink
Allow custom plugin loader injection (#213) (#215)
Browse files Browse the repository at this point in the history
(cherry picked from commit 281d716)
  • Loading branch information
mikkokar authored Jul 13, 2018
1 parent cf8c6df commit 4649557
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ public Builder loggingSetUp(String logConfigLocation) {
public Builder plugins(Iterable<NamedPlugin> plugins) {
requireNonNull(plugins);
List<NamedPlugin> list = ImmutableList.copyOf(plugins);
return pluginsLoader(env -> list);
return plugins(env -> list);
}

public Builder pluginsLoader(PluginsLoader pluginsLoader) {
public Builder plugins(PluginsLoader pluginsLoader) {
this.pluginsLoader = requireNonNull(pluginsLoader);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void setsUpLoggingOnBuild() {
public void loadsPlugins() {
StyxServerComponents components = new StyxServerComponents.Builder()
.styxConfig(new StyxConfig())
.pluginsLoader(env -> ImmutableList.of(
.plugins(env -> ImmutableList.of(
namedPlugin("plugin1", stubPlugin("MyResponse1")),
namedPlugin("plugin2", stubPlugin("MyResponse2"))))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private StyxServer(Builder builder) {

StyxServerComponents config = new StyxServerComponents.Builder()
.styxConfig(styxConfig(builder))
.pluginsLoader(loader)
.plugins(loader)
.additionalServices(ImmutableMap.of("backendServiceRegistry", new RegistryServiceAdapter(backendServicesRegistry)))
.build();

Expand Down

0 comments on commit 4649557

Please sign in to comment.