Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
schbrain-parent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
panwangnan
schbrain-parent
Commits
e361754b
Commit
e361754b
authored
May 14, 2023
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
0c03802e
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
49 additions
and
79 deletions
+49
-79
commons/common-util/src/main/java/com/schbrain/common/util/support/ConfigurableProperties.java
.../schbrain/common/util/support/ConfigurableProperties.java
+8
-16
commons/web-common/src/main/java/com/schbrain/common/web/properties/WebProperties.java
...ava/com/schbrain/common/web/properties/WebProperties.java
+1
-3
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/ConfigurablePropertiesLoader.java
...rk/autoconfigure/apollo/ConfigurablePropertiesLoader.java
+6
-6
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/ConfigLoadedEvent.java
...amework/autoconfigure/apollo/event/ConfigLoadedEvent.java
+6
-6
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/ConfigLoadedEventListener.java
...gure/apollo/event/listener/ConfigLoadedEventListener.java
+2
-2
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/GenericConfigLoadedEventListener.java
...ollo/event/listener/GenericConfigLoadedEventListener.java
+6
-6
starters/cache-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/cache/properties/CacheProperties.java
...ework/autoconfigure/cache/properties/CacheProperties.java
+1
-3
starters/cache-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/cache/provider/redis/RedisProperties.java
...k/autoconfigure/cache/provider/redis/RedisProperties.java
+1
-3
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/listener/DubboConfigLoadedEventListener.java
...figure/dubbo/listener/DubboConfigLoadedEventListener.java
+4
-4
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/properties/DubboProperties.java
...ework/autoconfigure/dubbo/properties/DubboProperties.java
+1
-3
starters/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.factories
...boot-starter/src/main/resources/META-INF/spring.factories
+1
-1
starters/elasticsearch-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/elasticsearch/properties/ElasticsearchProperties.java
...ure/elasticsearch/properties/ElasticsearchProperties.java
+1
-3
starters/kafka-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/kafka/properties/KafkaProperties.java
...ework/autoconfigure/kafka/properties/KafkaProperties.java
+1
-3
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/LoggerConfigLoadedEventListener.java
...gure/logger/listener/LoggerConfigLoadedEventListener.java
+4
-4
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/properties/LoggerProperties.java
...ork/autoconfigure/logger/properties/LoggerProperties.java
+1
-3
starters/logger-spring-boot-starter/src/main/resources/META-INF/spring.factories
...boot-starter/src/main/resources/META-INF/spring.factories
+1
-1
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/properties/DataSourceProperties.java
...utoconfigure/mybatis/properties/DataSourceProperties.java
+1
-3
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/properties/MybatisProperties.java
...k/autoconfigure/mybatis/properties/MybatisProperties.java
+1
-3
starters/oss-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/oss/properties/OssProperties.java
...framework/autoconfigure/oss/properties/OssProperties.java
+1
-3
starters/xxl-job-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/xxl/properties/XxlJobProperties.java
...mework/autoconfigure/xxl/properties/XxlJobProperties.java
+1
-3
No files found.
commons/common-util/src/main/java/com/schbrain/common/util/support/ConfigurableProperties.java
View file @
e361754b
package
com.schbrain.common.util.support
;
package
com.schbrain.common.util.support
;
import
com.schbrain.common.util.ConfigurationPropertiesUtils
;
import
com.schbrain.common.util.ConfigurationPropertiesUtils
;
import
lombok.Data
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.bind.*
;
import
org.springframework.boot.context.properties.bind.Bindable
;
import
org.springframework.boot.context.properties.bind.Binder
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.ConfigurableEnvironment
;
...
@@ -11,30 +11,29 @@ import org.springframework.core.env.ConfigurableEnvironment;
...
@@ -11,30 +11,29 @@ import org.springframework.core.env.ConfigurableEnvironment;
* @author liaozan
* @author liaozan
* @since 2022/1/10
* @since 2022/1/10
*/
*/
@Data
public
interface
ConfigurableProperties
extends
Ordered
{
public
abstract
class
ConfigurableProperties
implements
Ordered
{
/**
/**
* get the namespace of remote config
* get the namespace of remote config
*/
*/
public
abstract
String
getNamespace
();
String
getNamespace
();
/**
/**
* bind properties
* bind properties
*/
*/
public
ConfigurableProperties
bind
(
ConfigurableEnvironment
environment
)
{
default
ConfigurableProperties
bind
(
ConfigurableEnvironment
environment
)
{
return
Binder
.
get
(
environment
,
bindHandler
()
).
bindOrCreate
(
getPropertiesPrefix
(),
Bindable
.
ofInstance
(
this
));
return
Binder
.
get
(
environment
).
bindOrCreate
(
getPropertiesPrefix
(),
Bindable
.
ofInstance
(
this
));
}
}
@Override
@Override
public
int
getOrder
()
{
default
int
getOrder
()
{
return
Ordered
.
LOWEST_PRECEDENCE
;
return
Ordered
.
LOWEST_PRECEDENCE
;
}
}
/**
/**
* the prefix of properties
* the prefix of properties
*/
*/
pr
otected
String
getPropertiesPrefix
()
{
pr
ivate
String
getPropertiesPrefix
()
{
ConfigurationProperties
annotation
=
getClass
().
getAnnotation
(
ConfigurationProperties
.
class
);
ConfigurationProperties
annotation
=
getClass
().
getAnnotation
(
ConfigurationProperties
.
class
);
if
(
annotation
==
null
)
{
if
(
annotation
==
null
)
{
String
className
=
ConfigurationProperties
.
class
.
getName
();
String
className
=
ConfigurationProperties
.
class
.
getName
();
...
@@ -44,11 +43,4 @@ public abstract class ConfigurableProperties implements Ordered {
...
@@ -44,11 +43,4 @@ public abstract class ConfigurableProperties implements Ordered {
return
ConfigurationPropertiesUtils
.
getPrefix
(
getClass
());
return
ConfigurationPropertiesUtils
.
getPrefix
(
getClass
());
}
}
/**
* get the {@link org.springframework.boot.context.properties.bind.BindHandler} for bind
*/
protected
BindHandler
bindHandler
()
{
return
BindHandler
.
DEFAULT
;
}
}
}
\ No newline at end of file
commons/web-common/src/main/java/com/schbrain/common/web/properties/WebProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.common.web.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.common.web.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
...
@@ -12,9 +11,8 @@ import java.nio.charset.StandardCharsets;
...
@@ -12,9 +11,8 @@ import java.nio.charset.StandardCharsets;
* @since 2022/8/29
* @since 2022/8/29
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.web"
)
@ConfigurationProperties
(
prefix
=
"schbrain.web"
)
public
class
WebProperties
extend
s
ConfigurableProperties
{
public
class
WebProperties
implement
s
ConfigurableProperties
{
/**
/**
* whether to enable the request logging
* whether to enable the request logging
...
...
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/ConfigurablePropertiesLoader.java
View file @
e361754b
...
@@ -5,8 +5,8 @@ import com.ctrip.framework.apollo.ConfigService;
...
@@ -5,8 +5,8 @@ import com.ctrip.framework.apollo.ConfigService;
import
com.schbrain.common.util.properties.OrderedMapPropertySource
;
import
com.schbrain.common.util.properties.OrderedMapPropertySource
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.framework.autoconfigure.apollo.event.ConcurrentEventMulticaster
;
import
com.schbrain.framework.autoconfigure.apollo.event.ConcurrentEventMulticaster
;
import
com.schbrain.framework.autoconfigure.apollo.event.
PropertiesPrepar
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.
ConfigLoad
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.
PropertiesPrepar
edEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.
ConfigLoad
edEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.properties.ApolloProperties
;
import
com.schbrain.framework.autoconfigure.apollo.properties.ApolloProperties
;
import
com.schbrain.framework.autoconfigure.apollo.util.ConfigUtils
;
import
com.schbrain.framework.autoconfigure.apollo.util.ConfigUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
...
@@ -79,16 +79,16 @@ class ConfigurablePropertiesLoader {
...
@@ -79,16 +79,16 @@ class ConfigurablePropertiesLoader {
});
});
}
}
private
PropertiesPrepar
edEvent
createEvent
(
ConfigurableEnvironment
environment
,
SpringApplication
application
,
private
ConfigLoad
edEvent
createEvent
(
ConfigurableEnvironment
environment
,
SpringApplication
application
,
OrderedMapPropertySource
propertySource
,
ConfigurableProperties
properties
)
{
OrderedMapPropertySource
propertySource
,
ConfigurableProperties
properties
)
{
ConfigurableProperties
boundProperties
=
properties
.
bind
(
environment
);
ConfigurableProperties
boundProperties
=
properties
.
bind
(
environment
);
return
new
PropertiesPrepar
edEvent
(
environment
,
deferredLogFactory
,
propertySource
,
boundProperties
,
application
);
return
new
ConfigLoad
edEvent
(
environment
,
deferredLogFactory
,
propertySource
,
boundProperties
,
application
);
}
}
private
ConcurrentEventMulticaster
createEventMulticaster
(
Set
<
ApplicationListener
<?>>
listeners
)
{
private
ConcurrentEventMulticaster
createEventMulticaster
(
Set
<
ApplicationListener
<?>>
listeners
)
{
ConcurrentEventMulticaster
eventMulticaster
=
new
ConcurrentEventMulticaster
();
ConcurrentEventMulticaster
eventMulticaster
=
new
ConcurrentEventMulticaster
();
for
(
ApplicationListener
<?>
listener
:
listeners
)
{
for
(
ApplicationListener
<?>
listener
:
listeners
)
{
if
(
ClassUtils
.
isAssignableValue
(
PropertiesPrepar
edEventListener
.
class
,
listener
))
{
if
(
ClassUtils
.
isAssignableValue
(
ConfigLoad
edEventListener
.
class
,
listener
))
{
eventMulticaster
.
addApplicationListener
(
listener
);
eventMulticaster
.
addApplicationListener
(
listener
);
}
}
}
}
...
...
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/
PropertiesPrepar
edEvent.java
→
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/
ConfigLoad
edEvent.java
View file @
e361754b
...
@@ -13,7 +13,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
...
@@ -13,7 +13,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
* @since 2023-04-28
* @since 2023-04-28
*/
*/
@Getter
@Getter
public
class
PropertiesPrepar
edEvent
extends
ApplicationEvent
{
public
class
ConfigLoad
edEvent
extends
ApplicationEvent
{
private
static
final
long
serialVersionUID
=
2567291189881702459L
;
private
static
final
long
serialVersionUID
=
2567291189881702459L
;
...
@@ -25,11 +25,11 @@ public class PropertiesPreparedEvent extends ApplicationEvent {
...
@@ -25,11 +25,11 @@ public class PropertiesPreparedEvent extends ApplicationEvent {
private
final
SpringApplication
springApplication
;
private
final
SpringApplication
springApplication
;
public
PropertiesPrepar
edEvent
(
ConfigurableEnvironment
environment
,
public
ConfigLoad
edEvent
(
ConfigurableEnvironment
environment
,
DeferredLogFactory
deferredLogFactory
,
DeferredLogFactory
deferredLogFactory
,
OrderedMapPropertySource
propertySource
,
OrderedMapPropertySource
propertySource
,
ConfigurableProperties
properties
,
ConfigurableProperties
properties
,
SpringApplication
springApplication
)
{
SpringApplication
springApplication
)
{
super
(
properties
);
super
(
properties
);
this
.
environment
=
environment
;
this
.
environment
=
environment
;
this
.
propertySource
=
propertySource
;
this
.
propertySource
=
propertySource
;
...
...
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/
PropertiesPrepar
edEventListener.java
→
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/
ConfigLoad
edEventListener.java
View file @
e361754b
package
com.schbrain.framework.autoconfigure.apollo.event.listener
;
package
com.schbrain.framework.autoconfigure.apollo.event.listener
;
import
com.schbrain.framework.autoconfigure.apollo.event.
PropertiesPrepar
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.
ConfigLoad
edEvent
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
...
@@ -8,7 +8,7 @@ import org.springframework.core.Ordered;
...
@@ -8,7 +8,7 @@ import org.springframework.core.Ordered;
* @author liaozan
* @author liaozan
* @since 2023-04-29
* @since 2023-04-29
*/
*/
public
interface
PropertiesPreparedEventListener
extends
ApplicationListener
<
PropertiesPrepar
edEvent
>,
Ordered
{
public
interface
ConfigLoadedEventListener
extends
ApplicationListener
<
ConfigLoad
edEvent
>,
Ordered
{
@Override
@Override
default
int
getOrder
()
{
default
int
getOrder
()
{
...
...
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/Generic
PropertiesPrepar
edEventListener.java
→
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/event/listener/Generic
ConfigLoad
edEventListener.java
View file @
e361754b
package
com.schbrain.framework.autoconfigure.apollo.event.listener
;
package
com.schbrain.framework.autoconfigure.apollo.event.listener
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.framework.autoconfigure.apollo.event.
PropertiesPrepar
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.
ConfigLoad
edEvent
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.springframework.core.ResolvableType
;
import
org.springframework.core.ResolvableType
;
...
@@ -10,24 +10,24 @@ import org.springframework.core.ResolvableType;
...
@@ -10,24 +10,24 @@ import org.springframework.core.ResolvableType;
* @since 2023-04-28
* @since 2023-04-28
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
abstract
class
Generic
PropertiesPreparedEventListener
<
T
extends
ConfigurableProperties
>
implements
PropertiesPrepar
edEventListener
{
public
abstract
class
Generic
ConfigLoadedEventListener
<
T
extends
ConfigurableProperties
>
implements
ConfigLoad
edEventListener
{
protected
final
ResolvableType
propertiesType
;
protected
final
ResolvableType
propertiesType
;
protected
Log
log
;
protected
Log
log
;
public
Generic
PropertiesPrepar
edEventListener
()
{
public
Generic
ConfigLoad
edEventListener
()
{
this
.
propertiesType
=
ResolvableType
.
forInstance
(
this
).
getSuperType
().
getGeneric
(
0
);
this
.
propertiesType
=
ResolvableType
.
forInstance
(
this
).
getSuperType
().
getGeneric
(
0
);
}
}
@Override
@Override
public
void
onApplicationEvent
(
PropertiesPrepar
edEvent
event
)
{
public
void
onApplicationEvent
(
ConfigLoad
edEvent
event
)
{
if
(
propertiesType
.
isInstance
(
event
.
getConfigurableProperties
()))
{
if
(
propertiesType
.
isInstance
(
event
.
getConfigurableProperties
()))
{
this
.
log
=
event
.
getDeferredLogFactory
().
getLog
(
getClass
());
this
.
log
=
event
.
getDeferredLogFactory
().
getLog
(
getClass
());
this
.
on
PropertiesPrepar
ed
(
event
,
(
T
)
event
.
getConfigurableProperties
());
this
.
on
ConfigLoad
ed
(
event
,
(
T
)
event
.
getConfigurableProperties
());
}
}
}
}
protected
abstract
void
on
PropertiesPrepared
(
PropertiesPrepar
edEvent
event
,
T
configurableProperties
);
protected
abstract
void
on
ConfigLoaded
(
ConfigLoad
edEvent
event
,
T
configurableProperties
);
}
}
\ No newline at end of file
starters/cache-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/cache/properties/CacheProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.cache.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.cache.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2022/7/26
* @since 2022/7/26
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.cache"
)
@ConfigurationProperties
(
prefix
=
"schbrain.cache"
)
public
class
CacheProperties
extend
s
ConfigurableProperties
{
public
class
CacheProperties
implement
s
ConfigurableProperties
{
/**
/**
* cache prefix
* cache prefix
...
...
starters/cache-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/cache/provider/redis/RedisProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.cache.provider.redis;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.cache.provider.redis;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2023-04-27
* @since 2023-04-27
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"spring.redis"
)
@ConfigurationProperties
(
prefix
=
"spring.redis"
)
public
class
RedisProperties
extend
s
ConfigurableProperties
{
public
class
RedisProperties
implement
s
ConfigurableProperties
{
@Override
@Override
public
String
getNamespace
()
{
public
String
getNamespace
()
{
...
...
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/listener/Dubbo
PropertiesPrepar
edEventListener.java
→
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/listener/Dubbo
ConfigLoad
edEventListener.java
View file @
e361754b
...
@@ -3,8 +3,8 @@ package com.schbrain.framework.autoconfigure.dubbo.listener;
...
@@ -3,8 +3,8 @@ package com.schbrain.framework.autoconfigure.dubbo.listener;
import
com.alibaba.fastjson2.JSONFactory
;
import
com.alibaba.fastjson2.JSONFactory
;
import
com.schbrain.common.util.ApplicationName
;
import
com.schbrain.common.util.ApplicationName
;
import
com.schbrain.common.util.properties.OrderedMapPropertySource
;
import
com.schbrain.common.util.properties.OrderedMapPropertySource
;
import
com.schbrain.framework.autoconfigure.apollo.event.
PropertiesPrepar
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.
ConfigLoad
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.Generic
PropertiesPrepar
edEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.Generic
ConfigLoad
edEventListener
;
import
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
;
import
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ApplicationContextInitializer
;
...
@@ -18,7 +18,7 @@ import static org.apache.dubbo.config.ConfigKeys.DUBBO_SCAN_BASE_PACKAGES;
...
@@ -18,7 +18,7 @@ import static org.apache.dubbo.config.ConfigKeys.DUBBO_SCAN_BASE_PACKAGES;
* @author liaozan
* @author liaozan
* @since 2023-04-28
* @since 2023-04-28
*/
*/
public
class
Dubbo
PropertiesPreparedEventListener
extends
GenericPropertiesPrepar
edEventListener
<
DubboProperties
>
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
public
class
Dubbo
ConfigLoadedEventListener
extends
GenericConfigLoad
edEventListener
<
DubboProperties
>
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
public
static
final
String
DUBBO_APPLICATION_NAME
=
"dubbo.application.name"
;
public
static
final
String
DUBBO_APPLICATION_NAME
=
"dubbo.application.name"
;
...
@@ -33,7 +33,7 @@ public class DubboPropertiesPreparedEventListener extends GenericPropertiesPrepa
...
@@ -33,7 +33,7 @@ public class DubboPropertiesPreparedEventListener extends GenericPropertiesPrepa
}
}
@Override
@Override
protected
void
on
PropertiesPrepared
(
PropertiesPrepar
edEvent
event
,
DubboProperties
properties
)
{
protected
void
on
ConfigLoaded
(
ConfigLoad
edEvent
event
,
DubboProperties
properties
)
{
event
.
getSpringApplication
().
addInitializers
(
this
);
event
.
getSpringApplication
().
addInitializers
(
this
);
setRequiredProperties
(
event
.
getEnvironment
(),
event
.
getSpringApplication
(),
event
.
getPropertySource
());
setRequiredProperties
(
event
.
getEnvironment
(),
event
.
getSpringApplication
(),
event
.
getPropertySource
());
JSONFactory
.
setUseJacksonAnnotation
(
false
);
JSONFactory
.
setUseJacksonAnnotation
(
false
);
...
...
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/properties/DubboProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.dubbo.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.dubbo.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.apache.dubbo.config.*
;
import
org.apache.dubbo.config.*
;
import
org.apache.dubbo.config.spring.context.annotation.EnableDubbo
;
import
org.apache.dubbo.config.spring.context.annotation.EnableDubbo
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
...
@@ -18,9 +17,8 @@ import java.util.Set;
...
@@ -18,9 +17,8 @@ import java.util.Set;
* @since 2021/12/6
* @since 2021/12/6
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"dubbo"
)
@ConfigurationProperties
(
prefix
=
"dubbo"
)
public
class
DubboProperties
extend
s
ConfigurableProperties
{
public
class
DubboProperties
implement
s
ConfigurableProperties
{
@NestedConfigurationProperty
@NestedConfigurationProperty
private
Scan
scan
=
new
Scan
();
private
Scan
scan
=
new
Scan
();
...
...
starters/dubbo-spring-boot-starter/src/main/resources/META-INF/spring.factories
View file @
e361754b
com.schbrain.common.util.support.ConfigurableProperties=\
com.schbrain.common.util.support.ConfigurableProperties=\
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
org.springframework.context.ApplicationListener=\
org.springframework.context.ApplicationListener=\
com.schbrain.framework.autoconfigure.dubbo.listener.DubboPropertiesPreparedEventListener
com.schbrain.framework.autoconfigure.dubbo.listener.DubboConfigLoadedEventListener
\ No newline at end of file
\ No newline at end of file
starters/elasticsearch-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/elasticsearch/properties/ElasticsearchProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.elasticsearch.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.elasticsearch.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2023-04-29
* @since 2023-04-29
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"spring.elasticsearch"
)
@ConfigurationProperties
(
prefix
=
"spring.elasticsearch"
)
public
class
ElasticsearchProperties
extend
s
ConfigurableProperties
{
public
class
ElasticsearchProperties
implement
s
ConfigurableProperties
{
@Override
@Override
public
String
getNamespace
()
{
public
String
getNamespace
()
{
...
...
starters/kafka-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/kafka/properties/KafkaProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.kafka.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.kafka.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2023-04-29
* @since 2023-04-29
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"spring.kafka"
)
@ConfigurationProperties
(
prefix
=
"spring.kafka"
)
public
class
KafkaProperties
extend
s
ConfigurableProperties
{
public
class
KafkaProperties
implement
s
ConfigurableProperties
{
@Override
@Override
public
String
getNamespace
()
{
public
String
getNamespace
()
{
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/Logger
PropertiesPrepar
edEventListener.java
→
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/Logger
ConfigLoad
edEventListener.java
View file @
e361754b
...
@@ -8,8 +8,8 @@ import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
...
@@ -8,8 +8,8 @@ import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.schbrain.common.util.InetUtils
;
import
com.schbrain.common.util.InetUtils
;
import
com.schbrain.common.util.InetUtils.HostInfo
;
import
com.schbrain.common.util.InetUtils.HostInfo
;
import
com.schbrain.framework.autoconfigure.apollo.event.
PropertiesPrepar
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.
ConfigLoad
edEvent
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.Generic
PropertiesPrepar
edEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.event.listener.Generic
ConfigLoad
edEventListener
;
import
com.schbrain.framework.autoconfigure.logger.LoggerConfigurationInitializer
;
import
com.schbrain.framework.autoconfigure.logger.LoggerConfigurationInitializer
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.ConfigurableEnvironment
;
...
@@ -25,10 +25,10 @@ import static org.springframework.boot.context.logging.LoggingApplicationListene
...
@@ -25,10 +25,10 @@ import static org.springframework.boot.context.logging.LoggingApplicationListene
* @author liaozan
* @author liaozan
* @since 2023-04-28
* @since 2023-04-28
*/
*/
public
class
Logger
PropertiesPreparedEventListener
extends
GenericPropertiesPrepar
edEventListener
<
LoggerProperties
>
{
public
class
Logger
ConfigLoadedEventListener
extends
GenericConfigLoad
edEventListener
<
LoggerProperties
>
{
@Override
@Override
protected
void
on
PropertiesPrepared
(
PropertiesPrepar
edEvent
event
,
LoggerProperties
properties
)
{
protected
void
on
ConfigLoaded
(
ConfigLoad
edEvent
event
,
LoggerProperties
properties
)
{
ConfigurableEnvironment
environment
=
event
.
getEnvironment
();
ConfigurableEnvironment
environment
=
event
.
getEnvironment
();
HostInfo
hostInfo
=
InetUtils
.
findFirstNonLoopBackHostInfo
();
HostInfo
hostInfo
=
InetUtils
.
findFirstNonLoopBackHostInfo
();
Map
<
String
,
String
>
hostInfoProperties
=
buildHostInfoProperties
(
hostInfo
);
Map
<
String
,
String
>
hostInfoProperties
=
buildHostInfoProperties
(
hostInfo
);
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/properties/LoggerProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.logger.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.logger.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.core.PriorityOrdered
;
import
org.springframework.core.PriorityOrdered
;
...
@@ -13,9 +12,8 @@ import java.time.Duration;
...
@@ -13,9 +12,8 @@ import java.time.Duration;
* @since 2021/12/11
* @since 2021/12/11
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.logging.file"
)
@ConfigurationProperties
(
prefix
=
"schbrain.logging.file"
)
public
class
LoggerProperties
extends
ConfigurableProperties
implements
PriorityOrdered
{
public
class
LoggerProperties
implements
ConfigurableProperties
,
PriorityOrdered
{
public
static
final
String
DEFAULT_LOG_PATH
=
"/data/logs"
;
public
static
final
String
DEFAULT_LOG_PATH
=
"/data/logs"
;
...
...
starters/logger-spring-boot-starter/src/main/resources/META-INF/spring.factories
View file @
e361754b
org.springframework.context.ApplicationContextInitializer=\
org.springframework.context.ApplicationContextInitializer=\
com.schbrain.framework.autoconfigure.logger.logback.LogbackTraceIdConfiguration
com.schbrain.framework.autoconfigure.logger.logback.LogbackTraceIdConfiguration
org.springframework.context.ApplicationListener=\
org.springframework.context.ApplicationListener=\
com.schbrain.framework.autoconfigure.logger.listener.Logger
PropertiesPrepar
edEventListener
com.schbrain.framework.autoconfigure.logger.listener.Logger
ConfigLoad
edEventListener
com.schbrain.common.util.support.ConfigurableProperties=\
com.schbrain.common.util.support.ConfigurableProperties=\
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
\ No newline at end of file
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/properties/DataSourceProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.mybatis.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.mybatis.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2023-04-27
* @since 2023-04-27
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
@ConfigurationProperties
(
prefix
=
"spring.datasource"
)
public
class
DataSourceProperties
extend
s
ConfigurableProperties
{
public
class
DataSourceProperties
implement
s
ConfigurableProperties
{
@Override
@Override
public
String
getNamespace
()
{
public
String
getNamespace
()
{
...
...
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/properties/MybatisProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.mybatis.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.mybatis.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -10,9 +9,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2021/11/23
* @since 2021/11/23
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.mybatis"
)
@ConfigurationProperties
(
prefix
=
"schbrain.mybatis"
)
public
class
MybatisProperties
extend
s
ConfigurableProperties
{
public
class
MybatisProperties
implement
s
ConfigurableProperties
{
/**
/**
* 分页拦截器
* 分页拦截器
...
...
starters/oss-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/oss/properties/OssProperties.java
View file @
e361754b
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.oss.properties;
...
@@ -2,7 +2,6 @@ package com.schbrain.framework.autoconfigure.oss.properties;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
import
org.springframework.boot.context.properties.NestedConfigurationProperty
;
...
@@ -11,9 +10,8 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;
...
@@ -11,9 +10,8 @@ import org.springframework.boot.context.properties.NestedConfigurationProperty;
* @since 2021/12/3
* @since 2021/12/3
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.oss"
)
@ConfigurationProperties
(
prefix
=
"schbrain.oss"
)
public
class
OssProperties
extend
s
ConfigurableProperties
{
public
class
OssProperties
implement
s
ConfigurableProperties
{
private
String
accessKeyId
;
private
String
accessKeyId
;
...
...
starters/xxl-job-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/xxl/properties/XxlJobProperties.java
View file @
e361754b
...
@@ -3,7 +3,6 @@ package com.schbrain.framework.autoconfigure.xxl.properties;
...
@@ -3,7 +3,6 @@ package com.schbrain.framework.autoconfigure.xxl.properties;
import
com.schbrain.common.util.InetUtils
;
import
com.schbrain.common.util.InetUtils
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
/**
/**
...
@@ -11,9 +10,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
...
@@ -11,9 +10,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2022/1/8
* @since 2022/1/8
*/
*/
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ConfigurationProperties
(
prefix
=
"schbrain.xxl"
)
@ConfigurationProperties
(
prefix
=
"schbrain.xxl"
)
public
class
XxlJobProperties
extend
s
ConfigurableProperties
{
public
class
XxlJobProperties
implement
s
ConfigurableProperties
{
private
String
adminAddresses
;
private
String
adminAddresses
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment