Ignore:
Timestamp:
07/18/13 23:52:25 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add auto loading and saving algorithms between

frams files format and Java classes

  • respect ValueChange? events in GUI (do not reload object)
  • support results of procedures in Java server
  • make Experiment automatically convert between frams file and NetFile? object
  • add MessageLogger? (compatible with original frams server messages)
  • WorkPackageLogic? now validates results, is able to discard them, reschedule

whole package, or only uncomputed remainder

CHANGELOG:
Show just a short description in PrimeExperiment?.

Add primes_changed event to the PrimeExperiment?.

Make WorkPackageLogic? robust to frams server returning invalid results.

Add MessageLogger? to logics.

Add NetFile? interface. Support Messages from server.

Minor changes to connections.

Merge results in the PrimeExperiment?.

More netload class->file conversion to Simulator.

Move netsave parsing to Simulator.

Fix bug with inverted ordering of events firing in Experiment.

Minor changes.

Minor logging changes.

Use AccessOperations?.convert in NetLoadSaveLogic?

NetLoadSaveLogic? now encloses the conversion.

Use more generic AccessOperations? saveAll and loadAll in PrimePackage?.

Add Result class for enclosing of call invocations' results.

Improve feature request handling in Connections.

Use AccessOperations?.convert in RemoteTree? events parsing.

Minor change.

Add some information params to Java server root and CLI objects.

A draft implementation of loadAll algorithm.

That algorithm tries to load objects into a tree structure.

Add AccessOperationsTest? test.

Develop WorkPackageLogic?.

  • add state tracking fields
  • add work package generation

Add utility class SimplePrimitive?.

Meant for Java backend classes, enclose a single primitive value
and set of listeners.

Improve primitive value refresh in GUI.

When ValueChange? found in called event, do not reload whole
object, but only update GUI (no communication is performed).

Use ValueChange? in the TestClass? test.

Minor changes.

Sending all packages in PrimeExperiment? to the frams servers.

Develop AccessOperations?.loadComposites().

Remove addAccess from MultiParamLoader? interface.

There is now no default AccessProvider? in MultiParamLoader?.
User must explicitely set AccessStash? or Registry.

Improve saving algorithms in AccessOperations?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/remote/RemoteTree.java

    r102 r103  
    1717import com.framsticks.params.types.ProcedureParam;
    1818import com.framsticks.parsers.Loaders;
    19 import com.framsticks.parsers.MultiParamLoader;
    2019import com.framsticks.util.*;
    2120import com.framsticks.util.dispatching.AtOnceDispatcher;
     
    2928import com.framsticks.util.dispatching.JoinableState;
    3029import com.framsticks.util.dispatching.ThrowExceptionHandler;
    31 import com.framsticks.util.lang.Casting;
    3230import com.framsticks.util.dispatching.RunAt;
    3331import static com.framsticks.core.TreeOperations.*;
     
    269267
    270268        @Override
    271         public void call(@Nonnull final Path path, @Nonnull final ProcedureParam procedure, @Nonnull Object[] arguments, final Future<Object> future) {
     269        public <R> void call(@Nonnull final Path path, @Nonnull final ProcedureParam procedure, @Nonnull Object[] arguments, final Class<R> resultType, final Future<R> future) {
    272270                assert isActive();
    273271                assert path.isResolved();
     
    278276                        protected void processOk(Response response) {
    279277                                assert isActive();
    280                                 // InstanceUtils.processFetchedValues(path, response.getFiles());
    281                                 future.pass(null);
     278
     279                                if (response.getFiles().size() == 0) {
     280                                        future.pass(null);
     281                                        return;
     282                                }
     283                                if (response.getFiles().size() == 1) {
     284                                        future.pass(AccessOperations.convert(resultType, response.getFiles().get(0), registry));
     285                                        return;
     286                                }
     287                                throw new FramsticksUnsupportedOperationException().msg("call result with multiple files");
     288
    282289                        }
    283290                });
     
    303310                                        protected void runAt() {
    304311                                                assert isActive();
    305                                                 if (argumentType.equals(File.class)) {
    306                                                         listener.action(Casting.tryCast(argumentType, file));
    307                                                         return;
    308                                                 }
    309                                                 // Access access = registry.createAccess(argumentType);
    310 
    311                                                 // log.info("executing event with argument {}", argumentType);
    312                                                 MultiParamLoader loader = new MultiParamLoader();
    313                                                 loader.setNewSource(file.getContent());
    314                                                 loader.addBreakCondition(MultiParamLoader.Status.AfterObject);
    315                                                 loader.setAccessProvider(registry);
    316                                                 // loader.addAccess(access);
    317                                                 loader.go();
    318                                                 Object argument = loader.getLastAccess().getSelected();
    319                                                 // Object argument = access.getSelected();
    320                                                 if (argument == null) {
    321                                                         listener.action(null);
    322                                                 }
    323                                                 if (!argumentType.isInstance(argument)) {
    324                                                         throw new FramsticksException().msg("created argument is of wrong type").arg("expected", argumentType).arg("created", argument.getClass());
    325                                                 }
    326                                                 listener.action(argumentType.cast(argument));
     312
     313                                                listener.action(AccessOperations.convert(argumentType, file, registry));
    327314                                        }
    328315                                });
Note: See TracChangeset for help on using the changeset viewer.