Ignore:
Timestamp:
06/26/13 13:27:31 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/hosting/ServerInstance.java

    r85 r86  
    33import com.framsticks.core.*;
    44import com.framsticks.params.CompositeParam;
     5import com.framsticks.params.ConstructionException;
    56import com.framsticks.params.FramsClass;
     7import com.framsticks.params.FramsClassBuilder;
    68import com.framsticks.params.Param;
    79import com.framsticks.core.LocalInstance;
     
    4244                hosted.setName("hosted");
    4345                hosted.configure(hostedConfig);
    44                 root = new Node((CompositeParam)Param.build().name("root").id("root").type("o" + hosted.getClass().getCanonicalName()).finish(), hosted);
     46                root = new Node((CompositeParam) Param.build().name("root").id("root").type("o" + hosted.getClass().getCanonicalName()).finish(), hosted);
    4547        }
    4648
     
    5759                try {
    5860                        Class<?> nativeClass = Class.forName(id);
    59                         FramsClass framsClass = new FramsClass.Constructor(nativeClass, id).getResult();
     61                        FramsClass framsClass = FramsClassBuilder.buildForClass(nativeClass);
     62
     63                        if (!framsClass.getId().equals(id)) {
     64                                log.error("no matching id");
     65                                return null;
     66                        }
    6067
    6168                        registry.registerReflectedClass(null, id, nativeClass);
     
    6370                        return framsClass;
    6471                } catch (ClassNotFoundException ignored) {
     72                } catch (ConstructionException e) {
     73                        log.error("failed to use info from cache: " + e);
    6574                }
    6675
Note: See TracChangeset for help on using the changeset viewer.