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/core/Path.java

    r90 r96  
    1111import java.util.List;
    1212
     13import javax.annotation.Nonnull;
    1314import javax.annotation.concurrent.Immutable;
    1415
     
    3233                }
    3334                try {
    34                         instance.registry.prepareAccess(param);
     35                        instance.prepareAccess(param);
    3536                        return child;
    3637                } catch (FramsticksException e) {
     
    119120                }
    120121
    121                 public PathBuilder resolve(Instance instance, String textual) {
     122                public static Iterator<String> splitPath(String path) {
     123                        List<String> list = new LinkedList<String>();
     124                        for (String s : path.split("/")) {
     125                                if (!s.isEmpty()) {
     126                                        list.add(s);
     127                                }
     128                        }
     129                        return list.iterator();
     130                }
     131
     132                public PathBuilder resolve(@Nonnull Instance instance, String textual) {
    122133
    123134                        assert nodes.isEmpty();
     
    129140
    130141                        StringBuilder b = new StringBuilder();
    131                         Iterator<String> i = Instance.splitPath(textual);
     142                        Iterator<String> i = splitPath(textual);
    132143                        while (i.hasNext() && current.getObject() != null) {
    133                                 AccessInterface access = instance.registry.prepareAccess(current.getParam());
     144                                AccessInterface access = instance.prepareAccess(current.getParam());
    134145                                if (access == null) {
    135146                                        break;
     
    205216        }
    206217
    207         public final Instance getInstance() {
     218        public final @Nonnull Instance getInstance() {
    208219                assert Dispatching.isThreadSafe();
    209220                return instance;
    210221        }
    211222
     223        public Path tryResolveIfNeeded() {
     224                if (isResolved()) {
     225                        return this;
     226                }
     227                return tryFindResolution();
     228        }
    212229
    213230        /** Attach resolution at end, if available.
     
    221238                        return Path.build().resolve(instance, "/").finish();//appendResolution(instance.root.object);
    222239                }
    223                 Object child = getKnownChild(instance, instance.bindAccess(getUnder()), getTop().getParam());
     240                Object child = getKnownChild(instance, InstanceUtils.bindAccess(instance, getUnder()), getTop().getParam());
    224241                if (child == null) {
    225242                        return this;
     
    266283                }
    267284        }
     285
     286        public static Path to(@Nonnull Instance instance, String textual) {
     287                return Path.build().resolve(instance, textual).finish();
     288        }
    268289}
    269290
Note: See TracChangeset for help on using the changeset viewer.