Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
f09c758d
Commit
f09c758d
authored
Jan 25, 2018
by
zero-mac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 发布0.0.7版本:
1. spring-cloud由Dalston.SR4升级到Edgware.RELEASE 2. 提供获取当前环境的工具类
parent
4b630b6f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
3 deletions
+44
-3
pom.xml
pom.xml
+2
-2
GracefulShutdownAutoConfiguration.java
...down/configuration/GracefulShutdownAutoConfiguration.java
+1
-1
TechEnvironment.java
src/main/java/cn/quantgroup/tech/util/TechEnvironment.java
+41
-0
No files found.
pom.xml
View file @
f09c758d
...
...
@@ -6,7 +6,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
cn.quantgroup
</groupId>
<artifactId>
commons
</artifactId>
<version>
0.0.
6
</version>
<version>
0.0.
7
</version>
<packaging>
jar
</packaging>
...
...
@@ -37,7 +37,7 @@
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
Dalston.SR4
</version>
<version>
Edgware.RELEASE
</version>
<scope>
import
</scope>
<type>
pom
</type>
</dependency>
...
...
src/main/java/cn/quantgroup/tech/shutdown/configuration/GracefulShutdownAutoConfiguration.java
View file @
f09c758d
...
...
@@ -34,7 +34,7 @@ import javax.servlet.Servlet;
* on the classpath.
*/
@Configuration
//
@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnProperty
(
prefix
=
"shutdown.graceful"
,
name
=
"enabled"
,
havingValue
=
"true"
,
matchIfMissing
=
true
)
@EnableConfigurationProperties
(
GracefulShutdownProperties
.
class
)
@Import
(
EmbeddedServletContainerAutoConfiguration
.
BeanPostProcessorsRegistrar
.
class
)
public
class
GracefulShutdownAutoConfiguration
{
...
...
src/main/java/cn/quantgroup/tech/util/TechEnvironment.java
0 → 100644
View file @
f09c758d
package
cn
.
quantgroup
.
tech
.
util
;
import
com.ctrip.framework.foundation.Foundation
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
TechEnvironment
{
private
volatile
static
TechEnvironment
instance
;
private
boolean
pro
=
false
;
private
String
env
;
private
TechEnvironment
()
{
String
envType
=
Foundation
.
server
().
getEnvType
();
env
=
envType
;
if
(
envType
.
equals
(
"pro"
))
{
pro
=
true
;
}
}
private
static
TechEnvironment
getInstance
()
{
if
(
instance
==
null
)
{
synchronized
(
TechEnvironment
.
class
)
{
if
(
instance
==
null
)
{
instance
=
new
TechEnvironment
();
}
}
}
return
instance
;
}
public
static
String
getEnv
()
{
return
getInstance
().
env
;
}
public
static
boolean
isPro
()
{
return
getInstance
().
pro
;
}
}
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