Ignore:
Timestamp:
07/04/13 20:29:50 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • cleanup Instance management
    • extract Instance interface
    • extract Instance common algorithms to InstanceUtils?
  • fix closing issues: Ctrl+C or window close button

properly shutdown whole program

by Java Framsticks framework

  • fix parsing and printing of all request types
  • hide exception passing in special handle method of closures
    • substantially improve readability of closures
    • basically enable use of exception in asynchronous closures

(thrown exception is transported back to the caller)

  • implement call request on both sides

CHANGELOG:
Further improve calling.

Improve instance calling.

Calling is working on both sides.

Improve exception handling in testing.

Waiters do not supercede other apllication exception being thrown.

Finished parsing and printing of all request types (with tests).

Move implementation and tests of request parsing to Request.

Add tests for Requests.

Improve waits in asynchronours tests.

Extract more algorithms to InstanceUtils?.

Extract Instance.resolve to InstanceUtils?.

Improve naming.

Improve passing exception in InstanceClient?.

Hide calling of passed functor in StateCallback?.

Hide Exception passing in asynchronous closures.

Hide exception passing in Future.

Make ResponseCallback? an abstract class.

Make Future an abstract class.

Minor change.

Move getPath to Path.to()

Move bindAccess to InstanceUtils?.

Extract common things to InstanceUtils?.

Fix synchronization bug in Connection.

Move resolve to InstanceUtils?.

Allow names of Joinable to be dynamic.

Add support for set request server side.

More fixes in communication.

Fix issues with parsing in connection.

Cut new line characters when reading.

More improvements.

Migrate closures to FramsticksException?.

Several changes.

Extract resolveAndFetch to InstanceUtils? algorithms.

Test resolving and fetching.

More fixes with function signature deduction.

Do not print default values in SimpleAbstractAccess?.

Add test of FramsClass? printing.

Improve FramsticksException? messages.

Add explicit dispatcher synchronization feature.

Rework assertions in tests.

Previous solution was not generic enough.

Allow addition of joinables to collection after start.

Extract SimulatorInstance? from RemoteInstance?.

Remove PrivateJoinableCollection?.

Improve connections.

Move shutdown hook to inside the Monitor.

It should work in TestNG tests, but it seems that
hooks are not called.

In ServerTest? client connects to testing server.

Move socket initialization to receiver thread.

Add proper closing on Ctrl+C (don't use signals).

Fix bugs with server accepting connections.

Merge Entity into Joinable.

Reworking ServerInstance?.

Extract more algorithm to InstanceUtils?.

Extract some common functionality from AbstractInstance?.

Functions were placed in InstanceUtils?.

Hide registry of Instance.

Use ValueParam? in Instance interface.

Minor change.

Extract Instance interface.

Old Instance is now AbstractInstance?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/dumping/LoadStream.java

    r84 r96  
    22
    33import com.framsticks.communication.File;
     4import com.framsticks.core.InstanceUtils;
    45import com.framsticks.core.Path;
    56import com.framsticks.params.ListSource;
     
    1920 * @author Piotr Sniegowski
    2021 */
    21 public class LoadStream {
     22public class LoadStream extends Stream {
    2223
    2324        private final static Logger log = Logger.getLogger(LoadStream.class.getName());
     
    4647                        while ((line = stream.readLine()) != null) {
    4748                                if (query == null) {
    48                                         query = Strings.splitIntoPair(line, ' ', "\n");
     49                                        query = Strings.splitIntoPair(line, ' ', "");
    4950                                        files = new LinkedList<File>();
    5051                                        log.trace("loading " + line);
     
    5859                                        if (line.equals("ok")) {
    5960                                                if (query.first.equals("get")) {
    60                                                         Path path = instance.createIfNeeded(query.second);
    61                                                         instance.processFetchedValues(path, files);
     61                                                        Path path = InstanceUtils.createIfNeeded(instance, query.second);
     62                                                        InstanceUtils.processFetchedValues(path, files);
    6263                                                } else if (query.first.equals("info")) {
    6364                                                        assert files.size() == 1;
    64                                                         instance.processFetchedInfo(files.get(0));
     65                                                        InstanceUtils.processFetchedInfo(instance, files.get(0));
    6566                                                } else {
    6667                                                        assert false;
     
    8283                } catch (IOException e) {
    8384                        log.error("failed to load: " + e);
    84                         future.result(null, e);
     85                        future.handle(new FramsticksException().msg("failed to load stream").cause(e));
    8586                        return;
    8687                }
    8788                log.info("loaded in: " + stopwatch);
    88                 future.result(instance.getPath(mountPath.getTextual()), null);
     89                future.pass(Path.to(instance, mountPath.getTextual()));
    8990        }
    9091
Note: See TracChangeset for help on using the changeset viewer.