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 fe7f210..0000000 Binary files a/resources/opt/scm-server/conf/sonia/scm/ces/WebAppRestartHook.class and /dev/null differ 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