Skip to content

Commit a9853ba

Browse files
committed
set version to 0.8.0 + README
1 parent 4ee5dfa commit a9853ba

File tree

11 files changed

+102
-13
lines changed

11 files changed

+102
-13
lines changed

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>net.lecousin.core-parent-pom</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.m2e.core.maven2Builder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
16+
</natures>
17+
</projectDescription>

.settings/org.eclipse.m2e.core.prefs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
# lecousin.net - Java core framework
3+
4+
The core library provides:
5+
* A Multi-Threading framework, allowing asynchronous programming
6+
* A new IO (Input/Output) model, flexible, and providing asynchronous operations
7+
8+
It does not have any dependency, however the library [net.lecousin.framework.system](https://github.com/lecousin/java-framework-system "java-framework-system")
9+
is recommended for better performances on disk operations.
10+
11+
It needs to be started by using the net.lecousin.framework.application.Application#start method.
12+
13+
## Build status
14+
15+
Current version: 0.8.0
16+
17+
Master: ![build status](https://travis-ci.org/lecousin/java-framework-core.svg?branch=master "Build Status")
18+
19+
Branch 0.8: branch 0.8 ![build status](https://travis-ci.org/lecousin/java-framework-core.svg?branch=0.8 "Build Status")
20+
21+
Branch 0.9: ![build status](https://travis-ci.org/lecousin/java-framework-core.svg?branch=0.9 "Build Status")
22+
23+
## Multi-threading
24+
25+
The multi-threading system of this library is based on _physical_ resources for better performance:
26+
* One thread by available processor (CPU)
27+
* One thread by physical drive
28+
29+
Each unit of work is a _Task_, that may succeed with a result, fail with an exception, or be cancelled.
30+
A task must use only one physical resource, so a process implying both CPU work and some operations on a drive
31+
must be split into several tasks.
32+
33+
A task should not, but is allowed to block. In this case the blocked thread is interrupted and a new thread
34+
is automatically launched to process other tasks for the same physical resource. Once the task is unblocked,
35+
the thread is resumed as soon as another thread is available and can be stopped.
36+
37+
By default, the order tasks are executed is based on tasks' priority,
38+
then for the same priority in a first-in-first-out order.
39+
This may be changed by providing a new implementation of TaskPriorityManager.
40+
41+
Different kinds of _synchronization point_ are available in the package net.lecousin.framework.concurrent.synch,
42+
such as JoinPoint, SynchronizationPoint, AsyncWork... They allow to wait for one or more asynchronous operations
43+
to finish (successfully or not), by listening to them.
44+
45+
## IO Model
46+
47+
The model provided by Java is very basic and mainly based on streams (reading or writing forward).
48+
49+
Our model add two main additions:
50+
* Flexibility by using interfaces that define the capabilities of an Input/Output implementation such as Readable, Writable, Seekable, Resizable, Buffered...
51+
* Asynchronous operations allowing multi-threading
52+

net.lecousin.core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>net.lecousin</groupId>
44
<artifactId>core</artifactId>
5-
<version>0.8</version>
5+
<version>0.8.0</version>
66
<parent>
77
<groupId>net.lecousin</groupId>
88
<artifactId>core-parent-pom</artifactId>
9-
<version>0.8</version>
9+
<version>0.8.0</version>
1010
</parent>
1111

1212
<name>lecousin.net Java core framework</name>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
2-
* TODO
2+
* Multi-threading framework.
33
*/
44
package net.lecousin.framework.concurrent;

net.lecousin.core/src/main/java/net/lecousin/framework/memory/MemoryManager.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public void handleNotification(Notification notification, Object handback) {
6464
//lastGcForcedFailed = false;
6565
if (now - lastGC[4] < 60000) {
6666
logger.debug("5 garbage collections in less than 1 minute");
67-
// TODO free some memory ?
6867
}
6968
System.arraycopy(lastGC, 0, lastGC, 1, 9);
7069
System.arraycopy(lastGCAllocatedMemory, 0, lastGCAllocatedMemory, 1, 9);

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/xml/TestXMLStreamCursorWithDOM.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ private static void checkNode(Node node, XMLStreamCursor xml, LinkedList<String>
221221
case END_ELEMENT:
222222
Assert.assertFalse(openElements.isEmpty());
223223
Assert.assertEquals(openElements.removeLast(), xml.text.asString());
224-
// TODO check no more elements in DOM
225224
break;
226225
case TEXT:
227226
if (xml.text.asString().trim().isEmpty() && node.getNodeType() != Node.TEXT_NODE) {
@@ -262,7 +261,6 @@ private static void checkDocType(DocumentType node, XMLStreamCursor xml) throws
262261

263262
private static void checkProcessingInstruction(ProcessingInstruction node, XMLStreamCursor xml) throws Exception {
264263
assertEquals("processing instruction target", node.getTarget(), xml.text);
265-
// TODO check inside ? node.getData()
266264
xml.next();
267265
}
268266

net.lecousin.core/src/test/java/net/lecousin/framework/core/tests/xml/TestXMLStreamCursorWithXMLStreamReader.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import net.lecousin.framework.core.test.LCCoreAbstractTest;
1717
import net.lecousin.framework.io.IOFromInputStream;
1818
import net.lecousin.framework.util.IString;
19+
import net.lecousin.framework.util.UnprotectedStringBuffer;
1920
import net.lecousin.framework.xml.XMLStreamCursor;
2021

2122
import org.junit.Assert;
@@ -237,13 +238,30 @@ private static void check(XMLStreamReader reader, XMLStreamCursor xml, LinkedLis
237238
case START_ELEMENT:
238239
Assert.assertEquals("START_ELEMENT ", XMLStreamConstants.START_ELEMENT, reader.getEventType());
239240
assertEquals("START_ELEMENT: ", reader.getLocalName(), xml.text);
241+
for (int i = 0; i < reader.getAttributeCount(); i++) {
242+
String name = reader.getAttributeLocalName(i);
243+
String value = reader.getAttributeValue(i);
244+
UnprotectedStringBuffer ourValue = xml.removeAttribute(name);
245+
if (ourValue == null)
246+
throw new AssertionError("Missing attribute " + name + " on element " + reader.getLocalName());
247+
String s = ourValue.asString();
248+
if (!s.equals(value)) {
249+
s = s.replace('\t', ' ');
250+
if (!s.equals(value)) {
251+
s = s.replaceAll("&.*;", "");
252+
if (!s.equals(value)) {
253+
assertEquals("attribute " + name + " on element " + reader.getLocalName(), value, ourValue);
254+
}
255+
}
256+
}
257+
}
258+
Assert.assertTrue(xml.attributes.isEmpty());
240259
if (!xml.isClosed) {
241260
openElements.add(xml.text.asString());
242261
} else {
243262
Assert.assertEquals("START_ELEMENT closed ", XMLStreamConstants.END_ELEMENT, reader.next());
244263
assertEquals("START_ELEMENT closed: ", reader.getLocalName(), xml.text);
245264
}
246-
// TODO check attributes
247265
break;
248266
case END_ELEMENT:
249267
Assert.assertEquals("END_ELEMENT ", XMLStreamConstants.END_ELEMENT, reader.getEventType());
@@ -287,7 +305,6 @@ private static void check(XMLStreamReader reader, XMLStreamCursor xml, LinkedLis
287305
case PROCESSING_INSTRUCTION:
288306
Assert.assertEquals("PROCESSING_INSTRUCTION ", XMLStreamConstants.PROCESSING_INSTRUCTION, reader.getEventType());
289307
assertEquals("PROCESSING_INSTRUCTION target: ", reader.getPITarget(), xml.text);
290-
// TODO check PIData
291308
break;
292309
}
293310
if (!skipNextReader)
@@ -305,6 +322,6 @@ private static void assertEquals(String message, String expected, IString found)
305322
if (expected == null || expected.isEmpty()) return;
306323
throw new AssertionError(message + ": expected <" + expected + ">, found is null");
307324
}
308-
Assert.assertEquals(expected, found.asString());
325+
Assert.assertEquals(message, expected, found.asString());
309326
}
310327
}

net.lecousin.framework.log.bridges/commons-logging/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<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/xsd/maven-4.0.0.xsd">
22
<modelVersion>4.0.0</modelVersion>
33
<artifactId>log.bridges.commons-logging</artifactId>
4+
<version>0.1.0</version>
45

56
<parent>
67
<groupId>net.lecousin.framework</groupId>
78
<artifactId>log.bridges</artifactId>
8-
<version>0.8</version>
9+
<version>0.1.0</version>
910
<relativePath>..</relativePath>
1011
</parent>
1112

@@ -19,7 +20,7 @@
1920
<dependency>
2021
<groupId>net.lecousin</groupId>
2122
<artifactId>core</artifactId>
22-
<version>${project.version}</version>
23+
<version>0.8.0</version>
2324
</dependency>
2425
</dependencies>
2526
</project>

net.lecousin.framework.log.bridges/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
<groupId>net.lecousin.framework</groupId>
44
<artifactId>log.bridges</artifactId>
55
<packaging>pom</packaging>
6+
<version>0.1.0</version>
67

78
<parent>
89
<groupId>net.lecousin</groupId>
910
<artifactId>core-parent-pom</artifactId>
10-
<version>0.8</version>
11+
<version>0.8.0</version>
1112
</parent>
1213

1314
<modules>

0 commit comments

Comments
 (0)