From abc0180c68f7a53cddd066b0f88bc8213d2ae04a Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Tue, 22 Mar 2011 12:49:55 +0000 Subject: [PATCH] Adapt to changes in Commons git-svn-id: https://svn.argeo.org/slc/trunk@4338 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- demo/log4j.properties | 2 +- demo/slc-client-rcp.product | 4 +- demo/slc_demo_rap.properties | 33 ++++----- dep/org.argeo.slc.dep.sdk.rap/pom.xml | 32 ++++---- dep/org.argeo.slc.dep.sdk.rcp/pom.xml | 5 +- .../META-INF/MANIFEST.MF | 3 +- .../SlcRapSecureWorkbenchWindowAdvisor.java | 2 +- .../argeo/slc/client/rap/SlcSecureRap.java | 6 +- .../META-INF/MANIFEST.MF | 4 +- .../plugins/org.argeo.slc.client.rcp/pom.xml | 2 +- .../rcp/SlcSecureClientApplication.java | 2 +- .../rcp/SlcSecureWorkbenchWindowAdvisor.java | 2 +- .../slc/services/impl/AgentServiceImpl.java | 13 ++-- runtime/org.argeo.slc.support.gis/pom.xml | 20 +++++ .../hibernate/HibernateTrackDaoTestCase.java | 74 +++++++++---------- 15 files changed, 108 insertions(+), 96 deletions(-) diff --git a/demo/log4j.properties b/demo/log4j.properties index 5fd52a421..0b5481c04 100644 --- a/demo/log4j.properties +++ b/demo/log4j.properties @@ -22,7 +22,7 @@ log4j.logger.org.hibernate=WARN log4j.logger.org.springframework=WARN #log4j.logger.org.springframework.web=DEBUG #log4j.logger.org.springframework.jms=WARN -#log4j.logger.org.springframework.security=DEBUG +log4j.logger.org.springframework.security=DEBUG #log4j.logger.org.springframework.ldap=TRACE #log4j.logger.org.springframework.osgi.web=TRACE diff --git a/demo/slc-client-rcp.product b/demo/slc-client-rcp.product index ba5646b35..59c46c9d7 100644 --- a/demo/slc-client-rcp.product +++ b/demo/slc-client-rcp.product @@ -159,6 +159,9 @@ + + + @@ -181,7 +184,6 @@ - diff --git a/demo/slc_demo_rap.properties b/demo/slc_demo_rap.properties index 61f40a575..08ae1002a 100644 --- a/demo/slc_demo_rap.properties +++ b/demo/slc_demo_rap.properties @@ -1,19 +1,25 @@ argeo.osgi.start=\ org.springframework.osgi.extender,\ +org.argeo.server.ads.server,\ +org.argeo.node.repo.jackrabbit,\ +org.argeo.slc.server.h2,\ +org.argeo.slc.server.castor,\ +org.argeo.slc.server.hibernate,\ +org.argeo.security.manager.ldap,\ +org.argeo.security.services,\ +org.argeo.slc.server.services,\ com.springsource.javax.servlet,\ +org.argeo.security.equinox,\ org.eclipse.core.runtime,\ org.eclipse.equinox.common,\ -org.eclipse.equinox.http.jetty,\ -org.eclipse.equinox.http.registry,\ org.eclipse.equinox.launcher,\ -org.mortbay.jetty.server,\ -org.argeo.security.equinox,\ -org.argeo.security.manager.ldap,\ -org.argeo.security.services,\ -org.argeo.server.ads.server,\ +org.springframework.osgi.web.extender,\ +org.argeo.dep.osgi.catalina.start,\ +org.argeo.jackrabbit.webapp,\ +org.eclipse.equinox.http.registry,\ +org.argeo.server.osgi.webapp,\ org.argeo.slc.agent,\ org.argeo.slc.client.agent,\ -org.argeo.slc.client.commons,\ org.argeo.slc.client.core,\ org.argeo.slc.client.hibernate,\ org.argeo.slc.client.oxm,\ @@ -21,13 +27,6 @@ org.argeo.slc.client.rap,\ org.argeo.slc.client.ui,\ org.argeo.slc.demo.ant,\ org.argeo.slc.demo.basic,\ -org.argeo.slc.demo.ant,\ -org.argeo.slc.server.castor,\ -org.argeo.slc.server.h2,\ -org.argeo.slc.server.hibernate,\ -org.argeo.slc.server.services,\ -org.argeo.slc.gis.position.backend,\ -org.argeo.node.repo.jackrabbit,\ org.argeo.slc.ui.gis.rap,\ eclipse.ignoreApp=true @@ -37,8 +36,8 @@ org.argeo.security.ui.initialPerspective=org.argeo.slc.client.ui.perspectives.sl log4j.configuration=file:../../log4j.properties -org.eclipse.equinox.http.jetty.log.stderr.threshold=debug -org.osgi.service.http.port=9090 +argeo.node.repo.home=~/.argeo/server_noderepo +argeo.node.repo.dburl=jdbc:h2:file:~/.argeo/h2/server_noderepo_db # LDAP diff --git a/dep/org.argeo.slc.dep.sdk.rap/pom.xml b/dep/org.argeo.slc.dep.sdk.rap/pom.xml index e7ad7f57e..db067c8f3 100644 --- a/dep/org.argeo.slc.dep.sdk.rap/pom.xml +++ b/dep/org.argeo.slc.dep.sdk.rap/pom.xml @@ -19,35 +19,33 @@ + org.argeo.slc.eclipse - org.argeo.slc.client.rap + org.argeo.slc.client.ui + ${version.slc} + + + org.argeo.slc.eclipse + org.argeo.slc.client.ui.dist ${version.slc} + org.argeo.commons.security org.argeo.security.ui.rap ${version.argeo-commons} - + + org.argeo.slc.eclipse + org.argeo.slc.client.rap + ${version.slc} + + org.argeo.slc.dep - org.argeo.slc.dep.sdk.rcp + org.argeo.slc.dep.backend ${version.slc} - - - org.argeo.commons.eclipse - org.argeo.eclipse.dep.rcp - - - org.argeo.slc.eclipse - org.argeo.slc.client.rcp - - - org.argeo.commons.eclipse - org.argeo.eclipse.ui.rcp - - \ No newline at end of file diff --git a/dep/org.argeo.slc.dep.sdk.rcp/pom.xml b/dep/org.argeo.slc.dep.sdk.rcp/pom.xml index d90c287b6..d815f202e 100644 --- a/dep/org.argeo.slc.dep.sdk.rcp/pom.xml +++ b/dep/org.argeo.slc.dep.sdk.rcp/pom.xml @@ -19,6 +19,7 @@ + org.argeo.slc.eclipse org.argeo.slc.client.ui @@ -32,16 +33,14 @@ org.argeo.commons.security - org.argeo.security.ui.application + org.argeo.security.ui.rcp ${version.argeo-commons} - org.argeo.slc.eclipse org.argeo.slc.client.rcp ${version.slc} - org.argeo.slc.dep diff --git a/eclipse/plugins/org.argeo.slc.client.rap/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.slc.client.rap/META-INF/MANIFEST.MF index 75d9f8415..10aef160f 100644 --- a/eclipse/plugins/org.argeo.slc.client.rap/META-INF/MANIFEST.MF +++ b/eclipse/plugins/org.argeo.slc.client.rap/META-INF/MANIFEST.MF @@ -10,5 +10,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy Import-Package: javax.servlet;version="2.4.0", javax.servlet.http;version="2.4.0", - org.argeo.security.ui.application, - org.argeo.slc.client.ui.perspectives + org.argeo.security.ui.rap diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java index fefbeebab..f96e97e72 100644 --- a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java +++ b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcRapSecureWorkbenchWindowAdvisor.java @@ -1,6 +1,6 @@ package org.argeo.slc.client.rap; -import org.argeo.security.ui.application.RapSecureWorkbenchWindowAdvisor; +import org.argeo.security.ui.rap.RapSecureWorkbenchWindowAdvisor; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; /** diff --git a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java index f37988f6e..492970055 100644 --- a/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java +++ b/eclipse/plugins/org.argeo.slc.client.rap/src/main/java/org/argeo/slc/client/rap/SlcSecureRap.java @@ -1,7 +1,7 @@ package org.argeo.slc.client.rap; -import org.argeo.security.ui.application.SecureRap; -import org.argeo.security.ui.application.SecureWorkbenchAdvisor; +import org.argeo.security.ui.rap.SecureEntryPoint; +import org.argeo.security.ui.rap.SecureWorkbenchAdvisor; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchAdvisor; import org.eclipse.ui.application.WorkbenchWindowAdvisor; @@ -10,7 +10,7 @@ import org.eclipse.ui.application.WorkbenchWindowAdvisor; * This class controls all aspects of the application's execution and is * contributed through the plugin.xml. */ -public class SlcSecureRap extends SecureRap { +public class SlcSecureRap extends SecureEntryPoint { @Override diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.slc.client.rcp/META-INF/MANIFEST.MF index f884def28..61a7e9d47 100644 --- a/eclipse/plugins/org.argeo.slc.client.rcp/META-INF/MANIFEST.MF +++ b/eclipse/plugins/org.argeo.slc.client.rcp/META-INF/MANIFEST.MF @@ -8,11 +8,11 @@ Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Import-Package: org.argeo.slc.client.ui.perspectives, +Import-Package: org.argeo.security.ui.rcp, + org.argeo.slc.client.ui.perspectives, org.argeo.slc.core.test.tree, org.argeo.slc.execution, org.argeo.slc.process, org.argeo.slc.runtime, - org.argeo.security.ui.application, org.argeo.slc.services, org.argeo.slc.services.impl diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/pom.xml b/eclipse/plugins/org.argeo.slc.client.rcp/pom.xml index b7edf4a81..2dd31af6b 100644 --- a/eclipse/plugins/org.argeo.slc.client.rcp/pom.xml +++ b/eclipse/plugins/org.argeo.slc.client.rcp/pom.xml @@ -29,7 +29,7 @@ org.argeo.commons.security - org.argeo.security.ui.application + org.argeo.security.ui.rcp ${version.argeo-commons} diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java index fb1711714..44d2f3aac 100644 --- a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java +++ b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java @@ -1,6 +1,6 @@ package org.argeo.slc.client.rcp; -import org.argeo.security.ui.application.SecureRcp; +import org.argeo.security.ui.rcp.SecureRcp; import org.eclipse.ui.application.WorkbenchAdvisor; /** diff --git a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java index 5436a49a3..3206ec6a5 100644 --- a/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java +++ b/eclipse/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java @@ -1,6 +1,6 @@ package org.argeo.slc.client.rcp; -import org.argeo.security.ui.application.SecureWorkbenchWindowAdvisor; +import org.argeo.security.ui.rcp.SecureWorkbenchWindowAdvisor; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; diff --git a/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java b/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java index 5dea5c9ea..9a292c0de 100644 --- a/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java +++ b/runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/services/impl/AgentServiceImpl.java @@ -18,6 +18,7 @@ package org.argeo.slc.services.impl; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.Executor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -37,7 +38,7 @@ public class AgentServiceImpl implements AgentService, InitializingBean, private final SlcAgentDescriptorDao slcAgentDescriptorDao; private final SlcAgentFactory agentFactory; - private ArgeoSecurityService securityService; + private Executor securityService; private Long pingCycle = 20000l; @@ -65,9 +66,11 @@ public class AgentServiceImpl implements AgentService, InitializingBean, // if (pingCycle > 0) // new PingThread().start(); if (pingCycle > 0) { - Thread authenticatedThread = new Thread(securityService - .wrapWithSystemAuthentication(new AgentsPing()), - "SLC Agents Ping"); + Thread authenticatedThread = new Thread("SLC Agents Ping") { + public void run() { + securityService.execute(new AgentsPing()); + } + }; authenticatedThread.start(); } @@ -82,7 +85,7 @@ public class AgentServiceImpl implements AgentService, InitializingBean, this.pingCycle = pingCycle; } - public void setSecurityService(ArgeoSecurityService securityService) { + public void setSecurityService(Executor securityService) { this.securityService = securityService; } diff --git a/runtime/org.argeo.slc.support.gis/pom.xml b/runtime/org.argeo.slc.support.gis/pom.xml index 2163a3094..ecbce95ff 100644 --- a/runtime/org.argeo.slc.support.gis/pom.xml +++ b/runtime/org.argeo.slc.support.gis/pom.xml @@ -31,6 +31,13 @@ + + + org.argeo.commons.basic + org.argeo.basic.nodeps + ${version.argeo-commons} + + org.argeo.slc.runtime @@ -43,6 +50,12 @@ com.springsource.slf4j.org.apache.commons.logging + + + org.springframework + org.springframework.orm + + org.argeo.dep.osgi @@ -99,5 +112,12 @@ org.argeo.dep.osgi.jai.imageio + + + org.argeo.slc.runtime + org.argeo.slc.unit + test + ${version.slc} + \ No newline at end of file diff --git a/runtime/org.argeo.slc.support.gis/src/test/java/org/argeo/slc/gpx/hibernate/HibernateTrackDaoTestCase.java b/runtime/org.argeo.slc.support.gis/src/test/java/org/argeo/slc/gpx/hibernate/HibernateTrackDaoTestCase.java index ee22ec59d..21d9121ce 100644 --- a/runtime/org.argeo.slc.support.gis/src/test/java/org/argeo/slc/gpx/hibernate/HibernateTrackDaoTestCase.java +++ b/runtime/org.argeo.slc.support.gis/src/test/java/org/argeo/slc/gpx/hibernate/HibernateTrackDaoTestCase.java @@ -16,46 +16,38 @@ package org.argeo.slc.gpx.hibernate; -import java.io.File; -import java.io.FileInputStream; -import org.apache.commons.io.IOUtils; -import org.argeo.slc.gpx.TrackDao; -import org.argeo.slc.hibernate.unit.HibernateTestCase; -import org.hibernatespatial.HBSpatialExtension; -import org.hibernatespatial.cfg.HSConfiguration; - -public class HibernateTrackDaoTestCase extends HibernateTestCase { - static { - HSConfiguration config = new HSConfiguration(); - config.setDefaultDialect("org.hibernatespatial.postgis.PostgisDialect"); - - HBSpatialExtension.setConfiguration(config); - } - - public void testImport() throws Exception { - String sensor = "mbaudier"; - File dir = new File("/home/mbaudier/ArgeoOffice/perso/gps/trips/2010"); - - TrackDao trackDao = getBean(TrackDao.class); - long begin = System.currentTimeMillis(); - for (File file : dir.listFiles()) { - if (!file.getName().endsWith(".gpx")) - continue; - FileInputStream in = null; - try { - in = new FileInputStream(file); - trackDao.importTrackPoints(sensor, in); - } catch (Exception e) { - log.warn("Could not import " + file + ": " + e.getMessage()); - throw e; - } finally { - IOUtils.closeQuietly(in); - } - } - double duration = System.currentTimeMillis() - begin; - if (log.isDebugEnabled()) - log.debug("Imported files from " + dir + " in " - + (duration / 1000 / 60) + " min"); - } +public class HibernateTrackDaoTestCase {//extends HibernateTestCase { +// static { +// HSConfiguration config = new HSConfiguration(); +// config.setDefaultDialect("org.hibernatespatial.postgis.PostgisDialect"); +// +// HBSpatialExtension.setConfiguration(config); +// } +// +// public void testImport() throws Exception { +// String sensor = "mbaudier"; +// File dir = new File("/home/mbaudier/ArgeoOffice/perso/gps/trips/2010"); +// +// TrackDao trackDao = getBean(TrackDao.class); +// long begin = System.currentTimeMillis(); +// for (File file : dir.listFiles()) { +// if (!file.getName().endsWith(".gpx")) +// continue; +// FileInputStream in = null; +// try { +// in = new FileInputStream(file); +// trackDao.importTrackPoints(sensor, in); +// } catch (Exception e) { +// log.warn("Could not import " + file + ": " + e.getMessage()); +// throw e; +// } finally { +// IOUtils.closeQuietly(in); +// } +// } +// double duration = System.currentTimeMillis() - begin; +// if (log.isDebugEnabled()) +// log.debug("Imported files from " + dir + " in " +// + (duration / 1000 / 60) + " min"); +// } } -- 2.39.2