如何在Spring Boot中恢复被杀死的api /作业

时间:2019-01-08 20:19:24

标签: java spring-boot

我创建了一个Java Spring Boot项目,该项目经常查询监视系统并通过get方法收集数据,每组服务器在启动此数据收集时都分配有唯一的作业密钥。假设有人杀死了jar,我该如何恢复在该jar上运行的数据收集

我写了一种方法,可以在有人停止它的时候优雅地关闭jar,但是如果有人杀死了它,我不确定它是否可以工作。

.menu-area{background: #F9F3DB; }

.dropdown-menu{padding:0;margin:0;border:0 solid transition!important;border:0 solid rgba(0,0,0,.15);border-radius:0;-webkit-box-shadow:none!important;box-shadow:none!important}

.mainmenu a,   .navbar-default
.navbar-nav > li > a, 
.mainmenu ul li a , 
.navbar-expand-lg     .navbar-nav .nav-link{color:#6D6C6B;font-size:16px;text-transform:capitalize;padding:10px 10px;font-family:'calibri',sans-serif;display: block !important;}


/*==========WISS logo==========*/
 .navbar-default 
 .navbar-brand .navbar-text {
color:#6D6C6B;}
/*==========active page properties==========*/
.mainmenu 
.active a,
.mainmenu 
.active a:focus,
.mainmenu 
.active a:hover,
.mainmenu li a:hover,
.mainmenu li a:focus ,
.navbar-default 
.navbar-nav>.show>a, 
.navbar-default 
.navbar-nav>.show>a:focus, 
.navbar-default 
.navbar-nav>.show>a:hover{background: #6D6C6B; color: #F9F3DB; outline: 0;}


/*==========Sub Menu=v==========*/

.mainmenu 
.collapse ul > li:hover > a{background: #6D6C6B;color: #F9F3DB; }

.mainmenu 
.collapse ul ul > li:hover > a, 
.navbar-default 
.navbar-nav 
.show 

.dropdown-menu > li > a:focus, 
.navbar-default 
.navbar-nav 

.show 
.dropdown-menu > li > a:hover{background: #6D6C6B;}

.mainmenu 
.collapse ul ul ul > li:hover > a{background: #6D6C6B;}


.mainmenu .collapse ul ul, 
.mainmenu .collapse ul ul
.dropdown-menu{background:#d9d9d8;}

.mainmenu 
.collapse ul ul ul, 
.mainmenu .collapse ul ul ul
.dropdown-menu{background:#d9d9d8}

.mainmenu .collapse ul ul ul ul, 
.mainmenu .collapse ul ul ul ul
.dropdown-menu{background:#d9d9d8}



/******************************Drop-down menu work on hover**********************************/

.mainmenu{background: none;border: 0 solid;margin: 0;padding: 0;min-height:20px;width: 100%;}


@media only screen and (min-width: 767px) {

.mainmenu 
.collapse ul li:hover> ul{display:block}

.mainmenu 
.collapse ul ul{position:absolute;top:100%;left:0;min-width:250px;display:none}

/*******/

.mainmenu 
.collapse ul ul li{position:relative}
.mainmenu .collapse ul ul li:hover> ul{display:block}

.mainmenu .collapse ul ul ul{position:absolute;top:0;left:100%;min-width:250px;display:none}

/*******/

.mainmenu .collapse ul ul ul li{position:relative}

.mainmenu .collapse ul ul ul li:hover ul{display:block}

.mainmenu .collapse ul ul ul ul{position:absolute;top:0;left:-100%;min-width:250px;display:none;z-index:1}

}


@media only screen and (max-width: 767px) {

.navbar-nav .show .dropdown-menu 
.dropdown-menu > li > a{padding:16px 15px 16px 35px}

.navbar-nav .show .dropdown-menu 
.dropdown-menu 
.dropdown-menu > li > a{padding:16px 15px 16px 45px}
}

<!------ nav bar ---------->



<div id="menu_area" class="menu-area">

<div class="container">

<div class="row">

<nav class="navbar navbar-dark navbar-expand-lg fixed-top mainmenu">
 <a class="navbar-brand order-md-last" href="#">WISBECH INLINE SPEED</a>

<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarSupportedContent">

<ul class="navbar-nav mr-auto">


<li class="active"><a href="index.htm">Home <span class="sr-only">(current)</span></a></li>

<li><a href="home.htm">News</a></li>


<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Club Information</a>
                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">


<li><a href="about.htm">About Us</a></li>

<li><a href="join.htm">Join Our Club</a></li>

<li><a href="stats.htm">Club Statistics</a></li>

<li><a href="calendar.htm">Calendar</a></li>

<li><a href="results.htm">Results</a></li>

<li><a href="track.htm">Track Info</a></li>

<li><a href="docs.htm">Official Documents</a></li>

<li><a href="sponsorship.htm">Sponsorship</a></li>

<li><a href="contact.htm">Contact Us</a></li>

<li><a href="links.htm">Links</a></li>

</ul>   

<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Meet The Team</a>
                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">


<li><a href="team.htm">The Team</a></li>

<li><a href="coaches.htm">The Coaches</a></li>

<li><a href="committee.htm">The Committee</a></li>
 </ul>

<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Training Tips</a>
                    <ul class="dropdown-menu" aria-labelledby="navbarDropdown">


<li><a href="nutrition.htm">Nutrition</a></li>

<li><a href="technique.htm">Technique</a></li>

<li><a href="injuries.htm">Preventing Injuries</a></li>

<li><a href="maintenance.htm">Maintenance</a></li>

<li><a href="equipment.htm">Equipment</a></li>
</ul>

<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Galleries</a>

<ul class="dropdown-menu" aria-labelledby="navbarDropdown">


<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Photos</a>
                   <ul class="dropdown-menu" aria-labelledby="navbarDropdown">

<li><a href="#">2018</a></li>

<li><a href="#">2017</a></li>

<li><a href="#">2016</a></li>
<li><a href="#">2015</a></li>


</ul>



<li><a href="#">Team Photos</a></li>

<li><a href="#">Videos</a></li>


<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Media</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">

<li><a href="#">Press Reports</a></li>

<li><a href="#">Archives</a></li>
  </ul>


<li class="dropdown">

<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Archives</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">

<li><a href="#">1980's and 90's</a></li>

<li><a href="#">2000's</a></li>

</ul>

</li>

</ul>

</li>

</ul>

</li>

</ul>

</div>

</nav>

</div>
</div>
</div>

<!------ end new nav bar ---------->

这在有人停止jar时有效,但是在我杀死Java进程时却无效。

0 个答案:

没有答案