Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
8be5ce1f
Commit
8be5ce1f
authored
Aug 24, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
c913d44b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
36 deletions
+4
-36
MdaScanner.java
...ava/com/brilliance/mda/runtime/mda/driver/MdaScanner.java
+0
-30
EmitterFactory.java
...liance/mda/runtime/mda/driver/compile/EmitterFactory.java
+0
-2
ModuleAnnotationProcess.java
...mda/driver/compile/processor/ModuleAnnotationProcess.java
+4
-4
No files found.
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/driver/MdaScanner.java
View file @
8be5ce1f
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
driver
;
import
com.brilliance.mda.runtime.annotation.Check
;
import
com.brilliance.mda.runtime.annotation.NeedInit
;
import
com.brilliance.mda.runtime.annotation.Rule
;
import
com.brilliance.mda.runtime.mda.driver.compile.processor.ModuleAnnotationProcess
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.config.ConfigurableListableBeanFactory
;
...
...
@@ -23,7 +18,6 @@ import org.springframework.stereotype.Component;
import
java.io.IOException
;
import
java.lang.annotation.Annotation
;
import
java.lang.reflect.Method
;
import
java.util.HashSet
;
import
java.util.LinkedHashSet
;
import
java.util.Map
;
...
...
@@ -100,30 +94,6 @@ public class MdaScanner implements ResourceLoaderAware, BeanDefinitionRegistryPo
if
(
clazz
.
isAnnotationPresent
(
annotationClass
))
{
Set
<
Class
<?>>
set
=
map
.
computeIfAbsent
(
annotationClass
,
k
->
new
LinkedHashSet
<>());
set
.
add
(
clazz
);
Method
[]
declaredMethods
=
clazz
.
getDeclaredMethods
();
for
(
Method
method
:
declaredMethods
)
{
if
(
method
.
isAnnotationPresent
(
NeedInit
.
class
))
{
NeedInit
needInit
=
method
.
getAnnotation
(
NeedInit
.
class
);
boolean
need
=
needInit
.
value
();
if
(
need
)
{
if
(
method
.
isAnnotationPresent
(
Rule
.
class
))
{
Rule
rule
=
method
.
getAnnotation
(
Rule
.
class
);
path
=
rule
.
target
();
if
(!
StringUtils
.
isBlank
(
path
))
{
Set
<
String
>
needInitRule
=
ModuleAnnotationProcess
.
needInitRule
;
needInitRule
.
add
(
clazz
.
getSimpleName
().
toLowerCase
()
+
"@"
+
path
);
}
}
else
if
(
method
.
isAnnotationPresent
(
Check
.
class
))
{
Check
check
=
method
.
getAnnotation
(
Check
.
class
);
path
=
check
.
target
();
if
(!
StringUtils
.
isBlank
(
path
))
{
Set
<
String
>
needInitCheck
=
ModuleAnnotationProcess
.
needInitCheck
;
needInitCheck
.
add
(
clazz
.
getSimpleName
().
toLowerCase
()
+
"@"
+
path
);
}
}
}
}
}
}
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/driver/compile/EmitterFactory.java
View file @
8be5ce1f
...
...
@@ -53,8 +53,6 @@ public class EmitterFactory implements InitializingBean {
//log.info("注册TableMeta {}个", TableMetaManager.getTableMetaCount());
log
.
info
(
"注册ModuleInfo {}个"
,
ModuleInfoManager
.
getModuleInfoCount
());
log
.
info
(
"注册Transaction {}个"
,
transSet
.
size
());
log
.
info
(
"需要初始化的check方法有:{}"
,
ModuleAnnotationProcess
.
needInitCheck
.
toString
());
log
.
info
(
"需要初始化的rule方法有:{}"
,
ModuleAnnotationProcess
.
needInitRule
.
toString
());
}
catch
(
Exception
e
)
{
log
.
error
(
"动态Emitter扫描包发生错误"
,
e
);
}
...
...
gjjs-bd-runtime/src/main/java/com/brilliance/mda/runtime/mda/driver/compile/processor/ModuleAnnotationProcess.java
View file @
8be5ce1f
package
com
.
brilliance
.
mda
.
runtime
.
mda
.
driver
.
compile
.
processor
;
import
com.brilliance.mda.runtime.annotation.*
;
import
com.brilliance.mda.runtime.annotation.Check
;
import
com.brilliance.mda.runtime.annotation.Default
;
import
com.brilliance.mda.runtime.annotation.Init
;
import
com.brilliance.mda.runtime.annotation.Rule
;
import
com.brilliance.mda.runtime.mda.FieldHolder
;
import
com.brilliance.mda.runtime.mda.IModule
;
import
com.brilliance.mda.runtime.mda.IModuleList
;
...
...
@@ -23,9 +26,6 @@ public class ModuleAnnotationProcess {
public
static
Map
<
String
,
ModuleRuleContext
>
cache
=
new
HashMap
<>();
public
static
Set
<
String
>
needInitRule
=
new
HashSet
<>();
public
static
Set
<
String
>
needInitCheck
=
new
HashSet
<>();
private
ModuleRuleContext
moduleRuleContext
;
private
Class
<?
extends
IModule
>
moduleClass
;
private
IModule
instatnce
;
...
...
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