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/params/ParamBuilder.java

    r90 r96  
    66import com.framsticks.util.Builder;
    77import com.framsticks.util.FramsticksException;
     8import com.framsticks.util.Misc;
    89import com.framsticks.util.lang.Strings;
    910
     
    4647
    4748        /** The flags stored as a bit sum. */
    48         private Integer flags = 0;
     49        private int flags = 0;
    4950
    5051        /** The parameter name. */
     
    6364        private Object def;
    6465
    65         private Integer extra;
     66        private int extra = 0;
    6667
    6768        String containedTypeName;
     
    179180                try {
    180181                        if (paramType == null) {
    181                                 throw new FramsticksException().msg("trying to finish incomplete param");
     182                                throw new FramsticksException().msg("trying to finish incomplete param while type is missing");
    182183                        }
    183184                        return paramType.getConstructor(ParamBuilder.class).newInstance(this);
     
    214215
    215216        @ParamAnnotation
    216         public ParamBuilder flags(Integer flags) {
     217        public ParamBuilder flags(int flags) {
    217218                this.flags = flags;
    218219                return this;
     
    359360         */
    360361        @ParamAnnotation
    361         public Integer getFlags() {
     362        public int getFlags() {
    362363                return flags;
    363364        }
     
    385386
    386387        @ParamAnnotation(id = "xtra")
    387         public Integer getExtra() {
     388        public int getExtra() {
    388389                return extra;
    389390        }
     
    397398
    398399        @ParamAnnotation(id = "xtra")
    399         public ParamBuilder extra(Integer extra) {
     400        public ParamBuilder extra(int extra) {
    400401                this.extra = extra;
    401402                return this;
     
    517518                }
    518519                String result = Strings.collapse(matcher.group(1));
    519                 resultType = (result != null) ? parseProcedureTypePart(result, null) : null;
     520                if (result != null) {
     521                        resultType = Param.build().type(result).finish(ValueParam.class);
     522                } else {
     523                        resultType = null;
     524                }
    520525                String arguments = matcher.group(2);
    521526                if (!Strings.notEmpty(arguments)) {
     
    524529                int number = 0;
    525530                for (String a : arguments.split(",")) {
     531                        ParamBuilder arg = Param.build();
     532
    526533                        int space = a.indexOf(' ');
    527                         String type;
    528                         String name;
    529534                        if (space == -1) {
    530                                 type = a;
    531                                 name = "arg" + number;
     535                                arg.type(a).id("arg" + number);
    532536                        } else {
    533                                 type = a.substring(0, space);
    534                                 name = a.substring(space + 1);
    535                         }
    536                         argumentsType.add(parseProcedureTypePart(type, name));
     537                                String name = a.substring(space + 1);
     538                                arg.type(a.substring(0, space)).id(name).name(name);
     539                        }
     540                        argumentsType.add(arg.finish(ValueParam.class));
    537541                        ++number;
    538542                }
     
    546550                return this;
    547551        }
     552
     553        @Override
     554        public String toString() {
     555                return "ParamBuilder for " + Misc.returnNotNull(id, "<not yet known>");
     556        }
    548557}
    549558
Note: See TracChangeset for help on using the changeset viewer.