Ignore:
Timestamp:
07/06/13 03:51:11 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add proper exception passing between communication sides:

if exception occur during handling client request, it is
automatically passed as comment to error response.

it may be used to snoop communication between peers

  • fix algorithm choosing text controls in GUI
  • allow GUI testing in virtual frame buffer (xvfb)

FEST had some problem with xvfb but workaround was found

supports tab-completion based on requests history

CHANGELOG:
Further improve handling of exceptions in GUI.

Add StatusBar? implementing ExceptionResultHandler?.

Make completion processing asynchronous.

Minor changes.

Improve completion in console.

Improve history in InteractiveConsole?.

First working version of DirectConsole?.

Minor changes.

Make Connection.address non final.

It is more suitable to use in configuration.

Improvement of consoles.

Improve PopupMenu? and closing of FrameJoinable?.

Fix BrowserTest?.

Found bug with FEST running under xvfb.

JButtonFixture.click() is not working under xvfb.
GuiTest? has wrapper which uses JButton.doClick() directly.

Store CompositeParam? param in TreeNode?.

Simplify ClientSideManagedConnection? connecting.

There is now connectedFunctor needed, ApplicationRequests? can be
send right after creation. They are buffered until the version
and features are negotiated.

Narow down interface of ClientSideManagedConnection?.

Allow that connection specialization send only
ApplicationRequests?.

Improve policy of text control choosing.

Change name of Genotype in BrowserTest?.

Make BrowserTest? change name of Genotype.

Minor change.

First working draft of TrackConsole?.

Simplify Consoles.

More improvements with gui joinables.

Unify initialization on gui joinables.

More rework of Frame based entities.

Refactorize structure of JFrames based entities.

Extract GuiTest? from BrowserBaseTest?.

Reorganize Console classes structure.

Add Collection view to JoinableCollection?.

Configure timeout in testing.

Minor changes.

Rework connections hierarchy.

Add Mode to the get operation.

Make get and set in Tree take PrimitiveParam?.

Unify naming of operations.

Make RunAt? use the given ExceptionHandler?.

It wraps the virtual runAt() method call with
try-catch passing exception to handler.

Force RunAt? to include ExceptionHandler?.

Improve ClientAtServer?.

Minor change.

Another sweep with FindBugs?.

Rename Instance to Tree.

Minor changes.

Minor changes.

Further clarify semantics of Futures.

Add FutureHandler?.

FutureHandler? is refinement of Future, that proxifies
exception handling to ExceptionResultHandler? given
at construction time.

Remove StateFunctor? (use Future<Void> instead).

Make Connection use Future<Void>.

Unparametrize *ResponseFuture?.

Remove StateCallback? not needed anymore.

Distinguish between sides of ResponseFuture?.

Base ResponseCallback? on Future (now ResponseFuture?).

Make asynchronous store taking Future for flags.

Implement storeValue in ObjectInstance?.

File:
1 edited

Legend:

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

    r96 r97  
    11package com.framsticks.remote;
    22
    3 import static com.framsticks.core.InstanceUtils.*;
     3import static com.framsticks.core.TreeOperations.*;
     4
     5import com.framsticks.core.Mode;
    46import com.framsticks.core.Node;
    57import com.framsticks.core.Path;
     
    79import com.framsticks.params.CompositeParam;
    810import com.framsticks.params.FramsClass;
    9 import com.framsticks.core.Instance;
     11import com.framsticks.core.Tree;
    1012import com.framsticks.util.dispatching.Future;
     13import com.framsticks.util.dispatching.FutureHandler;
     14import com.framsticks.util.dispatching.ThrowExceptionHandler;
    1115import com.framsticks.util.FramsticksException;
    1216import com.framsticks.util.Logging;
    13 import com.framsticks.util.StateFunctor;
    1417import com.framsticks.util.Stopwatch;
    1518import org.apache.log4j.Logger;
     
    2427        private final static Logger log = Logger.getLogger(RecursiveFetcher.class.getName());
    2528
    26         protected final Instance instance;
    27         protected final StateFunctor stateFunctor;
     29        protected final Tree tree;
     30        protected final Future<Void> future;
    2831        protected int dispatched;
    2932        protected final Stopwatch stopwatch = new Stopwatch();
    3033
    31         public RecursiveFetcher(Instance instance, final Path path, StateFunctor stateFunctor) {
    32                 this.instance = instance;
    33                 this.stateFunctor = stateFunctor;
     34        public RecursiveFetcher(Tree tree, final Path path, Future<Void> future) {
     35                this.tree = tree;
     36                this.future = future;
    3437                dispatched = 1;
    3538                process(path);
     
    3740
    3841        protected void finished() {
    39                 assert instance.isActive();
     42                assert tree.isActive();
    4043                log.info("recursively fetched in " + stopwatch);
    41                 stateFunctor.call();
     44                future.pass(null);
    4245        }
    4346
    4447        protected void process(final Path path) {
    45                 assert instance.isActive();
     48                assert tree.isActive();
    4649                if (path == null || !path.isResolved()) {
    4750                        log.warn("path " + path + " is not resolved - skipping");
     
    5558                                if (childPath.isResolved() && getInfoFromCache(childPath) != null) {
    5659                                        ++dispatched;
    57                                         instance.dispatch(new RunAt<Instance>() {
     60                                        tree.dispatch(new RunAt<Tree>(ThrowExceptionHandler.getInstance()) {
    5861                                                @Override
    59                                                 public void run() {
     62                                                protected void runAt() {
    6063                                                        fetch(childPath);
    6164                                                }
     
    6467                                }
    6568                                ++dispatched;
    66                                 instance.resolve(childPath, new Future<Path>(Logging.logger(log, "resolve", RecursiveFetcher.this)) {
     69                                tree.resolve(childPath, new FutureHandler<Path>(Logging.logger(log, "resolve", RecursiveFetcher.this)) {
    6770                                        @Override
    6871                                        protected void result(Path result) {
    69                                                 assert instance.isActive();
     72                                                assert tree.isActive();
    7073                                                fetch(result);
    7174                                        }
     
    8083
    8184        protected void fetch(final Path path) {
    82                 instance.fetchValues(path, new StateFunctor() {
     85                tree.get(path, Mode.FETCH, new Future<Object>() {
     86
    8387                        @Override
    8488                        public void handle(FramsticksException e) {
     
    8892
    8993                        @Override
    90                         public void call() {
     94                        protected void result(Object object) {
    9195                                process(path);
    9296                        }
Note: See TracChangeset for help on using the changeset viewer.