git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/wps@153161 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
418586d8ee
commit
234562371c
13
pom.xml
13
pom.xml
|
@ -433,7 +433,9 @@
|
|||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>52n-wps-algorithm</artifactId>
|
||||
<groupId>org.n52.wps</groupId>
|
||||
<groupId>
|
||||
org.n52.wps
|
||||
</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
@ -691,6 +693,15 @@
|
|||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<version>1.1.11</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.thetransactioncompany</groupId>
|
||||
<artifactId>cors-filter</artifactId>
|
||||
|
|
|
@ -92,8 +92,10 @@ public class WebProcessingService extends HttpServlet {
|
|||
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
LOGGER.info("initialising WPS");
|
||||
String dir = (String)context.application().getInitParameter(DIRECTORY_PARAM);
|
||||
GcubeAlgorithmRepository.setUpdater(new AlgorithmUpdater(dir));
|
||||
LOGGER.info("WPS initialised");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.data.analysis.wps.repository;
|
||||
|
||||
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
|
||||
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
|
||||
import static java.nio.file.StandardWatchEventKinds.OVERFLOW;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -66,7 +67,7 @@ public final class AlgorithmUpdater {
|
|||
this.loader = loader;
|
||||
//TODO: change with something from configuration
|
||||
dir = Paths.get(algorithmDirectory);
|
||||
dir.register(watcher, ENTRY_CREATE);
|
||||
dir.register(watcher, ENTRY_CREATE, ENTRY_MODIFY);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -75,7 +76,7 @@ public final class AlgorithmUpdater {
|
|||
@SuppressWarnings("unchecked")
|
||||
public void run(){
|
||||
for (;;) {
|
||||
|
||||
log.info("direcotry watcher is running");
|
||||
// wait for key to be signaled
|
||||
WatchKey key;
|
||||
try {
|
||||
|
@ -87,7 +88,7 @@ public final class AlgorithmUpdater {
|
|||
|
||||
for (WatchEvent<?> event: key.pollEvents()) {
|
||||
WatchEvent.Kind<?> kind = event.kind();
|
||||
|
||||
log.debug("new event thrown for directory watcher");
|
||||
// This key is registered only
|
||||
// for ENTRY_CREATE events,
|
||||
// but an OVERFLOW event can
|
||||
|
|
Loading…
Reference in New Issue