Author: echatellier Date: 2012-06-30 14:14:40 +0200 (Sat, 30 Jun 2012) New Revision: 2882 Url: http://chorem.org/repositories/revision/jtimer/2882 Log: Remove chorem webservice. Removed: branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/ui/ws/ branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/ws/ Modified: branches/2.0.0-evol-499-storage/pom.xml branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimer.java branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerConfig.java branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerFactory.java branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/data/TimerCore.java branches/2.0.0-evol-499-storage/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java Modified: branches/2.0.0-evol-499-storage/pom.xml =================================================================== --- branches/2.0.0-evol-499-storage/pom.xml 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/pom.xml 2012-06-30 12:14:40 UTC (rev 2882) @@ -194,13 +194,6 @@ <artifactId>cobertura-maven-plugin</artifactId> <version>2.5.1</version> </plugin> - - <!-- TODO Use this when jnlp will be ok --> - <!--plugin> - <groupId>org.nuiton.thirdparty</groupId> - <artifactId>webstart-maven-plugin</artifactId> - <version>1.0-alpha-2-cl_20091001</version> - </plugin--> </plugins> </reporting> @@ -265,24 +258,6 @@ <artifactId>freemarker</artifactId> <version>2.3.19</version> </dependency> - <dependency> - <groupId>org.apache.xmlrpc</groupId> - <artifactId>xmlrpc-client</artifactId> - <version>${xmrpcVersion}</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.xmlrpc</groupId> - <artifactId>xmlrpc-common</artifactId> - <version>${xmrpcVersion}</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <artifactId>junit</artifactId> - <groupId>junit</groupId> - </exclusion> - </exclusions> - </dependency> <!-- commons-xxx lib --> @@ -378,51 +353,6 @@ </execution> </executions> </plugin> - <!-- FIXME : utiliser le profile de mavenpom --> - <!--plugin> - <groupId>org.codehaus.mojo.webstart</groupId> - <artifactId>webstart-maven-plugin</artifactId> - <version>1.0-alpha-2</version> - <executions> - <execution> - <phase>pre-site</phase> - <goals> - <goal>jnlp-inline</goal> - </goals> - </execution> - </executions> - <configuration> - <libPath>lib</libPath> - <jnlp> - <mainClass>${exec.mainClass}</mainClass> - </jnlp> - <sign> - <keystore>${keystorepath}</keystore> - <storepass>${keystorepass}</storepass> - <alias>${keystorealias}</alias> - <verify>true</verify> - </sign> - <pack200>true</pack200> - <gzip>true</gzip> - </configuration> - </plugin> - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <id>extract-jnlp-archive</id> - <phase>site</phase> - <configuration> - <tasks> - <unzip src="${project.build.directory}/${project.build.finalName}.zip" dest="${project.reporting.outputDirectory}" /> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin--> </plugins> </build> </profile> Modified: branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimer.java =================================================================== --- branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimer.java 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimer.java 2012-06-30 12:14:40 UTC (rev 2882) @@ -80,9 +80,6 @@ import org.chorem.jtimer.ui.tasks.RunTaskJob; import org.chorem.jtimer.ui.treetable.ProjectsAndTasksTable; import org.chorem.jtimer.ui.widget.WindowProperty2; -import org.chorem.jtimer.ui.ws.SwingConnectionInformationHandler; -import org.chorem.jtimer.ws.ConnectionDataHandler; -import org.chorem.jtimer.ws.ProjectManagement; import org.jdesktop.application.Action; import org.jdesktop.application.Application; import org.jdesktop.application.ApplicationContext; @@ -202,15 +199,6 @@ // init timercore core = new TimerCore(); - // handler - ConnectionDataHandler handler = new SwingConnectionInformationHandler( - this); - ProjectManagement managementService = JTimerFactory - .getProjectManagementService(); - if (managementService != null) { - managementService.setConnectionDataHandler(handler); - } - // Systray mgr systrayManager = new SystrayManager(this); core.getData().addDataEventListener(systrayManager); Modified: branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerConfig.java =================================================================== --- branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerConfig.java 2012-06-30 12:14:40 UTC (rev 2882) @@ -96,26 +96,6 @@ } } - public Class getServiceClass() { - Class serviceClass = null; - try { - serviceClass = appConfig.getOptionAsClass(JTimerOption.SERVICE_CLASS.key); - } catch (Exception ex) { - if (log.isWarnEnabled()) { - log.warn("Can't find service class implementation, sync will not work", ex); - } - } - return serviceClass; - } - - public String getServiceEndpoint() { - return appConfig.getOption(JTimerOption.SERVICE_ENDPOINT.key); - } - - public String getServiceResource() { - return appConfig.getOption(JTimerOption.SERVICE_RESOURCE.key); - } - public Class getIOSaverClass() { return appConfig.getOptionAsClass(JTimerOption.IO_SAVER_CLASS.key); } @@ -202,9 +182,6 @@ protected enum JTimerOption { CONFIG_FILENAME(ApplicationConfig.CONFIG_FILE_NAME, "jtimer.properties"), - SERVICE_CLASS("jtimer.service.class", null), - SERVICE_ENDPOINT("jtimer.service.endpoint", null), - SERVICE_RESOURCE("jtimer.service.resource", "JTimer"), IO_SAVER_CLASS("jtimer.io.saver.class", "org.chorem.jtimer.io.GTimerIncrementalSaver"), IO_SAVER_DIRECTORY("jtimer.io.saver.directory", "${user.home}/.gtimer"), IO_SAVER_AUTOSAVEDELAY("jtimer.io.saver.autosavedelay", "300"), Modified: branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerFactory.java =================================================================== --- branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerFactory.java 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/JTimerFactory.java 2012-06-30 12:14:40 UTC (rev 2882) @@ -28,7 +28,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.io.Saver; -import org.chorem.jtimer.ws.ProjectManagement; /** * JTimer config class. @@ -44,9 +43,6 @@ /** Logger */ private static Log log = LogFactory.getLog(JTimerFactory.class); - /** ProjectManagement */ - protected static ProjectManagement projectManagement; - /** Saver */ protected static Saver saver; @@ -58,60 +54,6 @@ } /** - * Return an implementation on a distant web service. - * - * Use jtimer.service.class property to found class and - * jtimer.service.endpoint and jtimer.service.resource to init it. - * - * @return implementation on a distant web service. - */ - public static ProjectManagement getProjectManagementService() { - - if (projectManagement == null) { - - Class implementationClass = JTimer.config.getServiceClass(); - - // log - if (log.isInfoEnabled()) { - log.info("Using service class : " + implementationClass); - log.info(" with service endpoint : " + JTimer.config.getServiceEndpoint()); - log.info(" with service resource : " + JTimer.config.getServiceResource()); - } - - // By default jTimer won't synchronize - // so implementationClass can be null - if (implementationClass != null) { - - try { - // get instance - projectManagement = (ProjectManagement)implementationClass.newInstance(); - - // init instance - projectManagement.setEndpoint(JTimer.config.getServiceEndpoint()); - projectManagement.setResourceName(JTimer.config.getServiceResource()); - } catch (InstantiationException e) { - if (log.isErrorEnabled()) { - log.error("Can't instanciate class : " - + implementationClass, e); - } - } catch (IllegalAccessException e) { - if (log.isErrorEnabled()) { - log.error( - "Can't access class : " + implementationClass, - e); - } - } - } else { - if (log.isInfoEnabled()) { - log.info("No sync information given, won't synchronize"); - } - } - } - - return projectManagement; - } - - /** * Get saver manager. * * @return saver manager Modified: branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/data/TimerCore.java =================================================================== --- branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/data/TimerCore.java 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/src/main/java/org/chorem/jtimer/data/TimerCore.java 2012-06-30 12:14:40 UTC (rev 2882) @@ -36,9 +36,6 @@ import org.chorem.jtimer.entities.TimerProject; import org.chorem.jtimer.io.DataLockingException; import org.chorem.jtimer.io.Saver; -import org.chorem.jtimer.ws.ConnectionDataHandler; -import org.chorem.jtimer.ws.ProjectManagement; -import org.chorem.jtimer.ws.xmlrpc.WSDaemon; /** * TimerCore @@ -60,12 +57,6 @@ /** saver io controller. */ protected Saver saver; - /** Web service daemon. */ - protected WSDaemon webServiceDaemon; - - /** connection data handler */ - protected ConnectionDataHandler connectionHandler; - /** * Constructor. */ @@ -84,14 +75,6 @@ data.addVetoableDataEventListener(saver); data.addDataEventListener(saver); } - - // web service impl - ProjectManagement managementService = JTimerFactory.getProjectManagementService(); - if (managementService != null) { - managementService.setDataManager(data); - data.addVetoableDataEventListener(managementService); - data.addDataEventListener(managementService); - } } /** Modified: branches/2.0.0-evol-499-storage/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java =================================================================== --- branches/2.0.0-evol-499-storage/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-06-29 20:40:23 UTC (rev 2881) +++ branches/2.0.0-evol-499-storage/src/test/java/org/chorem/jtimer/JTimerFactoryTest.java 2012-06-30 12:14:40 UTC (rev 2882) @@ -29,8 +29,6 @@ import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.io.GTimerIncrementalSaver; import org.chorem.jtimer.io.Saver; -import org.chorem.jtimer.ws.ProjectManagement; -import org.chorem.jtimer.ws.xmlrpc.ChoremXMLRPCClient; import org.testng.Assert; import org.testng.annotations.Test; @@ -58,10 +56,6 @@ log.info("Test property loading " + JTimerFactoryTest.class); } - Assert.assertEquals(JTimer.config.getServiceClass(), ChoremXMLRPCClient.class); - Assert.assertEquals(JTimer.config.getServiceResource(), "JTimer"); - Assert.assertEquals(JTimer.config.getServiceEndpoint(), "http://localhost:8080"); - Assert.assertEquals(JTimer.config.getIdleTime(), 299); Assert.assertEquals(JTimer.config.getIOSaverClass(), GTimerIncrementalSaver.class); @@ -81,16 +75,4 @@ Assert.assertNotNull(saver); } - - /** - * Test que le composant gerant les webservices s'est bien initialise. - */ - @Test - public void getProjectManagementService() { - ProjectManagement projectManagement = JTimerFactory.getProjectManagementService(); - - Assert.assertNotNull(projectManagement); - Assert.assertEquals(projectManagement.getEndpoint(), "http://localhost:8080"); - Assert.assertEquals(projectManagement.getResourceName(), "JTimer"); - } }