Moved Flow library
This commit is contained in:
parent
5aa703c0cf
commit
5a65086421
@ -15,6 +15,11 @@
|
|||||||
<description>WarpPI Calculator core project</description>
|
<description>WarpPI Calculator core project</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>it.cavallium</groupId>
|
||||||
|
<artifactId>warppi-flow</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.unimi.dsi</groupId>
|
<groupId>it.unimi.dsi</groupId>
|
||||||
<artifactId>fastutil</artifactId>
|
<artifactId>fastutil</artifactId>
|
||||||
|
32
flow/.classpath
Normal file
32
flow/.classpath
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
</classpath>
|
1
flow/.gitignore
vendored
Normal file
1
flow/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/target/
|
23
flow/.project
Normal file
23
flow/.project
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>warppi-flow</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
52
flow/pom.xml
Normal file
52
flow/pom.xml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>it.cavallium</groupId>
|
||||||
|
<artifactId>warppi</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>warppi-flow</artifactId>
|
||||||
|
<packaging>bundle</packaging>
|
||||||
|
|
||||||
|
<name>WarpPI Flow Library</name>
|
||||||
|
<description>WarpPI Flow library project</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<extensions>true</extensions>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<Export-Package>it.cavallium.warppi.*</Export-Package>
|
||||||
|
<Bundle-SymbolicName>warppi-flow</Bundle-SymbolicName>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -3,8 +3,6 @@ package it.cavallium.warppi.flow;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.cavallium.warppi.Engine;
|
|
||||||
|
|
||||||
public class IntervalsManager {
|
public class IntervalsManager {
|
||||||
private static List<ObservableInterval> intervals = new LinkedList<>();
|
private static List<ObservableInterval> intervals = new LinkedList<>();
|
||||||
|
|
||||||
@ -37,8 +35,8 @@ public class IntervalsManager {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Engine.getPlatform().setThreadDaemon(t);
|
t.setDaemon(true);
|
||||||
Engine.getPlatform().setThreadName(t, "Intervals Manager");
|
t.setName("Intervals Manager");
|
||||||
t.start();
|
t.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,5 @@
|
|||||||
package it.cavallium.warppi.flow;
|
package it.cavallium.warppi.flow;
|
||||||
|
|
||||||
import it.cavallium.warppi.Engine;
|
|
||||||
|
|
||||||
public class ObservableInterval extends Observable<Long> {
|
public class ObservableInterval extends Observable<Long> {
|
||||||
private final long interval;
|
private final long interval;
|
||||||
volatile boolean running;
|
volatile boolean running;
|
||||||
@ -48,7 +46,7 @@ public class ObservableInterval extends Observable<Long> {
|
|||||||
} catch (final InterruptedException e) {}
|
} catch (final InterruptedException e) {}
|
||||||
timeThread = null;
|
timeThread = null;
|
||||||
});
|
});
|
||||||
Engine.getPlatform().setThreadName(timeThread, "ObservableTimer");
|
timeThread.setName("ObservableTimer");
|
||||||
timeThread.start();
|
timeThread.start();
|
||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
35
flow/src/test/java/it/cavallium/warppi/AppTest.java
Normal file
35
flow/src/test/java/it/cavallium/warppi/AppTest.java
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package it.cavallium.warppi;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
import junit.framework.Test;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit test for simple App.
|
||||||
|
*/
|
||||||
|
public class AppTest extends TestCase {
|
||||||
|
/**
|
||||||
|
* Create the test case
|
||||||
|
*
|
||||||
|
* @param testName
|
||||||
|
* name of the test case
|
||||||
|
*/
|
||||||
|
public AppTest(final String testName) {
|
||||||
|
super(testName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the suite of tests being tested
|
||||||
|
*/
|
||||||
|
public static Test suite() {
|
||||||
|
return new TestSuite(AppTest.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rigourous Test :-)
|
||||||
|
*/
|
||||||
|
public void testApp() {
|
||||||
|
Assert.assertTrue(true);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user