Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
036fa8d9
Commit
036fa8d9
authored
Mar 21, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多线程处理配置
parent
a88d4829
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
ConfigBase.java
...src/main/java/com/yanzuoguang/util/extend/ConfigBase.java
+8
-1
Log.java
...util-base/src/main/java/com/yanzuoguang/util/log/Log.java
+4
-4
ThreadWait.java
...src/main/java/com/yanzuoguang/util/thread/ThreadWait.java
+3
-3
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/extend/Config.java
→
yzg-util-base/src/main/java/com/yanzuoguang/util/extend/Config
Base
.java
View file @
036fa8d9
package
com
.
yanzuoguang
.
util
.
extend
;
package
com
.
yanzuoguang
.
util
.
extend
;
import
com.yanzuoguang.util.log.RunnableLog
;
/**
/**
* 配置参数
* 配置参数
*/
*/
public
class
Config
{
public
class
Config
Base
{
/**
/**
* 打印线程相关参数
* 打印线程相关参数
*/
*/
public
static
final
boolean
PrintThread
=
false
;
public
static
final
boolean
PrintThread
=
false
;
/**
* 写入日志对象
*/
public
static
RunnableLog
WriteLog
;
}
}
yzg-util-base/src/main/java/com/yanzuoguang/util/log/Log.java
View file @
036fa8d9
package
com
.
yanzuoguang
.
util
.
log
;
package
com
.
yanzuoguang
.
util
.
log
;
import
com.yanzuoguang.util.extend.ConfigBase
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -8,8 +10,6 @@ import java.util.HashMap;
...
@@ -8,8 +10,6 @@ import java.util.HashMap;
*/
*/
public
class
Log
{
public
class
Log
{
public
static
RunnableLog
writeLog
;
/**
/**
* 当前线程缓存的对象
* 当前线程缓存的对象
*/
*/
...
@@ -95,8 +95,8 @@ public class Log {
...
@@ -95,8 +95,8 @@ public class Log {
date
.
commit
();
date
.
commit
();
info
.
setTime
((
long
)
date
.
getLastSecond
());
info
.
setTime
((
long
)
date
.
getLastSecond
());
info
.
setTotalTime
((
long
)
date
.
getTotalSecond
());
info
.
setTotalTime
((
long
)
date
.
getTotalSecond
());
if
(
w
riteLog
!=
null
)
{
if
(
ConfigBase
.
W
riteLog
!=
null
)
{
w
riteLog
.
run
(
info
);
ConfigBase
.
W
riteLog
.
run
(
info
);
}
else
{
}
else
{
writeLogDefault
.
run
(
info
);
writeLogDefault
.
run
(
info
);
}
}
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/thread/ThreadWait.java
View file @
036fa8d9
package
com
.
yanzuoguang
.
util
.
thread
;
package
com
.
yanzuoguang
.
util
.
thread
;
import
com.yanzuoguang.util.extend.Config
;
import
com.yanzuoguang.util.extend.Config
Base
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.log.Log
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -57,7 +57,7 @@ public class ThreadWait {
...
@@ -57,7 +57,7 @@ public class ThreadWait {
}
}
this
.
stopPrint
();
this
.
stopPrint
();
}
}
if
(
Config
.
PrintThread
)
{
if
(
Config
Base
.
PrintThread
)
{
Log
.
info
(
ThreadWait
.
class
,
"客户端结束时间"
);
Log
.
info
(
ThreadWait
.
class
,
"客户端结束时间"
);
}
}
}
}
...
@@ -78,7 +78,7 @@ public class ThreadWait {
...
@@ -78,7 +78,7 @@ public class ThreadWait {
public
synchronized
void
finish
()
{
public
synchronized
void
finish
()
{
if
(
this
.
execute
.
isFinally
())
{
if
(
this
.
execute
.
isFinally
())
{
this
.
notify
();
this
.
notify
();
if
(
Config
.
PrintThread
)
{
if
(
Config
Base
.
PrintThread
)
{
Log
.
info
(
ThreadWait
.
class
,
"客户端结束时间"
);
Log
.
info
(
ThreadWait
.
class
,
"客户端结束时间"
);
}
}
}
}
...
...
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