From 318f481960037a6bc4ae0e2168ebc069d89f6602 Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Fri, 15 Sep 2017 20:43:54 +0200 Subject: [PATCH] OO-3016: remove the JMX code we don't use --- .../java/org/olat/admin/jmx/DumpJMXJob.java | 67 -------------- .../org/olat/admin/jmx/JMXInfoController.java | 82 ----------------- .../org/olat/admin/jmx/_content/jmxmain.html | 9 -- .../jmx/_i18n/LocalStrings_ar.properties | 2 - .../jmx/_i18n/LocalStrings_bg.properties | 2 - .../jmx/_i18n/LocalStrings_cs.properties | 2 - .../jmx/_i18n/LocalStrings_de.properties | 2 - .../jmx/_i18n/LocalStrings_el.properties | 2 - .../jmx/_i18n/LocalStrings_en.properties | 2 - .../jmx/_i18n/LocalStrings_es.properties | 2 - .../jmx/_i18n/LocalStrings_fr.properties | 2 - .../jmx/_i18n/LocalStrings_it.properties | 2 - .../jmx/_i18n/LocalStrings_jp.properties | 2 - .../jmx/_i18n/LocalStrings_nl_NL.properties | 2 - .../jmx/_i18n/LocalStrings_pl.properties | 2 - .../jmx/_i18n/LocalStrings_pt_BR.properties | 2 - .../jmx/_i18n/LocalStrings_ru.properties | 2 - .../jmx/_i18n/LocalStrings_sq.properties | 2 - .../jmx/_i18n/LocalStrings_zh_CN.properties | 2 - .../jmx/_i18n/LocalStrings_zh_TW.properties | 2 - .../org/olat/admin/jmx/_spring/jmxContext.xml | 34 ------- .../datasources/ThreadAndControllerInfo.java | 67 -------------- .../modules/bc/FileUploadController.java | 4 - .../commons/modules/bc/FilesInfoMBean.java | 90 ------------------- .../bc/_spring/folderModuleCorecontext.xml | 3 - .../scheduler/_spring/schedulerContext.xml | 32 ------- .../core/gui/media/FileMediaResource.java | 5 -- .../olat/core/util/vfs/VFSMediaResource.java | 5 -- .../course/statistic/StatisticManager.java | 39 -------- 29 files changed, 471 deletions(-) delete mode 100644 src/main/java/org/olat/admin/jmx/DumpJMXJob.java delete mode 100644 src/main/java/org/olat/admin/jmx/JMXInfoController.java delete mode 100644 src/main/java/org/olat/admin/jmx/_content/jmxmain.html delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ar.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_bg.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_cs.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_de.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_el.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_en.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_es.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_fr.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_it.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_jp.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_nl_NL.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pl.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pt_BR.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ru.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_sq.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_CN.properties delete mode 100644 src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_TW.properties delete mode 100644 src/main/java/org/olat/admin/jmx/datasources/ThreadAndControllerInfo.java delete mode 100644 src/main/java/org/olat/core/commons/modules/bc/FilesInfoMBean.java delete mode 100644 src/main/java/org/olat/course/statistic/StatisticManager.java diff --git a/src/main/java/org/olat/admin/jmx/DumpJMXJob.java b/src/main/java/org/olat/admin/jmx/DumpJMXJob.java deleted file mode 100644 index 37f992d8395..00000000000 --- a/src/main/java/org/olat/admin/jmx/DumpJMXJob.java +++ /dev/null @@ -1,67 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -*/ -package org.olat.admin.jmx; - -import java.util.List; - -import org.olat.core.CoreSpringFactory; -import org.olat.core.commons.services.scheduler.JobWithDB; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - - -/** - * Description:<br> - * a job which regularly dumps jmx data to the log - * - * @author Felix Jost - */ -public class DumpJMXJob extends JobWithDB { - - @Override - public void executeWithDB(JobExecutionContext context) - throws JobExecutionException { - - boolean enabled = context.getMergedJobDataMap().getBooleanFromString("enabled"); - if (enabled) { - JMXManager jmxManager = CoreSpringFactory.getImpl(JMXManager.class); - String[] keys = context.getMergedJobDataMap().getKeys(); - // loop over all - for (int i = 0; i < keys.length; i++) { - String key = keys[i]; - if (key.endsWith("Bean")) { - // ok, key is a bean name => dump this bean - String beanName = context.getMergedJobDataMap().getString(key); - List<String> jmxDumpList = jmxManager.dumpJmx(beanName); - StringBuilder buf = new StringBuilder(); - for (String jmxDump : jmxDumpList) { - buf.append(jmxDump).append(";"); - } - log.info(key + ":" + buf.toString()); - } - } - } - } -} diff --git a/src/main/java/org/olat/admin/jmx/JMXInfoController.java b/src/main/java/org/olat/admin/jmx/JMXInfoController.java deleted file mode 100644 index 72fb79aa192..00000000000 --- a/src/main/java/org/olat/admin/jmx/JMXInfoController.java +++ /dev/null @@ -1,82 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -*/ -package org.olat.admin.jmx; - -import java.util.List; - -import org.olat.core.CoreSpringFactory; -import org.olat.core.gui.UserRequest; -import org.olat.core.gui.components.Component; -import org.olat.core.gui.components.panel.Panel; -import org.olat.core.gui.components.velocity.VelocityContainer; -import org.olat.core.gui.control.Event; -import org.olat.core.gui.control.WindowControl; -import org.olat.core.gui.control.controller.BasicController; - -/** - * Description:<br> - * Dump the JMX context and show the output - * - * <P> - * Initial Date: 01.10.2007 <br> - * @author Felix Jost, http://www.goodsolutions.ch - */ -public class JMXInfoController extends BasicController { - - private final JMXManager jmxManager; - - /** - * @param ureq - * @param wControl - */ - public JMXInfoController(UserRequest ureq, WindowControl wControl) { - super(ureq, wControl); - - jmxManager = CoreSpringFactory.getImpl(JMXManager.class); - if (!jmxManager.isActive()) { - showError("nojmx"); - putInitialPanel(new Panel("empty")); - return; - } - - VelocityContainer mainVc = createVelocityContainer("jmxmain"); - List<String> jmxres = jmxManager.dumpJmx("org.olat.core.commons.modules.bc:name=FilesInfoMBean"); - mainVc.contextPut("jmxlist", jmxres); - String htmlRes = jmxManager.dumpAll(); - mainVc.contextPut("jmxdump", htmlRes); - - putInitialPanel(mainVc); - } - - @Override - protected void doDispose() { - // - } - - @Override - protected void event(UserRequest ureq, Component source, Event event) { - // - } -} \ No newline at end of file diff --git a/src/main/java/org/olat/admin/jmx/_content/jmxmain.html b/src/main/java/org/olat/admin/jmx/_content/jmxmain.html deleted file mode 100644 index 5aedafb495a..00000000000 --- a/src/main/java/org/olat/admin/jmx/_content/jmxmain.html +++ /dev/null @@ -1,9 +0,0 @@ -<h3>JMX values (v0.1!)</h3> -<ul> -#foreach ($entry in $jmxlist) - <li>$entry</li> -#end -</ul> - -<h4>jmx dump</h4> -$jmxdump diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ar.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ar.properties deleted file mode 100644 index 9fd32e9c67c..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ar.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Feb 22 10:58:21 CET 2010 -nojmx=(cf. olat_config.xml)JMX \u0644\u0645 \u064A\u062A\u0645 \u062A\u0646\u0634\u064A\u0637 \u0648\u062D\u062F\u0629 diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_bg.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_bg.properties deleted file mode 100644 index 102cfb744e7..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_bg.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon May 25 22:31:24 CEST 2009 -nojmx=\u041C\u043E\u0434\u0443\u043B\u044A\u0442 JMX \u043D\u0435 \u0435 \u0430\u043A\u0442\u0438\u0432\u0438\u0440\u0430\u043D (\u0432\u0438\u0436\u0442\u0435 olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_cs.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_cs.properties deleted file mode 100644 index e5dede890cd..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_cs.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:13 CET 2009 -nojmx=JMX modul nen\u00ED aktivov\u00E1n (olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_de.properties deleted file mode 100644 index 72a22e44064..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:03 CET 2009 -nojmx=JMX Modul ist nicht aktiviert (vgl olat.local.properies) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_el.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_el.properties deleted file mode 100644 index 47c84a178ef..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_el.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:15 CET 2009 -nojmx=\u03A4\u03BF module JMX \u03B4\u03B5\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 \u03B5\u03BD\u03B5\u03C1\u03B3\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03BF (\u03B4\u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03BF olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_en.properties deleted file mode 100644 index 4b5cc6ef315..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_en.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Feb 01 17:38:46 CET 2010 -nojmx=JMX module not activated (cf. olat.local.properties) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_es.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_es.properties deleted file mode 100644 index 073b8f5e8b8..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_es.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:20 CET 2009 -nojmx=JMX m\u00F3dulo no activado (Ver olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_fr.properties deleted file mode 100644 index 22b702c4a42..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:07 CET 2009 -nojmx=Le module JMX n'est pas activ\u00E9 (voir olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_it.properties deleted file mode 100644 index 58114baccc6..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_it.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:09 CET 2009 -nojmx=Il modulo JMX non \u00E8 attivato (cfr. olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_jp.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_jp.properties deleted file mode 100644 index a908ee574fb..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_jp.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Fri Jul 17 19:44:42 CEST 2009 -nojmx=JMX\u30E2\u30B8\u30E5\u30FC\u30EB\u306F\u6709\u52B9\u5316\u3055\u308C\u3066\u3044\u307E\u305B\u3093 (olat_config.xml\u3092\u3054\u89A7\u304F\u3060\u3055\u3044)\u3002 diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_nl_NL.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_nl_NL.properties deleted file mode 100644 index 85d8c43c8ff..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_nl_NL.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Thu Sep 08 16:42:42 CEST 2011 -nojmx=JMX module noet geactiveerd (cf. olat.local.properties) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pl.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pl.properties deleted file mode 100644 index a2b9a5d7965..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pl.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:16 CET 2009 -nojmx=Modu\u0142 KMX nie jest aktywny (zabacz\: olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pt_BR.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pt_BR.properties deleted file mode 100644 index 0df6adbe7f7..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_pt_BR.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:53:59 CET 2009 -nojmx=JMX Module n\u00E3o est\u00E1 ativado (ver olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ru.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ru.properties deleted file mode 100644 index 6702a3ba651..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_ru.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Thu Sep 24 01:47:31 CEST 2009 -nojmx=\u041C\u043E\u0434\u0443\u043B\u044C JMX \u0434\u0435\u0437\u0430\u043A\u0442\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D (\u0441\u043C\u043E\u0442\u0440\u0438 olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_sq.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_sq.properties deleted file mode 100644 index ca842e1b82a..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_sq.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:11 CET 2009 -nojmx=Moduli JMX nuk \u00EBsht\u00EB aktiv (shikoni olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_CN.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_CN.properties deleted file mode 100644 index 6c4ce01ead7..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_CN.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Sun Dec 20 07:08:47 CET 2009 -nojmx=JMX \u6A21\u5F0F\u672A\u542F\u52A8(\u53C2\u89C1olat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_TW.properties b/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_TW.properties deleted file mode 100644 index 3db6f0759c9..00000000000 --- a/src/main/java/org/olat/admin/jmx/_i18n/LocalStrings_zh_TW.properties +++ /dev/null @@ -1,2 +0,0 @@ -#Mon Mar 02 09:54:05 CET 2009 -nojmx=JMX \u6A21\u7D44\u672A\u555F\u7528(\u6AA2\u8996\u4E00\u4E0Bolat_config.xml) diff --git a/src/main/java/org/olat/admin/jmx/_spring/jmxContext.xml b/src/main/java/org/olat/admin/jmx/_spring/jmxContext.xml index 6550f052a7c..4bac2b5f7f1 100644 --- a/src/main/java/org/olat/admin/jmx/_spring/jmxContext.xml +++ b/src/main/java/org/olat/admin/jmx/_spring/jmxContext.xml @@ -16,39 +16,5 @@ <bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean" lazy-init="true"> <property name="port" value="${jmx.rmi.port}"/> </bean> - - <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false" > - <property name="beans"> - <map> - <entry key="org.olat.admin.jmx.datasources:name=ThreadAndControllerInfo"> - <bean class="org.olat.admin.jmx.datasources.ThreadAndControllerInfo" /> - </entry> - <entry key="org.olat.admin:name=AdminModule" value-ref="adminModule" /> - <entry key="org.olat.core.commons.modules.bc:name=FilesInfoMBean" > - <ref bean="org.olat.core.commons.modules.bc.FilesInfoMBean"/> - </entry> - </map> - </property> - <property name="server" ref="org.springframework.jmx.support.MBeanServerFactoryBean"/> - </bean> - -<!-- DISABLE JMX CONNECTOR - <bean id="serverConnector" - class="org.springframework.jmx.support.ConnectorServerFactoryBean" depends-on="registry"> - <property name="objectName" value="connector:name=rmi"/> - <property name="serviceUrl" - value="service:jmx:rmi://localhost/jndi/rmi://localhost:${jmx.rmi.port}/olat_connector"/> - <property name="daemon" value="true"/> - <property name="environment"> ---> - <!-- the following is only valid when the sun jmx implementation is used --> -<!-- DISABLE JMX CONNECTOR - <map> - <entry key="jmx.remote.x.password.file" value="/usr/local/opt/java/jre/lib/management/jmxremote.password"/> - <entry key="jmx.remote.x.access.file" value="/usr/local/opt/java/jre/lib/management/jmxremote.access"/> - </map> - </property> - </bean> ---> </beans> diff --git a/src/main/java/org/olat/admin/jmx/datasources/ThreadAndControllerInfo.java b/src/main/java/org/olat/admin/jmx/datasources/ThreadAndControllerInfo.java deleted file mode 100644 index ed6dfab9c52..00000000000 --- a/src/main/java/org/olat/admin/jmx/datasources/ThreadAndControllerInfo.java +++ /dev/null @@ -1,67 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -*/ -package org.olat.admin.jmx.datasources; - -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryMXBean; - -import org.olat.admin.sysinfo.manager.SessionStatsManager; -import org.olat.core.CoreSpringFactory; -import org.olat.core.gui.control.DefaultController; -import org.olat.core.util.session.UserSessionManager; - -/** - * Description:<br> - * TODO: - * - * <P> - * Initial Date: 02.10.2007 <br> - * @author Felix Jost, http://www.goodsolutions.ch - */ -public class ThreadAndControllerInfo { - private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean(); - - public int getConcurrentThreads() { - return CoreSpringFactory.getImpl(SessionStatsManager.class).getConcurrentCounter(); - } - - public int getControllerCount() { - return DefaultController.getControllerCount(); - } - - public int getAuthenticatedNodeUsersCount() { - return CoreSpringFactory.getImpl(UserSessionManager.class).getNumberOfAuthenticatedUserSessions(); - } - - public long getMemoryHeapUsageKB() { - return mbean.getHeapMemoryUsage().getUsed() / 1024; - } - - public long getThreadCount() { - ThreadGroup tg = Thread.currentThread().getThreadGroup(); - return tg.activeCount(); - } - -} diff --git a/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java b/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java index 30b8ad99215..32b534fa6a7 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java +++ b/src/main/java/org/olat/core/commons/modules/bc/FileUploadController.java @@ -151,8 +151,6 @@ public class FileUploadController extends FormBasicController { @Autowired private ImageService imageHelper; @Autowired - private FilesInfoMBean fileInfoMBean; - @Autowired private VFSLockManager vfsLockManager; @Autowired private MetaInfoFactory metaInfoFactory; @@ -716,7 +714,6 @@ public class FileUploadController extends FormBasicController { if (success) { String filePath = (uploadRelPath == null ? "" : uploadRelPath + "/") + newFile.getName(); finishSuccessfullUpload(filePath, newFile, ureq); - fileInfoMBean.logUpload(newFile.getSize()); fireEvent(ureq, Event.DONE_EVENT); } else { showError("failed"); @@ -731,7 +728,6 @@ public class FileUploadController extends FormBasicController { VFSItem item = currentContainer.resolve(filePath); if(item != null) { finishSuccessfullUpload(filePath, item, ureq); - fileInfoMBean.logUpload(newFile.getSize()); } else { logWarn("Upload with error:" + filePath, null); } diff --git a/src/main/java/org/olat/core/commons/modules/bc/FilesInfoMBean.java b/src/main/java/org/olat/core/commons/modules/bc/FilesInfoMBean.java deleted file mode 100644 index 54774300276..00000000000 --- a/src/main/java/org/olat/core/commons/modules/bc/FilesInfoMBean.java +++ /dev/null @@ -1,90 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -* <p> -*/ -package org.olat.core.commons.modules.bc; - - -/** - * JMX MBean class to collect infos about file access (upload:client to server , - * download : server to client). - * @author Christian Guretzki - */ -public class FilesInfoMBean { - private long numberOfUploadedFiles = 0; - private long sizeOfUploadedFiles = 0; - private long numberOfDownloadedFiles = 0; - private long sizeOfDownloadedFiles = 0; - - - /** - * Call this method when some file was upload into olat. - * @param size Uploaded-file-size - */ - public synchronized void logUpload(long size) { - numberOfUploadedFiles++; - sizeOfUploadedFiles += size; - } - - /** - * Call this method when some file was downloaded from olat. - * @param size Downloaded-file-size - */ - public synchronized void logDownload(long size) { - numberOfDownloadedFiles++; - sizeOfDownloadedFiles += size; - } - - // JMX MBean Methods - //////////////////// - /** - * @return Number of uploaded file since system start. - */ - public long getNumberOfUploadedFiles() { - return numberOfUploadedFiles; - } - - /** - * @return Overall size of uploaded files since system start. - */ - public long getSizeOfUploadedFiles() { - return sizeOfUploadedFiles; - } - - /** - * @return Number of downloaded file since system start. - */ - public long getNumberOfDownloadedFiles() { - return numberOfDownloadedFiles; - } - - /** - * @return Overall size of downloaded file since system start. - */ - public long getSizeOfDownloadedFiles() { - return sizeOfDownloadedFiles; - } - -} - diff --git a/src/main/java/org/olat/core/commons/modules/bc/_spring/folderModuleCorecontext.xml b/src/main/java/org/olat/core/commons/modules/bc/_spring/folderModuleCorecontext.xml index f4b67e20235..c088f30758b 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/_spring/folderModuleCorecontext.xml +++ b/src/main/java/org/olat/core/commons/modules/bc/_spring/folderModuleCorecontext.xml @@ -10,9 +10,6 @@ <context:component-scan base-package="org.olat.core.commons.modules.bc" /> - - <bean id="org.olat.core.commons.modules.bc.FilesInfoMBean" class="org.olat.core.commons.modules.bc.FilesInfoMBean" /> - <bean id="metaInfoFactory" class="org.olat.core.commons.modules.bc.meta.MetaInfoFactory"> <property name="thumbnailService" ref="thumbnailService" /> </bean> diff --git a/src/main/java/org/olat/core/commons/services/scheduler/_spring/schedulerContext.xml b/src/main/java/org/olat/core/commons/services/scheduler/_spring/schedulerContext.xml index b8b97d9bc27..4b243b1dd46 100644 --- a/src/main/java/org/olat/core/commons/services/scheduler/_spring/schedulerContext.xml +++ b/src/main/java/org/olat/core/commons/services/scheduler/_spring/schedulerContext.xml @@ -35,7 +35,6 @@ How to add a new job: <list> <!-- Include every bean here that should be scheduled --> <ref bean="sendNotificationsEmailTrigger" /> - <!-- <ref bean="dumpJMXJobTrigger"/> --> <ref bean="adobeCleanupJob"/> <ref bean="updateStatisticsTrigger"/> <ref bean="searchIndexingTrigger"/> @@ -61,15 +60,6 @@ How to add a new job: <!-- add referenced schedulers here --> -<!-- Only needed in cluster mode, dumps jmx info to disc --> -<bean id="dumpJMXJobTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"> - <property name="jobDetail" ref="dumpJMXJob" /> - <!-- 5 minute --> - <property name="startDelay" value="300000" /> - <!-- repeat every 10 seconds (dmps the data to disk) --> - <property name="repeatInterval" value="60000" /> -</bean> - <!-- Example bean for cron style scheduling--> <!-- OLAT-5093 start delay ensures there's no conflict with server startup and db not being ready yet --> <!-- @@ -80,28 +70,6 @@ How to add a new job: </bean> --> - -<!-- job definition --> -<bean id="dumpJMXJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"> - <property name="jobClass" value="org.olat.admin.jmx.DumpJMXJob"/> - <property name="jobDataAsMap"> - <map> - <!-- either true or false --> - <!-- TODO:gs make configurable via olat.properties file --> - <entry key="enabled" value="false" /> - <!-- List of dumping beans, key must end with 'Bean' --> - <entry key="ThreadAndControllerInfoBean" value="org.olat.admin.jmx.datasources:name=ThreadAndControllerInfo" /> - <entry key="FilesInfoMBean" value="org.olat.core.commons.modules.bc:name=FilesInfoMBean" /> - </map> - </property> -</bean> - -<!-- - Export your Beans via JMX, to enable start you JVM with "-Dcom.sun.management.jmxremote=true". - This only enables JMX locally and allows you to connect with the same user. To connect via remote read: - http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html ---> - <!-- SEARCH INDEXING CONFIGURATION --> <bean id="searchIndexingTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> diff --git a/src/main/java/org/olat/core/gui/media/FileMediaResource.java b/src/main/java/org/olat/core/gui/media/FileMediaResource.java index 54ba5d9640b..fcfbba8f538 100644 --- a/src/main/java/org/olat/core/gui/media/FileMediaResource.java +++ b/src/main/java/org/olat/core/gui/media/FileMediaResource.java @@ -34,8 +34,6 @@ import java.io.InputStream; import javax.servlet.http.HttpServletResponse; -import org.olat.core.CoreSpringFactory; -import org.olat.core.commons.modules.bc.FilesInfoMBean; import org.olat.core.util.StringHelper; import org.olat.core.util.WebappHelper; @@ -59,7 +57,6 @@ import org.olat.core.util.WebappHelper; public class FileMediaResource implements MediaResource { //TODO:fj:a clean up on all filemediaresources subclasses protected File file; - private FilesInfoMBean filesInfoMBean; private boolean unknownMimeType = false; private boolean deliverAsAttachment = false; @@ -87,7 +84,6 @@ public class FileMediaResource implements MediaResource { public FileMediaResource(File file, boolean deliverAsAttachment) { this.file = file; this.deliverAsAttachment = deliverAsAttachment; - this.filesInfoMBean = (FilesInfoMBean) CoreSpringFactory.getBean(FilesInfoMBean.class.getCanonicalName()); } @Override @@ -131,7 +127,6 @@ public class FileMediaResource implements MediaResource { BufferedInputStream bis = null; try { bis = new BufferedInputStream( new FileInputStream(file) ); - filesInfoMBean.logDownload(getSize()); } catch (FileNotFoundException e) { // } diff --git a/src/main/java/org/olat/core/util/vfs/VFSMediaResource.java b/src/main/java/org/olat/core/util/vfs/VFSMediaResource.java index bff3bd0ee1f..7b6670b6bfa 100644 --- a/src/main/java/org/olat/core/util/vfs/VFSMediaResource.java +++ b/src/main/java/org/olat/core/util/vfs/VFSMediaResource.java @@ -30,8 +30,6 @@ import java.io.InputStream; import javax.servlet.http.HttpServletResponse; -import org.olat.core.CoreSpringFactory; -import org.olat.core.commons.modules.bc.FilesInfoMBean; import org.olat.core.gui.media.MediaResource; import org.olat.core.util.StringHelper; import org.olat.core.util.WebappHelper; @@ -45,11 +43,9 @@ public class VFSMediaResource implements MediaResource { private String encoding; boolean unknownMimeType = false; private boolean downloadable = false; - private FilesInfoMBean filesInfoMBean; public VFSMediaResource(VFSLeaf vfsLeaf) { this.vfsLeaf = vfsLeaf; - this.filesInfoMBean = (FilesInfoMBean) CoreSpringFactory.getBean(FilesInfoMBean.class.getCanonicalName()); } @Override @@ -96,7 +92,6 @@ public class VFSMediaResource implements MediaResource { @Override public InputStream getInputStream() { - filesInfoMBean.logDownload(getSize()); return vfsLeaf.getInputStream(); } diff --git a/src/main/java/org/olat/course/statistic/StatisticManager.java b/src/main/java/org/olat/course/statistic/StatisticManager.java deleted file mode 100644 index 78619222177..00000000000 --- a/src/main/java/org/olat/course/statistic/StatisticManager.java +++ /dev/null @@ -1,39 +0,0 @@ -/** -* OLAT - Online Learning and Training<br> -* http://www.olat.org -* <p> -* Licensed under the Apache License, Version 2.0 (the "License"); <br> -* you may not use this file except in compliance with the License.<br> -* You may obtain a copy of the License at -* <p> -* http://www.apache.org/licenses/LICENSE-2.0 -* <p> -* Unless required by applicable law or agreed to in writing,<br> -* software distributed under the License is distributed on an "AS IS" BASIS, <br> -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br> -* See the License for the specific language governing permissions and <br> -* limitations under the License. -* <p> -* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),<br> -* University of Zurich, Switzerland. -* <hr> -* <a href="http://www.openolat.org"> -* OpenOLAT - Online Learning and Training</a><br> -* This file has been modified by the OpenOLAT community. Changes are licensed -* under the Apache 2.0 license as the original file. -*/ -package org.olat.course.statistic; - -/** - * Description:<br> - * TODO: patrickb Class Description for StatisticManager - * - * <P> - * Initial Date: 23.12.2009 <br> - * @author patrickb - */ -public interface StatisticManager { - - String getInitSqlFile(); - void setInitSqlFile(String initSqlFile); -} -- GitLab