Author: fgilet Date: 2010-03-09 11:28:16 +0100 (Tue, 09 Mar 2010) New Revision: 199 Log: Plugin de monitoring fonctionnel. Added: trunk/msm-monitoring-plugins/ trunk/msm-monitoring-plugins/LICENSE.txt trunk/msm-monitoring-plugins/README.txt trunk/msm-monitoring-plugins/changelog.txt trunk/msm-monitoring-plugins/pom.xml trunk/msm-monitoring-plugins/src/ trunk/msm-monitoring-plugins/src/main/ trunk/msm-monitoring-plugins/src/main/java/ trunk/msm-monitoring-plugins/src/main/java/org/ trunk/msm-monitoring-plugins/src/main/java/org/nuiton/ trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/ trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/ShowDiskSpace.java trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/package-info.java trunk/msm-monitoring-plugins/src/main/resources/ trunk/msm-monitoring-plugins/src/main/resources/META-INF/ trunk/msm-monitoring-plugins/src/main/resources/META-INF/services/ trunk/msm-monitoring-plugins/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Monitoring trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Monitoring.java Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/core/PluginLoader.java trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java trunk/msm/src/main/resources/i18n/msm-en_GB.properties trunk/msm/src/main/resources/i18n/msm-fr_FR.properties trunk/pom.xml Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/core/PluginLoader.java =================================================================== --- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/core/PluginLoader.java 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/core/PluginLoader.java 2010-03-09 10:28:16 UTC (rev 199) @@ -17,6 +17,7 @@ import org.nuiton.mapstoragemanager.plugins.BigTable; import org.nuiton.mapstoragemanager.plugins.Exporter; import org.nuiton.mapstoragemanager.plugins.Importer; +import org.nuiton.mapstoragemanager.plugins.Monitoring; import org.nuiton.mapstoragemanager.plugins.Plugin; /** @@ -83,6 +84,8 @@ ServiceLoader.load(Importer.class, this); ServiceLoader<Exporter> exporterSetLoader = ServiceLoader.load(Exporter.class, this); + ServiceLoader<Monitoring> monitoringSetLoader = + ServiceLoader.load(Monitoring.class, this); /** * Add plugin in the plugin's map. @@ -96,6 +99,9 @@ for (Exporter exporter : exporterSetLoader) { plugins.put(exporter.getPluginName(), exporter); } + for (Monitoring monitor : monitoringSetLoader) { + plugins.put(monitor.getPluginName(), monitor); + } } /** Added: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Monitoring.java =================================================================== --- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Monitoring.java (rev 0) +++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/Monitoring.java 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,12 @@ +package org.nuiton.mapstoragemanager.plugins; + +/** + * @author E045231P + */ +public interface Monitoring extends Plugin { + + /** + * display. + */ + public void display(); +} Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java =================================================================== --- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/plugins/OurHashMap2.java 2010-03-09 10:28:16 UTC (rev 199) @@ -147,7 +147,9 @@ /** * {@inheritDoc} */ + @Override public final String getPluginName() { return this.getClass().getSimpleName(); } + } Modified: trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java =================================================================== --- trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/msm/src/main/java/org/nuiton/mapstoragemanager/ui/gui/ApplicationEngine.java 2010-03-09 10:28:16 UTC (rev 199) @@ -22,6 +22,7 @@ import org.nuiton.mapstoragemanager.plugins.BigTable; import org.nuiton.mapstoragemanager.plugins.Exporter; import org.nuiton.mapstoragemanager.plugins.Importer; +import org.nuiton.mapstoragemanager.plugins.Monitoring; import org.nuiton.mapstoragemanager.plugins.OurHashMap2; import org.nuiton.mapstoragemanager.plugins.Plugin; import org.nuiton.mapstoragemanager.ui.MainUI; @@ -142,6 +143,10 @@ ui.getExporter().addItem(exporterItem); ui.getExporter().setSelectedItem(exporterItem); } + for (Plugin exPlugin : pluginLoader.getAllPlugin(Monitoring.class)) { + Monitoring monitor = (Monitoring) exPlugin; + monitor.display(); + } } } Modified: trunk/msm/src/main/resources/i18n/msm-en_GB.properties =================================================================== --- trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/msm/src/main/resources/i18n/msm-en_GB.properties 2010-03-09 10:28:16 UTC (rev 199) @@ -1,56 +1,54 @@ -Empty=Empty -Export\ Database= -Exporter\ \:= -Import\ Database= -Importer\ \:= -Map\ Storage\ Manager=Map Storage Manager -No\ help\ today,\ sorry\ \!= -connectionError=The connection attempt to failed, please retry \! -connectionValid=The connection is established -jaxxdemo.message.goto.site=Visit site -jaxxdemo.tree.component= -login\ \:=Login -mapstoragemanager.action.aboutUs=About us -mapstoragemanager.action.aboutUs.tip=About Code Lutin -mapstoragemanager.action.connect=Connect -mapstoragemanager.action.connect.tip=Start a new connection -mapstoragemanager.action.disconnect=Disconnect -mapstoragemanager.action.disconnect.tip=Disconnect the current session -mapstoragemanager.action.edit=Edit -mapstoragemanager.action.edit.tip= -mapstoragemanager.action.exit=Exit -mapstoragemanager.action.exit.tip= -mapstoragemanager.action.export= -mapstoragemanager.action.export.tip= -mapstoragemanager.action.file=File -mapstoragemanager.action.file.tip= -mapstoragemanager.action.fr=French -mapstoragemanager.action.fr.tip=Change to french language -mapstoragemanager.action.help=Help -mapstoragemanager.action.help.tip= -mapstoragemanager.action.import= -mapstoragemanager.action.import.tip= -mapstoragemanager.action.language=Choose language -mapstoragemanager.action.language.tip= -mapstoragemanager.action.menuHelp=Help -mapstoragemanager.action.menuHelp.tip= -mapstoragemanager.action.plugin=Plugins -mapstoragemanager.action.plugin.tip= -mapstoragemanager.action.pluginload=Load -mapstoragemanager.action.pluginload.tip=Load plugins -mapstoragemanager.action.pluginshow=Show -mapstoragemanager.action.pluginshow.tip=Show plugins -mapstoragemanager.action.preferences=Preferences -mapstoragemanager.action.preferences.tip= -mapstoragemanager.action.uk=English -mapstoragemanager.action.uk.tip=Change to english language -mapstoragemanager.action.visitSite=Visit our site -mapstoragemanager.action.visitSite.tip= -messageEntry=Welcome to MapStorageManager -name\ base\ \:=Name base -no.help=No help today, sorry \! -ok=Validate -password\ \:=Password -table.keys=Keys -table.values=Values -welcome.MapStorageManager=Welcome to MapStorageManager +Empty=Empty +Export\ Database= +Exporter\ \:= +Import\ Database= +Importer\ \:= +Map\ Storage\ Manager=Map Storage Manager +connectionError=The connection attempt to failed, please retry \! +connectionValid=The connection is established +jaxxdemo.message.goto.site=Visit site +login\ \:=Login +mapstoragemanager.action.aboutUs=About us +mapstoragemanager.action.aboutUs.tip=About Code Lutin +mapstoragemanager.action.connect=Connect +mapstoragemanager.action.connect.tip=Start a new connection +mapstoragemanager.action.disconnect=Disconnect +mapstoragemanager.action.disconnect.tip=Disconnect the current session +mapstoragemanager.action.edit=Edit +mapstoragemanager.action.edit.tip= +mapstoragemanager.action.exit=Exit +mapstoragemanager.action.exit.tip= +mapstoragemanager.action.export=Export +mapstoragemanager.action.export.tip= +mapstoragemanager.action.file=File +mapstoragemanager.action.file.tip= +mapstoragemanager.action.fr=French +mapstoragemanager.action.fr.tip=Change to french language +mapstoragemanager.action.help=Help +mapstoragemanager.action.help.tip= +mapstoragemanager.action.import=Import +mapstoragemanager.action.import.tip= +mapstoragemanager.action.language=Choose language +mapstoragemanager.action.language.tip= +mapstoragemanager.action.menuHelp=Help +mapstoragemanager.action.menuHelp.tip= +mapstoragemanager.action.plugin=Plugins +mapstoragemanager.action.plugin.tip= +mapstoragemanager.action.pluginload=Load +mapstoragemanager.action.pluginload.tip=Load plugins +mapstoragemanager.action.pluginshow=Show +mapstoragemanager.action.pluginshow.tip=Show plugins +mapstoragemanager.action.preferences=Preferences +mapstoragemanager.action.preferences.tip= +mapstoragemanager.action.uk=English +mapstoragemanager.action.uk.tip=Change to english language +mapstoragemanager.action.visitSite=Visit our site +mapstoragemanager.action.visitSite.tip= +messageEntry=Welcome to MapStorageManager +name\ base\ \:=Name base +no.help=No help today, sorry \! +ok=Validate +password\ \:=Password +table.keys=Keys +table.values=Values +welcome.MapStorageManager=Welcome to MapStorageManager Modified: trunk/msm/src/main/resources/i18n/msm-fr_FR.properties =================================================================== --- trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/msm/src/main/resources/i18n/msm-fr_FR.properties 2010-03-09 10:28:16 UTC (rev 199) @@ -1,56 +1,54 @@ -Empty=Vide -Export\ Database= -Exporter\ \:= -Import\ Database= -Importer\ \:= -Map\ Storage\ Manager=Map Storage Manager -No\ help\ today,\ sorry\ \!= -connectionError=La connexion \u00E0 \u00E9chou\u00E9e, r\u00E9essayez s'il vous pla\u00EEt \! -connectionValid=La connexion est \u00E9tablie -jaxxdemo.message.goto.site=Visitez le site -jaxxdemo.tree.component= -login\ \:=Identifiant -mapstoragemanager.action.aboutUs=A propos -mapstoragemanager.action.aboutUs.tip=A propos de Code Lutin -mapstoragemanager.action.connect=Connexion -mapstoragemanager.action.connect.tip=Etablir une nouvelle connexion -mapstoragemanager.action.disconnect=D\u00E9connexion -mapstoragemanager.action.disconnect.tip=D\u00E9connecte la session courante -mapstoragemanager.action.edit=Edition -mapstoragemanager.action.edit.tip= -mapstoragemanager.action.exit=Quitter -mapstoragemanager.action.exit.tip=Quitte l'application -mapstoragemanager.action.export= -mapstoragemanager.action.export.tip= -mapstoragemanager.action.file=Fichier -mapstoragemanager.action.file.tip= -mapstoragemanager.action.fr=Fran\u00E7ais -mapstoragemanager.action.fr.tip=Changer la langue en fran\u00E7ais -mapstoragemanager.action.help=Aide -mapstoragemanager.action.help.tip= -mapstoragemanager.action.import= -mapstoragemanager.action.import.tip= -mapstoragemanager.action.language=Choisir la langue -mapstoragemanager.action.language.tip= -mapstoragemanager.action.menuHelp=Aide -mapstoragemanager.action.menuHelp.tip=Aide contextuelle -mapstoragemanager.action.plugin=Plugins -mapstoragemanager.action.plugin.tip= -mapstoragemanager.action.pluginload=R\u00E9cup\u00E9rer -mapstoragemanager.action.pluginload.tip=R\u00E9cup\u00E9ration des plugins \u00E0 partir d'un dossier -mapstoragemanager.action.pluginshow=Lister -mapstoragemanager.action.pluginshow.tip=Liste des plugins disponible -mapstoragemanager.action.preferences=Pr\u00E9f\u00E9rences -mapstoragemanager.action.preferences.tip=Configurer l'application -mapstoragemanager.action.uk=Anglais -mapstoragemanager.action.uk.tip=Changer la langue en anglais -mapstoragemanager.action.visitSite=Visiter notre site -mapstoragemanager.action.visitSite.tip= -messageEntry=Bienvenue dans MapStorageManager -name\ base\ \:=Nom de la base -no.help=Pas d'aide pour l'instant, d\u00E9sol\u00E9 \! -ok=Valider -password\ \:=Mot de passe -table.keys=Cl\u00E9s -table.values=Valeurs -welcome.MapStorageManager=Bienvenue dans MapStorageManager +Empty=Vide +Export\ Database= +Exporter\ \:= +Import\ Database= +Importer\ \:= +Map\ Storage\ Manager=Map Storage Manager +connectionError=La connexion \u00E0 \u00E9chou\u00E9e, r\u00E9essayez s'il vous pla\u00EEt \! +connectionValid=La connexion est \u00E9tablie +jaxxdemo.message.goto.site=Visitez le site +login\ \:=Identifiant +mapstoragemanager.action.aboutUs=A propos +mapstoragemanager.action.aboutUs.tip=A propos de Code Lutin +mapstoragemanager.action.connect=Connexion +mapstoragemanager.action.connect.tip=Etablir une nouvelle connexion +mapstoragemanager.action.disconnect=D\u00E9connexion +mapstoragemanager.action.disconnect.tip=D\u00E9connecte la session courante +mapstoragemanager.action.edit=Edition +mapstoragemanager.action.edit.tip= +mapstoragemanager.action.exit=Quitter +mapstoragemanager.action.exit.tip=Quitte l'application +mapstoragemanager.action.export=Exporter +mapstoragemanager.action.export.tip= +mapstoragemanager.action.file=Fichier +mapstoragemanager.action.file.tip= +mapstoragemanager.action.fr=Fran\u00E7ais +mapstoragemanager.action.fr.tip=Changer la langue en fran\u00E7ais +mapstoragemanager.action.help=Aide +mapstoragemanager.action.help.tip= +mapstoragemanager.action.import=Importer +mapstoragemanager.action.import.tip= +mapstoragemanager.action.language=Choisir la langue +mapstoragemanager.action.language.tip= +mapstoragemanager.action.menuHelp=Aide +mapstoragemanager.action.menuHelp.tip=Aide contextuelle +mapstoragemanager.action.plugin=Plugins +mapstoragemanager.action.plugin.tip= +mapstoragemanager.action.pluginload=R\u00E9cup\u00E9rer +mapstoragemanager.action.pluginload.tip=R\u00E9cup\u00E9ration des plugins \u00E0 partir d'un dossier +mapstoragemanager.action.pluginshow=Lister +mapstoragemanager.action.pluginshow.tip=Liste des plugins disponible +mapstoragemanager.action.preferences=Pr\u00E9f\u00E9rences +mapstoragemanager.action.preferences.tip=Configurer l'application +mapstoragemanager.action.uk=Anglais +mapstoragemanager.action.uk.tip=Changer la langue en anglais +mapstoragemanager.action.visitSite=Visiter notre site +mapstoragemanager.action.visitSite.tip= +messageEntry=Bienvenue dans MapStorageManager +name\ base\ \:=Nom de la base +no.help=Pas d'aide pour l'instant, d\u00E9sol\u00E9 \! +ok=Valider +password\ \:=Mot de passe +table.keys=Cl\u00E9s +table.values=Valeurs +welcome.MapStorageManager=Bienvenue dans MapStorageManager Added: trunk/msm-monitoring-plugins/LICENSE.txt =================================================================== --- trunk/msm-monitoring-plugins/LICENSE.txt (rev 0) +++ trunk/msm-monitoring-plugins/LICENSE.txt 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + Added: trunk/msm-monitoring-plugins/changelog.txt =================================================================== --- trunk/msm-monitoring-plugins/changelog.txt (rev 0) +++ trunk/msm-monitoring-plugins/changelog.txt 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,2 @@ +Changelog is not any longer maintained, please refer to the release note : + http://maven-site.nuiton.org/mapstoragemanager/changes-report.html Added: trunk/msm-monitoring-plugins/pom.xml =================================================================== --- trunk/msm-monitoring-plugins/pom.xml (rev 0) +++ trunk/msm-monitoring-plugins/pom.xml 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,224 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <!-- repository containing the parent pom. --> + <repositories> + <repository> + <id>org.nuiton</id> + <url>http://maven.nuiton.org/release</url> + </repository> + </repositories> + + <modelVersion>4.0.0</modelVersion> + + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> + <parent> + <groupId>org.nuiton</groupId> + <artifactId>mapstoragemanager</artifactId> + <version>0.1-SNAPSHOT</version> + </parent> + + <groupId>org.nuiton</groupId> + <artifactId>msm-monitoring-plugins</artifactId> + <version>0.1-SNAPSHOT</version> + + <dependencies> + + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>msm</artifactId> + <version>0.1-SNAPSHOT</version> + </dependency> + + <!--<dependency> + <groupId>org.nuiton</groupId> + <artifactId>nuiton-utils</artifactId> + <version>${lutinutil.version}</version> + </dependency>--> + + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> + + <!-- JUnit for tests --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>MSM-Monitoring-Plugins</name> + + <description>Plugin for MapStorageManager to test with an implementation of + the BigTable Specification using HashMap.</description> + <inceptionYear>2010</inceptionYear> + + <developers> + <developer> + <id>tchemit</id> + <name>Tony Chemit</name> + <email>chemit@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>fdesbois</id> + <name>Florian Desbois</name> + <email>fdesbois@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>fgilet</id> + <name>Florent Gilet</name> + <email>florent.gilet@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>gcrieloue</id> + <name>Gilles Crieloue</name> + <email>gilles.crieloue@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>afages</id> + <name>Amaury Fages</name> + <email>amaury.fages@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + <developer> + <id>dlanglais</id> + <name>Dorian langlais</name> + <email>dorain.langlais@etu.univ-nantes.fr</email> + <organization>Université de nantes</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + </developers> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + <packaging>jar</packaging> + + <build> + + <!--<plugins> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <executions> + <execution> + <id>copy-deps</id> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <silent>true</silent> + <overWriteReleases>false</overWriteReleases> + <overWriteSnapshots>false</overWriteSnapshots> + <overWriteIfNewer>true</overWriteIfNewer> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + + </plugin> + + </plugins>--> + + <pluginManagement> + <plugins> + + <!--<plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <configuration> + <copyToMETA_INF>true</copyToMETA_INF> + </configuration> + </plugin>--> + + <!--<plugin> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <archive> + <manifest> + <addClasspath>true</addClasspath> + <classpathPrefix>./lib/</classpathPrefix> + </manifest> + </archive> + </configuration> + </plugin>--> + + <!-- plugin site --> + <!--<plugin> + <artifactId>maven-site-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>doxia-module-jrst</artifactId> + <version>${jrst.version}</version> + </dependency> + </dependencies> + </plugin>--> + + </plugins> + </pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <encoding>${project.build.sourceEncoding}</encoding> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>2.2</version> + <configuration> + <encoding>${project.build.sourceEncoding}</encoding> + </configuration> + </plugin> + </plugins> + </build> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> \ No newline at end of file Added: trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/ShowDiskSpace.java =================================================================== --- trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/ShowDiskSpace.java (rev 0) +++ trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/ShowDiskSpace.java 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,77 @@ +package org.nuiton.monitoring; + +import java.awt.GridLayout; +import java.io.File; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import org.nuiton.mapstoragemanager.plugins.Monitoring; + +/** + * + * @author E045231P + */ +public class ShowDiskSpace extends JFrame implements Monitoring { + + /** + * Number for division byte -> Mb -> Gb. + */ + public static int DIV = 1024; + + /** + * Constructor. + */ + public ShowDiskSpace(){ + } + + /** + * Display. + */ + @Override + public void display(){ + this.setTitle("Plugin ShowDiskSpace"); + this.setSize(300, 300); + this.setLocationRelativeTo(null); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JPanel content = new JPanel(); + File f = new File(new File("").getAbsolutePath()).getParentFile(); + if (f.exists()) { + long freeSpaceByte = f.getFreeSpace(); + long totalSpaceByte = f.getTotalSpace(); + long usableSpaceByte = f.getUsableSpace(); + double freeSpaceMb = freeSpaceByte/(DIV*DIV); + double totalSpaceMb = totalSpaceByte/(DIV*DIV); + double usableSpaceMb = usableSpaceByte/(DIV*DIV); + double freeSpaceGb = freeSpaceMb/DIV; + double totalSpaceGb = totalSpaceMb/DIV; + double usableSpaceGb = usableSpaceMb/DIV; + content.setLayout(new GridLayout(7,1)); + content.add(new JLabel("freeSpace : "+freeSpaceMb+" Mb ("+freeSpaceGb+" Gb)")); + content.add(new JLabel("totalSpace : "+totalSpaceMb+" Mb ("+totalSpaceGb+" Gb)")); + content.add(new JLabel("usableSpace : "+usableSpaceMb+" Mb ("+usableSpaceGb+" Gb)")); + content.add(new JLabel("")); + } + Runtime runtime = Runtime.getRuntime(); + long freeMemoryByte = runtime.freeMemory(); + long totalMemoryByte = runtime.totalMemory(); + long maxMemoryByte = runtime.maxMemory(); + double freeMemoryMb = freeMemoryByte/(DIV*DIV); + double totalMemoryMb = totalMemoryByte/(DIV*DIV); + double maxMemoryMb = maxMemoryByte/(DIV*DIV); + double freeMemoryGb = freeMemoryMb/DIV; + double totalMemoryGb = totalMemoryMb/DIV; + double maxMemoryGb = maxMemoryMb/DIV; + content.add(new JLabel("freeMemory : "+freeMemoryMb+" Mb ("+freeMemoryGb+" Gb)")); + content.add(new JLabel("totalMemory : "+totalMemoryMb+" Mb ("+totalMemoryGb+" Gb)")); + content.add(new JLabel("maxMemory : "+maxMemoryMb+" Mb ("+maxMemoryGb+" Gb)")); + + this.setContentPane(content); + this.pack(); + this.setVisible(true); + } + + public String getPluginName() { + return this.getClass().getSimpleName(); + } +} Added: trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/package-info.java =================================================================== --- trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/package-info.java (rev 0) +++ trunk/msm-monitoring-plugins/src/main/java/org/nuiton/monitoring/package-info.java 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1,5 @@ +/** + * Package org.pluginDiskSpace. + * contains an ui plugin for mapstoragemanager. + */ +package org.pluginDiskSpace; \ No newline at end of file Added: trunk/msm-monitoring-plugins/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Monitoring =================================================================== --- trunk/msm-monitoring-plugins/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Monitoring (rev 0) +++ trunk/msm-monitoring-plugins/src/main/resources/META-INF/services/org.nuiton.mapstoragemanager.plugins.Monitoring 2010-03-09 10:28:16 UTC (rev 199) @@ -0,0 +1 @@ +org.nuiton.monitoring.ShowDiskSpace \ No newline at end of file Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-03-09 10:24:57 UTC (rev 198) +++ trunk/pom.xml 2010-03-09 10:28:16 UTC (rev 199) @@ -23,6 +23,7 @@ <module>msm-hbase</module> <module>msm-fromtoXML</module> <module>msm-fromtoXPP3</module> + <module>msm-monitoring-plugins</module> </modules> <!-- ************************************************************* -->