Ignore:
Timestamp:
06/30/13 12:48:20 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • loading f0 schema with XmlLoader?
  • use XmlLoader? to load configuration
  • introduce unified fork-join model of various entities

(Instances, Connections, GUI Frames, etc.),
all those entities clean up gracefully on
shutdown, which may be initialized by user
or by some entity

  • basing on above, simplify several organizing classes

(Observer, main class)

(to host native frams server process from Java level)

CHANGELOG:
Remove redundant Observer class.

Clean up in AbstractJoinable?.

Update ExternalProcess? class to changes in joining model.

Another sweep through code with FindBugs?.

Find bug with not joining RemoteInstance?.

Joining almost works.

Much improved joining model.

More improvement to joining model.

Add logging messages around joinable operations.

Rename methods in AbstractJoinable?.

Improve Joinable.

Rewrite of entity structure.

More simplifications with entities.

Further improve joinables.

Let Frame compose from JFrame instead of inheriting.

Add join classes.

Improvements of closing.

Add Builder interface.

Add FramsServerTest?.xml

FramsServer? may be configured through xml.

Make Framsticks main class an Observer of Entities.

Make Observer a generic type.

Remove variables regarding to removed endpoint.

Simplify observer (remove endpoints).

More changes to Observer and Endpoint.

Minor improvements.

Add OutputListener? to ExternalProcess?.

Improve testing of ExternalProcess?.

Add ExternalProcess? runner.

Rename the Program class to Framsticks.

Migrate Program to use XmlLoader? configuration.

First steps with configuration using XmlLoader?.

Fix several bugs.

Move all f0 classes to apriopriate package.

XmlLoader? is able to load Schema.

XmlLoader? is loading classes and props.

Add GroupBuilder?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/params/ParamBuilder.java

    r87 r88  
    44import com.framsticks.params.annotations.ParamAnnotation;
    55import com.framsticks.params.types.*;
     6import com.framsticks.util.Builder;
    67import com.framsticks.util.FramsticksException;
    78import com.framsticks.util.lang.Strings;
     
    2324
    2425@FramsClassAnnotation(name = "prop", id = "prop")
    25 public class ParamBuilder {
     26public class ParamBuilder implements Builder<Param> {
    2627        private final static Logger log = Logger.getLogger(ParamBuilder.class.getName());
    2728
     
    6364        private Object def;
    6465
     66        private Integer extra;
     67
    6568        String containedTypeName;
     69
     70        protected Class<?> storageType;
    6671
    6772        protected FramsClassBuilder classBuilder;
     
    8388         * @return the min
    8489         */
     90        @ParamAnnotation
    8591        public Object getMin() {
    8692                return min;
     
    9096         * @return the max
    9197         */
     98        @ParamAnnotation
    9299        public Object getMax() {
    93100                return max;
     
    97104         * @return the def
    98105         */
     106        @ParamAnnotation
    99107        public Object getDef() {
    100108                return def;
     
    135143        public Param finish() {
    136144                try {
     145                        if (paramType == null) {
     146                                throw new FramsticksException().msg("trying to finish incomplete param");
     147                        }
     148
    137149                        return paramType.getConstructor(ParamBuilder.class).newInstance(this);
    138                 } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) {
     150                } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException | FramsticksException e) {
    139151                        throw new FramsticksException().msg("failed to create param").cause(e).arg("name", name);
    140152                }
     
    219231        public ParamBuilder type(String type) {
    220232                // typeString = type;
     233                assert type != null;
    221234
    222235                log.trace("parsing type: " + type);
     
    352365        }
    353366
     367        @ParamAnnotation(id = "xtra")
     368        public Integer getExtra() {
     369                return extra;
     370        }
     371
    354372        /**
    355373         * @return the paramType
     
    359377        }
    360378
     379        @ParamAnnotation(id = "xtra")
     380        public ParamBuilder extra(Integer extra) {
     381                this.extra = extra;
     382                return this;
     383        }
     384
     385        @ParamAnnotation
    361386        public ParamBuilder min(Object min) {
    362387                this.min = min;
     
    364389        }
    365390
     391        @ParamAnnotation
    366392        public ParamBuilder max(Object max) {
    367393                this.max = max;
     
    369395        }
    370396
     397        @ParamAnnotation
    371398        public ParamBuilder def(Object def) {
    372399                this.def = def;
     
    374401        }
    375402
    376         // public Class<?> getStorageType() {
    377         //      assert param != null;
    378         //      return param.getStorageType();
    379         // }
    380403
    381404        public Param build(String line) throws Exception {
     
    435458        }
    436459
    437         public ParamBuilder defaultDef(Object def) {
     460        public ParamBuilder fillDef(Object def) {
    438461                if (this.def == null) {
    439462                        return def(def);
     
    442465        }
    443466
     467        public ParamBuilder fillStorageType(Class<?> storageType) {
     468                if (this.storageType == null) {
     469                        this.storageType = storageType;
     470                }
     471                return this;
     472        }
     473
     474
     475        public Class<?> getStorageType() {
     476                return storageType;
     477        }
    444478}
     479
Note: See TracChangeset for help on using the changeset viewer.