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
5c3e0dd9
Commit
5c3e0dd9
authored
May 03, 2023
by
liaozan
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder dependencies
parent
37664e38
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
217 additions
and
181 deletions
+217
-181
commons/common-util/pom.xml
commons/common-util/pom.xml
+4
-0
pom.xml
pom.xml
+141
-141
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/listener/GenericPropertiesPreparedEventListener.java
...ollo/listener/GenericPropertiesPreparedEventListener.java
+32
-0
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/listener/PropertiesPreparedEventListener.java
...gure/apollo/listener/PropertiesPreparedEventListener.java
+7
-1
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/listener/DubboPropertiesPreparedEventListener.java
.../dubbo/listener/DubboPropertiesPreparedEventListener.java
+8
-2
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/LoggerAutoConfiguration.java
...amework/autoconfigure/logger/LoggerAutoConfiguration.java
+0
-3
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/LoggerPropertiesPreparedEventListener.java
...ogger/listener/LoggerPropertiesPreparedEventListener.java
+2
-2
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/datasource/DataSourceConnectionPostProcessor.java
...mybatis/datasource/DataSourceConnectionPostProcessor.java
+6
-7
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/GenericBeanPostProcessor.java
...in/framework/support/spring/GenericBeanPostProcessor.java
+17
-25
No files found.
commons/common-util/pom.xml
View file @
5c3e0dd9
...
@@ -19,6 +19,10 @@
...
@@ -19,6 +19,10 @@
<groupId>
com.schbrain.common
</groupId>
<groupId>
com.schbrain.common
</groupId>
<artifactId>
common
</artifactId>
<artifactId>
common
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
cglib
</groupId>
<artifactId>
cglib
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
...
...
pom.xml
View file @
5c3e0dd9
This diff is collapsed.
Click to expand it.
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/listener/
PropertiesPreparedEventListenerAdapt
er.java
→
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/listener/
GenericPropertiesPreparedEventListen
er.java
View file @
5c3e0dd9
...
@@ -2,37 +2,31 @@ package com.schbrain.framework.autoconfigure.apollo.listener;
...
@@ -2,37 +2,31 @@ package com.schbrain.framework.autoconfigure.apollo.listener;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
com.schbrain.common.util.support.ConfigurableProperties
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.springframework.core.ResolvableType
;
import
java.lang.reflect.ParameterizedType
;
import
java.lang.reflect.Type
;
/**
/**
* @author liaozan
* @author liaozan
* @since 2023-04-28
* @since 2023-04-28
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
class
PropertiesPreparedEventListenerAdapt
er
<
T
extends
ConfigurableProperties
>
implements
PropertiesPreparedEventListener
{
public
abstract
class
GenericPropertiesPreparedEventListen
er
<
T
extends
ConfigurableProperties
>
implements
PropertiesPreparedEventListener
{
pr
ivate
final
Class
<
T
>
property
Type
;
pr
otected
final
ResolvableType
properties
Type
;
protected
Log
log
;
protected
Log
log
;
public
PropertiesPreparedEventListenerAdapter
()
{
public
GenericPropertiesPreparedEventListener
()
{
ParameterizedType
parameterizedType
=
(
ParameterizedType
)
getClass
().
getGenericSuperclass
();
this
.
propertiesType
=
ResolvableType
.
forInstance
(
this
).
getSuperType
().
getGeneric
(
0
);
Type
[]
actualTypeArguments
=
parameterizedType
.
getActualTypeArguments
();
this
.
propertyType
=
(
Class
<
T
>)
actualTypeArguments
[
0
];
}
}
@Override
@Override
public
void
onApplicationEvent
(
PropertiesPreparedEvent
event
)
{
public
void
onApplicationEvent
(
PropertiesPreparedEvent
event
)
{
if
(
event
.
getConfigurableProperties
().
getClass
()
==
propertyType
)
{
if
(
propertiesType
.
isInstance
(
event
.
getConfigurableProperties
())
)
{
this
.
log
=
event
.
getDeferredLogFactory
().
getLog
(
this
.
getClass
());
this
.
log
=
event
.
getDeferredLogFactory
().
getLog
(
getClass
());
this
.
onPropertiesPrepared
(
event
,
(
T
)
event
.
getConfigurableProperties
());
this
.
onPropertiesPrepared
(
event
,
(
T
)
event
.
getConfigurableProperties
());
}
}
}
}
protected
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
T
configurableProperties
)
{
protected
abstract
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
T
configurableProperties
);
}
}
}
\ No newline at end of file
starters/apollo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/apollo/listener/PropertiesPreparedEventListener.java
View file @
5c3e0dd9
package
com.schbrain.framework.autoconfigure.apollo.listener
;
package
com.schbrain.framework.autoconfigure.apollo.listener
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.context.ApplicationListener
;
import
org.springframework.core.Ordered
;
/**
/**
* @author liaozan
* @author liaozan
* @since 2023-04-29
* @since 2023-04-29
*/
*/
public
interface
PropertiesPreparedEventListener
extends
ApplicationListener
<
PropertiesPreparedEvent
>
{
public
interface
PropertiesPreparedEventListener
extends
ApplicationListener
<
PropertiesPreparedEvent
>,
Ordered
{
@Override
default
int
getOrder
()
{
return
Ordered
.
LOWEST_PRECEDENCE
;
}
}
}
\ No newline at end of file
starters/dubbo-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/dubbo/listener/DubboPropertiesPreparedEventListener.java
View file @
5c3e0dd9
...
@@ -3,13 +3,14 @@ package com.schbrain.framework.autoconfigure.dubbo.listener;
...
@@ -3,13 +3,14 @@ package com.schbrain.framework.autoconfigure.dubbo.listener;
import
com.alibaba.fastjson2.JSONFactory
;
import
com.alibaba.fastjson2.JSONFactory
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.schbrain.common.util.ApplicationName
;
import
com.schbrain.common.util.ApplicationName
;
import
com.schbrain.framework.autoconfigure.apollo.listener.GenericPropertiesPreparedEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEventListenerAdapter
;
import
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
;
import
com.schbrain.framework.autoconfigure.dubbo.properties.DubboProperties
;
import
org.apache.dubbo.config.bootstrap.DubboBootstrap
;
import
org.apache.dubbo.config.bootstrap.DubboBootstrap
;
import
org.apache.dubbo.config.spring.ConfigCenterBean
;
import
org.apache.dubbo.config.spring.ConfigCenterBean
;
import
org.apache.dubbo.config.spring.util.EnvironmentUtils
;
import
org.apache.dubbo.config.spring.util.EnvironmentUtils
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,10 +22,15 @@ import static org.apache.dubbo.config.ConfigKeys.DUBBO_SCAN_BASE_PACKAGES;
...
@@ -21,10 +22,15 @@ 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
DubboPropertiesPreparedEventListener
extends
PropertiesPreparedEventListenerAdapt
er
<
DubboProperties
>
{
public
class
DubboPropertiesPreparedEventListener
extends
GenericPropertiesPreparedEventListen
er
<
DubboProperties
>
{
public
static
final
String
DUBBO_APPLICATION_NAME
=
"dubbo.application.name"
;
public
static
final
String
DUBBO_APPLICATION_NAME
=
"dubbo.application.name"
;
@Override
public
int
getOrder
()
{
return
Ordered
.
HIGHEST_PRECEDENCE
;
}
@Override
@Override
protected
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
DubboProperties
properties
)
{
protected
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
DubboProperties
properties
)
{
ConfigurableEnvironment
environment
=
event
.
getEnvironment
();
ConfigurableEnvironment
environment
=
event
.
getEnvironment
();
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/LoggerAutoConfiguration.java
View file @
5c3e0dd9
...
@@ -3,10 +3,8 @@ package com.schbrain.framework.autoconfigure.logger;
...
@@ -3,10 +3,8 @@ package com.schbrain.framework.autoconfigure.logger;
import
com.schbrain.framework.autoconfigure.logger.apollo.DynamicLoggerConfiguration
;
import
com.schbrain.framework.autoconfigure.logger.apollo.DynamicLoggerConfiguration
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
;
import
com.schbrain.framework.autoconfigure.logger.properties.LoggerProperties
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfiguration
;
import
org.springframework.boot.autoconfigure.AutoConfigureOrder
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.core.Ordered
;
/**
/**
* @author liaozan
* @author liaozan
...
@@ -14,7 +12,6 @@ import org.springframework.core.Ordered;
...
@@ -14,7 +12,6 @@ import org.springframework.core.Ordered;
*/
*/
@AutoConfiguration
@AutoConfiguration
@Import
(
DynamicLoggerConfiguration
.
class
)
@Import
(
DynamicLoggerConfiguration
.
class
)
@AutoConfigureOrder
(
Ordered
.
HIGHEST_PRECEDENCE
)
@EnableConfigurationProperties
(
LoggerProperties
.
class
)
@EnableConfigurationProperties
(
LoggerProperties
.
class
)
public
class
LoggerAutoConfiguration
{
public
class
LoggerAutoConfiguration
{
...
...
starters/logger-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/logger/listener/LoggerPropertiesPreparedEventListener.java
View file @
5c3e0dd9
...
@@ -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.listener.GenericPropertiesPreparedEventListener
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEvent
;
import
com.schbrain.framework.autoconfigure.apollo.listener.PropertiesPreparedEventListenerAdapter
;
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,7 +25,7 @@ import static org.springframework.boot.context.logging.LoggingApplicationListene
...
@@ -25,7 +25,7 @@ import static org.springframework.boot.context.logging.LoggingApplicationListene
* @author liaozan
* @author liaozan
* @since 2023-04-28
* @since 2023-04-28
*/
*/
public
class
LoggerPropertiesPreparedEventListener
extends
PropertiesPreparedEventListenerAdapt
er
<
LoggerProperties
>
{
public
class
LoggerPropertiesPreparedEventListener
extends
GenericPropertiesPreparedEventListen
er
<
LoggerProperties
>
{
@Override
@Override
protected
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
LoggerProperties
properties
)
{
protected
void
onPropertiesPrepared
(
PropertiesPreparedEvent
event
,
LoggerProperties
properties
)
{
...
...
starters/mybatis-spring-boot-starter/src/main/java/com/schbrain/framework/autoconfigure/mybatis/datasource/DataSourceConnectionPostProcessor.java
View file @
5c3e0dd9
...
@@ -2,7 +2,7 @@ package com.schbrain.framework.autoconfigure.mybatis.datasource;
...
@@ -2,7 +2,7 @@ package com.schbrain.framework.autoconfigure.mybatis.datasource;
import
com.schbrain.framework.autoconfigure.mybatis.datasource.customizer.DataSourceCustomizer
;
import
com.schbrain.framework.autoconfigure.mybatis.datasource.customizer.DataSourceCustomizer
;
import
com.schbrain.framework.autoconfigure.mybatis.properties.DataSourceConnectionProperties
;
import
com.schbrain.framework.autoconfigure.mybatis.properties.DataSourceConnectionProperties
;
import
com.schbrain.framework.support.spring.
BeanPostProcessorAdapte
r
;
import
com.schbrain.framework.support.spring.
GenericBeanPostProcesso
r
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.ObjectProvider
;
import
org.springframework.beans.factory.ObjectProvider
;
...
@@ -15,7 +15,7 @@ import java.sql.SQLException;
...
@@ -15,7 +15,7 @@ import java.sql.SQLException;
* @since 2021/11/23
* @since 2021/11/23
*/
*/
@Slf4j
@Slf4j
public
class
DataSourceConnectionPostProcessor
extends
BeanPostProcessorAdapte
r
<
DataSource
>
{
public
class
DataSourceConnectionPostProcessor
extends
GenericBeanPostProcesso
r
<
DataSource
>
{
// use ObjectProvider to avoid early initialization beans
// use ObjectProvider to avoid early initialization beans
private
final
ObjectProvider
<
DataSourceCustomizer
>
customizers
;
private
final
ObjectProvider
<
DataSourceCustomizer
>
customizers
;
...
@@ -29,14 +29,13 @@ public class DataSourceConnectionPostProcessor extends BeanPostProcessorAdapter<
...
@@ -29,14 +29,13 @@ public class DataSourceConnectionPostProcessor extends BeanPostProcessorAdapter<
@Override
@Override
protected
void
processBeforeInitialization
(
DataSource
dataSource
,
String
beanName
)
throws
BeansException
{
protected
void
processBeforeInitialization
(
DataSource
dataSource
,
String
beanName
)
throws
BeansException
{
DataSourceConnectionProperties
connectionProperties
=
this
.
connectionProperties
.
getObject
();
this
.
connectionProperties
.
ifAvailable
(
properties
->
customizers
.
orderedStream
().
forEach
(
customizer
->
{
customizers
.
orderedStream
().
forEach
(
customizer
->
{
try
{
try
{
customizer
.
customize
(
dataSource
,
connectionP
roperties
);
customizer
.
customize
(
dataSource
,
p
roperties
);
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
log
.
warn
(
"
f
ailed to customize dataSource connectionProperties"
,
e
);
log
.
warn
(
"
F
ailed to customize dataSource connectionProperties"
,
e
);
}
}
});
})
)
;
}
}
}
}
\ No newline at end of file
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/
BeanPostProcessorAdapte
r.java
→
support/schbrain-spring-support/src/main/java/com/schbrain/framework/support/spring/
GenericBeanPostProcesso
r.java
View file @
5c3e0dd9
...
@@ -4,21 +4,18 @@ import org.springframework.beans.BeansException;
...
@@ -4,21 +4,18 @@ import org.springframework.beans.BeansException;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
import
org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
;
import
org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
;
import
org.springframework.context.*
;
import
org.springframework.context.*
;
import
org.springframework.core.ResolvableType
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.core.env.ConfigurableEnvironment
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ClassUtils
;
import
java.lang.reflect.ParameterizedType
;
import
java.lang.reflect.Type
;
/**
/**
* @author liaozan
* @author liaozan
* @since 2021/11/22
* @since 2021/11/22
*/
*/
@SuppressWarnings
({
"unchecked"
,
"unused"
})
@SuppressWarnings
({
"unchecked"
,
"unused"
})
public
abstract
class
BeanPostProcessorAdapte
r
<
T
>
implements
SmartInstantiationAwareBeanPostProcessor
,
ApplicationContextAware
{
public
abstract
class
GenericBeanPostProcesso
r
<
T
>
implements
SmartInstantiationAwareBeanPostProcessor
,
ApplicationContextAware
{
private
final
Class
<
T
>
beanType
;
private
final
ResolvableType
beanType
;
protected
ConfigurableApplicationContext
applicationContext
;
protected
ConfigurableApplicationContext
applicationContext
;
...
@@ -26,38 +23,37 @@ public abstract class BeanPostProcessorAdapter<T> implements SmartInstantiationA
...
@@ -26,38 +23,37 @@ public abstract class BeanPostProcessorAdapter<T> implements SmartInstantiationA
protected
ConfigurableEnvironment
environment
;
protected
ConfigurableEnvironment
environment
;
public
BeanPostProcessorAdapter
()
{
public
GenericBeanPostProcessor
()
{
ParameterizedType
parameterizedType
=
(
ParameterizedType
)
getClass
().
getGenericSuperclass
();
this
.
beanType
=
ResolvableType
.
forInstance
(
this
).
getSuperType
().
getGeneric
(
0
);
Type
[]
actualTypeArguments
=
parameterizedType
.
getActualTypeArguments
();
this
.
beanType
=
(
Class
<
T
>)
actualTypeArguments
[
0
];
}
}
@Override
@Override
public
final
Object
postProcessBeforeInstantiation
(
Class
<?>
beanClass
,
String
beanName
)
throws
BeansException
{
public
final
Object
postProcessBeforeInstantiation
(
Class
<?>
beanClass
,
String
beanName
)
throws
BeansException
{
if
(
ClassUtils
.
isAssignable
(
beanType
,
beanClass
))
{
if
(
beanType
.
isAssignableFrom
(
beanClass
))
{
return
doPostProcessBeforeInstantiation
((
Class
<
T
>)
beanClass
);
return
doPostProcessBeforeInstantiation
((
Class
<
T
>)
beanClass
);
}
}
return
null
;
return
null
;
}
}
@Override
@Override
public
final
Object
postProcessBeforeInitialization
(
Object
bean
,
String
beanName
)
throws
BeansException
{
if
(
ClassUtils
.
isAssignableValue
(
beanType
,
bean
))
{
return
doPostProcessBeforeInitialization
((
T
)
bean
,
beanName
);
}
return
bean
;
}
public
final
boolean
postProcessAfterInstantiation
(
Object
bean
,
String
beanName
)
throws
BeansException
{
public
final
boolean
postProcessAfterInstantiation
(
Object
bean
,
String
beanName
)
throws
BeansException
{
if
(
ClassUtils
.
isAssignableValue
(
beanType
,
bean
))
{
if
(
beanType
.
isInstance
(
bean
))
{
return
doPostProcessAfterInstantiation
((
T
)
bean
);
return
doPostProcessAfterInstantiation
((
T
)
bean
);
}
}
return
true
;
return
true
;
}
}
@Override
public
final
Object
postProcessBeforeInitialization
(
Object
bean
,
String
beanName
)
throws
BeansException
{
if
(
beanType
.
isInstance
(
bean
))
{
return
doPostProcessBeforeInitialization
((
T
)
bean
,
beanName
);
}
return
bean
;
}
@Override
@Override
public
final
Object
postProcessAfterInitialization
(
Object
bean
,
String
beanName
)
throws
BeansException
{
public
final
Object
postProcessAfterInitialization
(
Object
bean
,
String
beanName
)
throws
BeansException
{
if
(
ClassUtils
.
isAssignableValue
(
beanType
,
bean
))
{
if
(
beanType
.
isInstance
(
bean
))
{
return
doPostProcessAfterInitialization
((
T
)
bean
,
beanName
);
return
doPostProcessAfterInitialization
((
T
)
bean
,
beanName
);
}
}
return
bean
;
return
bean
;
...
@@ -65,16 +61,12 @@ public abstract class BeanPostProcessorAdapter<T> implements SmartInstantiationA
...
@@ -65,16 +61,12 @@ public abstract class BeanPostProcessorAdapter<T> implements SmartInstantiationA
@Override
@Override
public
void
setApplicationContext
(
ApplicationContext
context
)
throws
BeansException
{
public
void
setApplicationContext
(
ApplicationContext
context
)
throws
BeansException
{
Assert
.
isInstanceOf
(
ConfigurableApplicationContext
.
class
,
context
,
"
r
equire ConfigurableApplicationContext"
);
Assert
.
isInstanceOf
(
ConfigurableApplicationContext
.
class
,
context
,
"
R
equire ConfigurableApplicationContext"
);
this
.
applicationContext
=
(
ConfigurableApplicationContext
)
context
;
this
.
applicationContext
=
(
ConfigurableApplicationContext
)
context
;
this
.
beanFactory
=
this
.
applicationContext
.
getBeanFactory
();
this
.
beanFactory
=
this
.
applicationContext
.
getBeanFactory
();
this
.
environment
=
this
.
applicationContext
.
getEnvironment
();
this
.
environment
=
this
.
applicationContext
.
getEnvironment
();
}
}
public
final
Class
<
T
>
getBeanType
()
{
return
beanType
;
}
// region Instantiation
// region Instantiation
protected
T
doPostProcessBeforeInstantiation
(
Class
<
T
>
beanClass
)
{
protected
T
doPostProcessBeforeInstantiation
(
Class
<
T
>
beanClass
)
{
return
null
;
return
null
;
...
...
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