From dc32fb7d4a79a4873d34e73540f7fb370764a303 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Thu, 2 Nov 2023 08:18:49 +0100 Subject: [PATCH] Remove obsolete WebappRestartHook --- .../sonia/scm/ces/WebAppRestartHook.class | Bin 1039 -> 0 bytes .../conf/sonia/scm/ces/WebAppRestartHook.java | 55 ------------------ spec/goss/goss.yaml | 15 +---- 3 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.class delete mode 100644 resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.java diff --git a/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.class b/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.class deleted file mode 100644 index fe7f21071b585a88932bda71aedaaefc6707576e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1039 zcmZuwT~pIQ6g}IfO$kMy2+Eh#51=ij5yS^ToI!@-11*kqU^+f+!`ew{H<@IM@UwgZ zb?^uHqa1GtL(?g!ZjE>n9=5)*(F!0R40cc2H+`#PTEaI6?lNpTUb7^uw(a_&)DlWv zmcEMycik;@>5853*>a>37pf?EN9-*6Mf;RihOwS8M~#-SR2q2{bgZON#45vV@czQ= zaLJpZBcw9JYgM8N5-gEXzH;0?rqE&?W*V=tMs2wBYoaH1?+5w*&G9;%?A(07&aV+a zL*?y!1iEkLQja>4Yvn%eGPjiDU6R>Np+2>_3PdX(1eZ18oePg4n+u8iijCZ$FJ|(A z1cUC*4VV;(qXKPt?wnDh?J&Mip=amzU|kPXABFC!j~a645!Mi+e+6Ke!3ZAFK1!z; z;xwsO7^gKu$UNv#w3LVSA8UC00)_P;s#nhUZ~ZzmD)8D zm1`uczoFNQS4eGXtJ7L$D1HMYm_IR`z)1k5`=OrL49Ni|iL7A?>&W5_jSZCXmd>C$ N7@p94O3yJ&{|B$?5FP*k diff --git a/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.java b/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.java deleted file mode 100644 index d4888c0..0000000 --- a/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.java +++ /dev/null @@ -1,55 +0,0 @@ -/*** - * Copyright (c) 2015, Sebastian Sdorra - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * https://bitbucket.org/sdorra/scm-manager - * - */ -package sonia.scm.ces; - -import java.lang.management.*; -import javax.management.*; - - -/** - * Hook to restart a jetty web application via jmx. - * - * @author Sebastian Sdorra - */ -public final class WebAppRestartHook { - - private static final String ONAME = "org.eclipse.jetty.webapp:type=webappcontext,name=%s,id=%s"; - - public static void restart(String name, String id) throws Exception { - String webapp = String.format(ONAME, name, id); - - MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - ObjectName oname = new ObjectName(webapp); - server.invoke(oname, "stop", new String[0], new String[0]); - server.invoke(oname, "start", new String[0], new String[0]); - } - -} diff --git a/spec/goss/goss.yaml b/spec/goss/goss.yaml index 0663734..c94582c 100644 --- a/spec/goss/goss.yaml +++ b/spec/goss/goss.yaml @@ -28,7 +28,7 @@ file: contains: [] /opt/scm-server/conf: exists: true - size: 132 + size: 122 owner: scm group: scm filetype: directory @@ -51,19 +51,6 @@ file: group: scm filetype: file contains: [] - /opt/scm-server/conf/sonia/scm/ces: - exists: true - owner: scm - group: scm - filetype: directory - contains: [] - /opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.class: - exists: true - size: 1039 - owner: scm - group: scm - filetype: file - contains: [] /startup.sh: exists: true owner: root