File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
src/main/java/org/springframework/hateoas/config Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1515 */
1616package org .springframework .hateoas .config ;
1717
18+ import org .springframework .context .ApplicationContext ;
1819import org .springframework .context .annotation .Bean ;
1920import org .springframework .context .annotation .Configuration ;
2021import org .springframework .context .annotation .Primary ;
2122import org .springframework .hateoas .server .EntityLinks ;
2223import org .springframework .hateoas .server .core .DelegatingEntityLinks ;
24+ import org .springframework .plugin .core .OrderAwarePluginRegistry ;
2325import org .springframework .plugin .core .PluginRegistry ;
2426import org .springframework .plugin .core .support .PluginRegistryFactoryBean ;
2527
3335class EntityLinksConfiguration {
3436
3537 @ Bean
36- PluginRegistryFactoryBean <EntityLinks , Class <?>> entityLinksPluginRegistry () {
38+ OrderAwarePluginRegistry <EntityLinks , Class <?>> entityLinksPluginRegistry (ApplicationContext context ) {
3739
3840 PluginRegistryFactoryBean <EntityLinks , Class <?>> registry = new PluginRegistryFactoryBean <>();
41+ registry .setApplicationContext (context );
3942 registry .setType (EntityLinks .class );
4043 registry .setExclusions (new Class [] { DelegatingEntityLinks .class });
44+ registry .afterPropertiesSet ();
4145
42- return registry ;
46+ return registry . getObject () ;
4347 }
4448
4549 @ Primary
Original file line number Diff line number Diff line change 4545import org .springframework .hateoas .server .core .EvoInflectorLinkRelationProvider ;
4646import org .springframework .http .MediaType ;
4747import org .springframework .lang .Nullable ;
48+ import org .springframework .plugin .core .OrderAwarePluginRegistry ;
4849import org .springframework .plugin .core .PluginRegistry ;
4950import org .springframework .plugin .core .config .EnablePluginRegistries ;
5051import org .springframework .plugin .core .support .PluginRegistryFactoryBean ;
@@ -106,14 +107,15 @@ DelegatingLinkRelationProvider _relProvider(
106107 }
107108
108109 @ Bean
109- PluginRegistryFactoryBean <LinkRelationProvider , LookupContext > relProviderPluginRegistry () {
110+ OrderAwarePluginRegistry <LinkRelationProvider , LookupContext > relProviderPluginRegistry (ApplicationContext context ) {
110111
111112 PluginRegistryFactoryBean <LinkRelationProvider , LookupContext > factory = new PluginRegistryFactoryBean <>();
112-
113+ factory . setApplicationContext ( context );
113114 factory .setType (LinkRelationProvider .class );
114115 factory .setExclusions (new Class [] { DelegatingLinkRelationProvider .class });
116+ factory .afterPropertiesSet ();
115117
116- return factory ;
118+ return factory . getObject () ;
117119 }
118120
119121 // LinkDiscoverers
You can’t perform that action at this time.
0 commit comments