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/remote/RecursiveFetcher.java

    r90 r96  
    11package com.framsticks.remote;
    22
     3import static com.framsticks.core.InstanceUtils.*;
    34import com.framsticks.core.Node;
    45import com.framsticks.core.Path;
     
    89import com.framsticks.core.Instance;
    910import com.framsticks.util.dispatching.Future;
     11import com.framsticks.util.FramsticksException;
     12import com.framsticks.util.Logging;
    1013import com.framsticks.util.StateFunctor;
    1114import com.framsticks.util.Stopwatch;
     
    3639                assert instance.isActive();
    3740                log.info("recursively fetched in " + stopwatch);
    38                 stateFunctor.call(null);
     41                stateFunctor.call();
    3942        }
    4043
     
    4447                        log.warn("path " + path + " is not resolved - skipping");
    4548                } else {
    46                         AccessInterface access = instance.bindAccess(path);
     49                        AccessInterface access = bindAccess(path);
    4750                        FramsClass framsClass = access.getFramsClass();
    4851                        assert framsClass != null;
     
    5053                                Object child = access.get(p, Object.class);
    5154                                final Path childPath = path.appendNode(new Node(p, child));
    52                                 if (childPath.isResolved() && instance.getInfoFromCache(childPath) != null) {
     55                                if (childPath.isResolved() && getInfoFromCache(childPath) != null) {
    5356                                        ++dispatched;
    5457                                        instance.dispatch(new RunAt<Instance>() {
     
    6164                                }
    6265                                ++dispatched;
    63                                 instance.resolve(childPath, new Future<Path>() {
     66                                instance.resolve(childPath, new Future<Path>(Logging.logger(log, "resolve", RecursiveFetcher.this)) {
    6467                                        @Override
    65                                         public void result(Path result, Exception e) {
     68                                        protected void result(Path result) {
    6669                                                assert instance.isActive();
    67                                                 if (e != null) {
    68                                                         log.error(e);
    69                                                         return;
    70                                                 }
    7170                                                fetch(result);
    7271                                        }
     
    8382                instance.fetchValues(path, new StateFunctor() {
    8483                        @Override
    85                         public void call(Exception e) {
    86                                 if (e != null) {
    87                                         log.error("failed to fetch values for " + path + ": " + e);
    88                                         process(null);
    89                                         return;
    90                                 }
     84                        public void handle(FramsticksException e) {
     85                                log.error("failed to fetch values for " + path + ": " + e);
     86                                process(null);
     87                        }
     88
     89                        @Override
     90                        public void call() {
    9191                                process(path);
    9292                        }
Note: See TracChangeset for help on using the changeset viewer.