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/communication/Subscription.java

    r96 r97  
    44
    55import com.framsticks.communication.queries.RegistrationRequest;
     6import com.framsticks.util.dispatching.AtOnceDispatcher;
    67import com.framsticks.util.dispatching.Dispatcher;
    78import com.framsticks.util.dispatching.Dispatching;
    89import com.framsticks.util.dispatching.RunAt;
    9 import com.framsticks.util.FramsticksException;
    10 import com.framsticks.util.StateFunctor;
     10import com.framsticks.util.dispatching.ThrowExceptionHandler;
     11
    1112import org.apache.log4j.Logger;
    1213
     
    1920        private final static Logger log = Logger.getLogger(Subscription.class);
    2021
    21         private final ClientConnection connection;
     22        private final ClientSideManagedConnection connection;
    2223        private final String path;
    2324        private final String registeredPath;
     
    2627        private EventCallback eventCallback;
    2728
    28         public Subscription(ClientConnection connection, String path, String registeredPath, Dispatcher<C> dispatcher) {
     29        public Subscription(ClientSideManagedConnection connection, String path, String registeredPath, Dispatcher<C> dispatcher) {
    2930                this.connection = connection;
    3031                this.path = path;
     
    4647        }
    4748
    48         public void unsubscribe(final StateFunctor stateFunctor) {
     49        public void unsubscribe(final ClientSideResponseFuture future) {
    4950                //@todo remove that /cli/ prefix, when registeredPath will be a fully qualified path
    50                 connection.send(new RegistrationRequest().register(false).path(registeredPath), new ResponseCallback<Connection>() {
     51                connection.send(new RegistrationRequest().register(false).path(registeredPath), AtOnceDispatcher.getInstance(), new ClientSideResponseFuture(future) {
     52
    5153                        @Override
    52                         public void process(Response response) {
    53                                 if (!response.getOk()) {
    54                                         log.error("failed to unsunscribe " + this + ": " + response.getComment());
    55                                         stateFunctor.handle(new FramsticksException().msg("unsubscription failed").arg("comment", response.getComment()));
    56                                         return;
    57                                 }
     54                        protected void processOk(Response response) {
    5855                                assert response.hasFiles();
    5956                                log.debug("unsunscribed " + this);
    60                                 stateFunctor.call();
     57                                future.pass(response);
    6158                        }
    6259                });
     
    7673
    7774        public void dispatchCall(final List<File> files) {
    78                 Dispatching.dispatchIfNotActive(dispatcher, new RunAt<C>() {
     75                //TODO TEH
     76                Dispatching.dispatchIfNotActive(dispatcher, new RunAt<C>(ThrowExceptionHandler.getInstance()) {
    7977                        @Override
    80                         public void run() {
     78                        protected void runAt() {
    8179                                eventCallback.call(files);
    8280                        }
Note: See TracChangeset for help on using the changeset viewer.