Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
matrix
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mall
arch
matrix
Commits
6b39172b
Commit
6b39172b
authored
Feb 01, 2021
by
房斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4 hook shutdown 错别字
parent
5b62b80b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
45 deletions
+45
-45
GracefulShutDown.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/GracefulShutDown.java
+13
-13
TomcatGracefulShutDownEntrance.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/TomcatGracefulShutDownEntrance.java
+11
-11
DubboCustomerShutDownHock.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/DubboCustomerShutDownHock.java
+5
-5
TomcatShutDownHock.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/TomcatShutDownHock.java
+1
-1
MatrixGracefulShutDownAutoConfiguration.java
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/spring/boot/autoconfigure/MatrixGracefulShutDownAutoConfiguration.java
+15
-15
No files found.
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/Graceful
lySho
utDown.java
→
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/Graceful
Sh
utDown.java
View file @
6b39172b
...
@@ -8,7 +8,7 @@ import com.secoo.mall.common.util.log.LoggerUtil;
...
@@ -8,7 +8,7 @@ import com.secoo.mall.common.util.log.LoggerUtil;
import
com.secoo.mall.common.core.bean.gracefulshowtdownBean.ExecutorDetail
;
import
com.secoo.mall.common.core.bean.gracefulshowtdownBean.ExecutorDetail
;
import
com.secoo.mall.common.core.bean.gracefulshowtdownBean.ExecutorDetails
;
import
com.secoo.mall.common.core.bean.gracefulshowtdownBean.ExecutorDetails
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.RegistryServerSync
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.RegistryServerSync
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
ConnectSho
utDownHock
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
Sh
utDownHock
;
import
org.apache.dubbo.common.utils.NetUtils
;
import
org.apache.dubbo.common.utils.NetUtils
;
import
org.apache.dubbo.config.DubboShutdownHook
;
import
org.apache.dubbo.config.DubboShutdownHook
;
import
org.apache.dubbo.config.spring.extension.SpringExtensionFactory
;
import
org.apache.dubbo.config.spring.extension.SpringExtensionFactory
;
...
@@ -29,9 +29,9 @@ import java.util.*;
...
@@ -29,9 +29,9 @@ import java.util.*;
import
static
org
.
springframework
.
context
.
support
.
AbstractApplicationContext
.
APPLICATION_EVENT_MULTICASTER_BEAN_NAME
;
import
static
org
.
springframework
.
context
.
support
.
AbstractApplicationContext
.
APPLICATION_EVENT_MULTICASTER_BEAN_NAME
;
public
class
Graceful
lySho
utDown
implements
CommandLineRunner
,
ApplicationListener
<
ContextClosedEvent
>,
ApplicationContextAware
,
Ordered
{
public
class
Graceful
Sh
utDown
implements
CommandLineRunner
,
ApplicationListener
<
ContextClosedEvent
>,
ApplicationContextAware
,
Ordered
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
// Tomcat
ConnectShoutDownHock tomcatConnectSho
utDownHock;
// Tomcat
ShutDownHock tomcatSh
utDownHock;
private
ApplicationContext
context
;
private
ApplicationContext
context
;
// private ProviderService providerService ;
// private ProviderService providerService ;
...
@@ -39,13 +39,13 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -39,13 +39,13 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
UpDatas
dubboUpdata
;
UpDatas
dubboUpdata
;
// public Graceful
lyShoutDown(TomcatConnectShoutDownHock tomcatConnectSho
utDownHock,ProviderService providerService,UpDatas dubboUpdata){
// public Graceful
ShutDown(TomcatShutDownHock tomcatSh
utDownHock,ProviderService providerService,UpDatas dubboUpdata){
// this.tomcat
ConnectShoutDownHock=tomcatConnectSho
utDownHock;
// this.tomcat
ShutDownHock=tomcatSh
utDownHock;
// this.providerService=providerService;
// this.providerService=providerService;
// this.dubboUpdata=dubboUpdata;
// this.dubboUpdata=dubboUpdata;
// }
// }
public
Graceful
lySho
utDown
(
UpDatas
dubboUpdata
)
{
public
Graceful
Sh
utDown
(
UpDatas
dubboUpdata
)
{
this
.
dubboUpdata
=
dubboUpdata
;
this
.
dubboUpdata
=
dubboUpdata
;
}
}
...
@@ -80,7 +80,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -80,7 +80,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
Set
<
StopService
>
ts
=
new
TreeSet
<
StopService
>();
Set
<
StopService
>
ts
=
new
TreeSet
<
StopService
>();
for
(
StopService
service
:
map
.
values
())
{
for
(
StopService
service
:
map
.
values
())
{
if
(!(
service
instanceof
Tomcat
ConnectSho
utDownHock
))
{
if
(!(
service
instanceof
Tomcat
Sh
utDownHock
))
{
ts
.
add
(
service
);
ts
.
add
(
service
);
}
}
}
}
...
@@ -100,7 +100,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -100,7 +100,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
try
{
try
{
dubboUpdata
.
upData
(
result
);
dubboUpdata
.
upData
(
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LoggerUtil
.
error
(
"matrix.Graceful
lySho
utDown update .error data:"
+
JSON
.
toJSONString
(
result
),
e
);
LoggerUtil
.
error
(
"matrix.Graceful
Sh
utDown update .error data:"
+
JSON
.
toJSONString
(
result
),
e
);
}
}
...
@@ -131,7 +131,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -131,7 +131,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
String
name
=
ApplicationModel
.
getApplication
();
String
name
=
ApplicationModel
.
getApplication
();
result
.
setIp
(
ip
);
result
.
setIp
(
ip
);
result
.
setName
(
name
);
result
.
setName
(
name
);
logger
.
info
(
"Graceful
lySho
utDown execute:name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
logger
.
info
(
"Graceful
Sh
utDown execute:name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
try
{
try
{
...
@@ -139,7 +139,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -139,7 +139,7 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
if
(
map
!=
null
&&
map
.
size
()
>
0
)
{
Set
<
StopService
>
ts
=
new
TreeSet
<
StopService
>();
Set
<
StopService
>
ts
=
new
TreeSet
<
StopService
>();
for
(
StopService
service
:
map
.
values
())
{
for
(
StopService
service
:
map
.
values
())
{
if
(!(
service
instanceof
TomcatGraceful
lyShutDown
))
{
if
(!(
service
instanceof
TomcatGraceful
ShutDownEntrance
))
{
ts
.
add
(
service
);
ts
.
add
(
service
);
}
}
}
}
...
@@ -158,14 +158,14 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
...
@@ -158,14 +158,14 @@ public class GracefullyShoutDown implements CommandLineRunner, ApplicationListen
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LoggerUtil
.
error
(
"matrix.Graceful
lySho
utDown.error"
,
e
);
LoggerUtil
.
error
(
"matrix.Graceful
Sh
utDown.error"
,
e
);
}
}
try
{
try
{
dubboUpdata
.
upData
(
result
);
dubboUpdata
.
upData
(
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LoggerUtil
.
error
(
"matrix.Graceful
lySho
utDown update .error data:"
+
JSON
.
toJSONString
(
result
),
e
);
LoggerUtil
.
error
(
"matrix.Graceful
Sh
utDown update .error data:"
+
JSON
.
toJSONString
(
result
),
e
);
}
}
logger
.
info
(
"Graceful
lySho
utDown execute end :name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
logger
.
info
(
"Graceful
Sh
utDown execute end :name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
}
}
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/TomcatGraceful
lyShutDown
.java
→
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/TomcatGraceful
ShutDownEntrance
.java
View file @
6b39172b
package
com
.
secoo
.
mall
.
dubbo
.
service
;
package
com
.
secoo
.
mall
.
dubbo
.
service
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
ConnectSho
utDownHock
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
Sh
utDownHock
;
import
org.apache.catalina.connector.Connector
;
import
org.apache.catalina.connector.Connector
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -12,22 +12,22 @@ import org.springframework.context.ApplicationListener;
...
@@ -12,22 +12,22 @@ import org.springframework.context.ApplicationListener;
import
org.springframework.context.event.ContextClosedEvent
;
import
org.springframework.context.event.ContextClosedEvent
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.Ordered
;
public
class
TomcatGraceful
lyShutDown
implements
TomcatConnectorCustomizer
,
ApplicationContextAware
,
Ordered
,
ApplicationListener
<
ContextClosedEvent
>
{
public
class
TomcatGraceful
ShutDownEntrance
implements
TomcatConnectorCustomizer
,
ApplicationContextAware
,
Ordered
,
ApplicationListener
<
ContextClosedEvent
>
{
private
ApplicationContext
context
;
private
ApplicationContext
context
;
Tomcat
ConnectShoutDownHock
tomcatConnectSho
utDownHock
;
Tomcat
ShutDownHock
tomcatSh
utDownHock
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
public
TomcatGraceful
lyShutDown
(
TomcatConnectShoutDownHock
tomcatConnectSho
utDownHock
)
{
public
TomcatGraceful
ShutDownEntrance
(
TomcatShutDownHock
tomcatSh
utDownHock
)
{
this
.
tomcat
ConnectShoutDownHock
=
tomcatConnectSho
utDownHock
;
this
.
tomcat
ShutDownHock
=
tomcatSh
utDownHock
;
}
}
@Override
@Override
public
void
customize
(
Connector
connector
)
{
public
void
customize
(
Connector
connector
)
{
tomcat
ConnectSho
utDownHock
.
setConnector
(
connector
);
tomcat
Sh
utDownHock
.
setConnector
(
connector
);
}
}
...
@@ -36,12 +36,12 @@ public class TomcatGracefullyShutDown implements TomcatConnectorCustomizer , App
...
@@ -36,12 +36,12 @@ public class TomcatGracefullyShutDown implements TomcatConnectorCustomizer , App
this
.
context
=
applicationContext
;
this
.
context
=
applicationContext
;
logger
.
info
(
"11111111111111111111 setContext"
);
logger
.
info
(
"11111111111111111111 setContext"
);
}
}
public
Tomcat
ConnectShoutDownHock
getTomcatConnectSho
utDownHock
()
{
public
Tomcat
ShutDownHock
getTomcatSh
utDownHock
()
{
return
tomcat
ConnectSho
utDownHock
;
return
tomcat
Sh
utDownHock
;
}
}
public
void
setTomcat
ConnectShoutDownHock
(
TomcatConnectShoutDownHock
tomcatConnectSho
utDownHock
)
{
public
void
setTomcat
ShutDownHock
(
TomcatShutDownHock
tomcatSh
utDownHock
)
{
this
.
tomcat
ConnectShoutDownHock
=
tomcatConnectSho
utDownHock
;
this
.
tomcat
ShutDownHock
=
tomcatSh
utDownHock
;
}
}
@Override
@Override
...
@@ -52,6 +52,6 @@ public class TomcatGracefullyShutDown implements TomcatConnectorCustomizer , App
...
@@ -52,6 +52,6 @@ public class TomcatGracefullyShutDown implements TomcatConnectorCustomizer , App
@Override
@Override
public
void
onApplicationEvent
(
ContextClosedEvent
contextClosedEvent
)
{
public
void
onApplicationEvent
(
ContextClosedEvent
contextClosedEvent
)
{
logger
.
info
(
"11111111111111111111 "
);
logger
.
info
(
"11111111111111111111 "
);
tomcat
ConnectSho
utDownHock
.
stop
();
tomcat
Sh
utDownHock
.
stop
();
}
}
}
}
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/DubboCustomerDownHock.java
→
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/DubboCustomer
Shut
DownHock.java
View file @
6b39172b
...
@@ -28,7 +28,7 @@ import java.util.*;
...
@@ -28,7 +28,7 @@ import java.util.*;
import
java.util.concurrent.*
;
import
java.util.concurrent.*
;
public
class
DubboCustomerDownHock
extends
AbstractStop
implements
Observer
{
public
class
DubboCustomer
Shut
DownHock
extends
AbstractStop
implements
Observer
{
private
ProviderService
providerService
;
private
ProviderService
providerService
;
RegistryServerSync
registryServerSync
;
RegistryServerSync
registryServerSync
;
...
@@ -41,7 +41,7 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
...
@@ -41,7 +41,7 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
this
.
registryServerSync
=
registryServerSync
;
this
.
registryServerSync
=
registryServerSync
;
}
}
public
DubboCustomerDownHock
(
ProviderService
providerService
)
{
public
DubboCustomer
Shut
DownHock
(
ProviderService
providerService
)
{
this
.
providerService
=
providerService
;
this
.
providerService
=
providerService
;
}
}
...
@@ -73,10 +73,10 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
...
@@ -73,10 +73,10 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
while
(
iterator
.
hasNext
())
{
while
(
iterator
.
hasNext
())
{
Registry
r
=
iterator
.
next
();
Registry
r
=
iterator
.
next
();
zookperRegster
=
(
ZookeeperRegistry
)
r
;
zookperRegster
=
(
ZookeeperRegistry
)
r
;
str
.
add
(
" DubboCustomerDownHock zookperRegstered-------------->"
+
zookperRegster
.
getRegistered
().
toString
()+
StringUtil
.
line
());
str
.
add
(
" DubboCustomer
Shut
DownHock zookperRegstered-------------->"
+
zookperRegster
.
getRegistered
().
toString
()+
StringUtil
.
line
());
if
(
zookperRegster
.
getRegistered
()
!=
null
&&
zookperRegster
.
getRegistered
().
size
()
>
0
)
{
if
(
zookperRegster
.
getRegistered
()
!=
null
&&
zookperRegster
.
getRegistered
().
size
()
>
0
)
{
urls
=
zookperRegster
.
getRegistered
();
urls
=
zookperRegster
.
getRegistered
();
str
.
add
(
" DubboCustomerDownHock zookperRegstered urls-------------->"
+((
urls
!=
null
&&
urls
.
size
()>
0
)?
JSON
.
toJSONString
(
urls
):
"url si null"
)+
StringUtil
.
line
());
str
.
add
(
" DubboCustomer
Shut
DownHock zookperRegstered urls-------------->"
+((
urls
!=
null
&&
urls
.
size
()>
0
)?
JSON
.
toJSONString
(
urls
):
"url si null"
)+
StringUtil
.
line
());
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
if
(
urls
!=
null
&&
urls
.
size
()
>
0
)
{
checks
=
new
ArrayList
<
URL
>();
checks
=
new
ArrayList
<
URL
>();
for
(
URL
value
:
urls
)
{
for
(
URL
value
:
urls
)
{
...
@@ -135,7 +135,7 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
...
@@ -135,7 +135,7 @@ public class DubboCustomerDownHock extends AbstractStop implements Observer {
DubboShutdownHook
.
getDubboShutdownHook
().
doDestroy
();
DubboShutdownHook
.
getDubboShutdownHook
().
doDestroy
();
}
}
detail
.
setEndTime
(
DateUtil
.
getDateTime
());
detail
.
setEndTime
(
DateUtil
.
getDateTime
());
logger
.
info
(
"Graceful
lySho
utDown dubbo end execute:name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
logger
.
info
(
"Graceful
Sh
utDown dubbo end execute:name:"
+
name
+
" ip:"
+
ip
+
" time:"
+
DateUtil
.
getDateTime
());
return
detail
;
return
detail
;
}
}
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/Tomcat
ConnectSho
utDownHock.java
→
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/service/impl/Tomcat
Sh
utDownHock.java
View file @
6b39172b
...
@@ -12,7 +12,7 @@ import java.util.concurrent.ThreadPoolExecutor;
...
@@ -12,7 +12,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
//springboot 容器关闭
//springboot 容器关闭
public
class
Tomcat
ConnectSho
utDownHock
extends
AbstractStop
{
public
class
Tomcat
Sh
utDownHock
extends
AbstractStop
{
private
volatile
Connector
connector
;
private
volatile
Connector
connector
;
public
Connector
getConnector
()
{
public
Connector
getConnector
()
{
...
...
matrix-gracefulshutdown/src/main/java/com/secoo/mall/dubbo/spring/boot/autoconfigure/MatrixGracefulShutDownAutoConfiguration.java
View file @
6b39172b
...
@@ -6,11 +6,11 @@ import com.secoo.mall.dubbo.monitor.config.ConfigCenter;
...
@@ -6,11 +6,11 @@ import com.secoo.mall.dubbo.monitor.config.ConfigCenter;
import
com.secoo.mall.dubbo.monitor.dubbo.service.ProviderService
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.ProviderService
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.RegistryServerSync
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.RegistryServerSync
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.impl.ProviderServiceImpl
;
import
com.secoo.mall.dubbo.monitor.dubbo.service.impl.ProviderServiceImpl
;
import
com.secoo.mall.dubbo.service.Graceful
lySho
utDown
;
import
com.secoo.mall.dubbo.service.Graceful
Sh
utDown
;
import
com.secoo.mall.dubbo.service.TomcatGraceful
lyShutDown
;
import
com.secoo.mall.dubbo.service.TomcatGraceful
ShutDownEntrance
;
import
com.secoo.mall.dubbo.service.impl.DubboCustomerDownHock
;
import
com.secoo.mall.dubbo.service.impl.DubboCustomer
Shut
DownHock
;
import
com.secoo.mall.dubbo.service.DubboUpdata
;
import
com.secoo.mall.dubbo.service.DubboUpdata
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
ConnectSho
utDownHock
;
import
com.secoo.mall.dubbo.service.impl.Tomcat
Sh
utDownHock
;
import
org.apache.dubbo.common.URL
;
import
org.apache.dubbo.common.URL
;
import
org.apache.dubbo.registry.Registry
;
import
org.apache.dubbo.registry.Registry
;
...
@@ -51,8 +51,8 @@ public class MatrixGracefulShutDownAutoConfiguration {
...
@@ -51,8 +51,8 @@ public class MatrixGracefulShutDownAutoConfiguration {
@Bean
@Bean
@ConditionalOnClass
({
ProviderService
.
class
,
RegistryServerSync
.
class
})
@ConditionalOnClass
({
ProviderService
.
class
,
RegistryServerSync
.
class
})
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
DubboCustomerDownHock
createDubboConsumerDownHock
(
ProviderService
providerService
,
RegistryServerSync
registryServerSync
)
{
DubboCustomer
Shut
DownHock
createDubboConsumerDownHock
(
ProviderService
providerService
,
RegistryServerSync
registryServerSync
)
{
DubboCustomer
DownHock
hock
=
new
DubboCustomer
DownHock
(
providerService
);
DubboCustomer
ShutDownHock
hock
=
new
DubboCustomerShut
DownHock
(
providerService
);
registryServerSync
.
addObserver
(
hock
);
registryServerSync
.
addObserver
(
hock
);
hock
.
setRegistryServerSync
(
registryServerSync
);
hock
.
setRegistryServerSync
(
registryServerSync
);
return
hock
;
return
hock
;
...
@@ -77,25 +77,25 @@ public class MatrixGracefulShutDownAutoConfiguration {
...
@@ -77,25 +77,25 @@ public class MatrixGracefulShutDownAutoConfiguration {
@Bean
@Bean
@ConditionalOnClass
(
TomcatConnectorCustomizer
.
class
)
@ConditionalOnClass
(
TomcatConnectorCustomizer
.
class
)
Tomcat
ConnectSho
utDownHock
createServletConnectShoutDownHock
()
{
Tomcat
Sh
utDownHock
createServletConnectShoutDownHock
()
{
return
new
Tomcat
ConnectSho
utDownHock
();
return
new
Tomcat
Sh
utDownHock
();
}
}
@Bean
@Bean
@ConditionalOnClass
(
Tomcat
ConnectSho
utDownHock
.
class
)
@ConditionalOnClass
(
Tomcat
Sh
utDownHock
.
class
)
public
TomcatGraceful
lyShutDown
createSpringbootTomcatInit
(
TomcatConnectShoutDownHock
tomcatConnectSho
utDownHock
){
public
TomcatGraceful
ShutDownEntrance
createSpringbootTomcatInit
(
TomcatShutDownHock
tomcatSh
utDownHock
){
return
new
TomcatGraceful
lyShutDown
(
tomcatConnectSho
utDownHock
);
return
new
TomcatGraceful
ShutDownEntrance
(
tomcatSh
utDownHock
);
}
}
// @Bean
// @Bean
// public Graceful
lyShoutDown createGraceObject(TomcatConnectSho
utDownHock servletConnectShoutDownHock, ProviderService providerService, UpDatas dubboUpdata) {
// public Graceful
ShutDown createGraceObject(TomcatSh
utDownHock servletConnectShoutDownHock, ProviderService providerService, UpDatas dubboUpdata) {
// return new Graceful
lySho
utDown( servletConnectShoutDownHock, providerService, dubboUpdata);
// return new Graceful
Sh
utDown( servletConnectShoutDownHock, providerService, dubboUpdata);
// }
// }
@Bean
@Bean
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
@ConditionalOnExpression
(
"!T(org.springframework.util.StringUtils).isEmpty('${dubbo.registry.address:}')"
)
public
Graceful
lyShoutDown
createGraceObject
(
UpDatas
dubboUpdata
)
{
public
Graceful
ShutDown
createGraceObject
(
UpDatas
dubboUpdata
)
{
return
new
Graceful
lySho
utDown
(
dubboUpdata
);
return
new
Graceful
Sh
utDown
(
dubboUpdata
);
}
}
...
...
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