-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use DynamicModulesAutoConfiguration instead of DynamicModulesGrailsPlugin.doWithSpring
- Loading branch information
Showing
4 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/groovy/org/rainboyan/plugins/config/DynamicModulesAutoConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2022-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.rainboyan.plugins.config; | ||
|
||
import org.rainboyan.plugins.DefaultDynamicModulesManager; | ||
import org.rainboyan.plugins.DefaultModuleDescriptorFactory; | ||
import org.rainboyan.plugins.DynamicModulesManager; | ||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import grails.plugins.ModuleDescriptorFactory; | ||
|
||
/** | ||
* {@link EnableAutoConfiguration Auto-configuration} Dynamic Modules | ||
* | ||
* @author Michael Yan | ||
* @since 1.0.0 | ||
*/ | ||
@Configuration(proxyBeanMethods = false) | ||
public class DynamicModulesAutoConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public ModuleDescriptorFactory moduleDescriptorFactory() { | ||
return new DefaultModuleDescriptorFactory(); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public DynamicModulesManager dynamicModulesManager() { | ||
return new DefaultDynamicModulesManager(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Application Listener | ||
org.springframework.context.ApplicationListener=\ | ||
org.rainboyan.plugins.DynamicModulesApplicationListener | ||
|
||
# Auto Configure | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ | ||
org.rainboyan.plugins.config.DynamicModulesAutoConfiguration |
1 change: 1 addition & 0 deletions
1
...esources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.rainboyan.plugins.config.DynamicModulesAutoConfiguration |