Ignore:
Timestamp:
07/12/13 23:41:06 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • add <include/> to configuration
  • add side notes to tree
    • used to store arbitrary information alongside the tree structure
  • migrate to log4j2
    • supports lazy string evaluation of passed arguments
  • improve GUI tree
    • it stays in synchronization with actual state (even in high load test scenario)
  • improve panel management in GUI
  • make loading objects in GUI more lazy
  • offload parsing to connection receiver thread
    • info parsing
    • first step of objects parsing
  • fix connection parsing bug (eof in long values)
  • support zero-arguments procedure in table view

CHANGELOG:
Implement procedure calls from table view.

Refactorization around procedures in tables.

Add table editor for buttons.

Render buttons in the the list view.

Further improve Columns.

Add Column class for TableModel?.

Accept also non-arguments ProcedureParams? in tableView.

Increase maximal TextAreaControl? size.

Add tooltip to ProcedureControl?.

Fix bug of interpreting eofs in long values by connection reader.

Further rework connection parsing.

Simplify client connection processing.

Test ListChange? modification.

Test ListChange? events with java server.

Add TestChild?.

Fix bug with fast deregistering when connecting to running server.

Another minor refactorization in TreeOperations?.

Fix bug in SimpleAbstractAccess? loading routine.

Another minor improvement.

Minor change.

Make reading of List objects two-phase.

Another minor change.

Dispatch parsing into receiver thread.

Another step.

Enclose passing value in ObjectParam? case in closure.

Minor step.

Minor change on way to offload parsing.

Temporarily comment out single ValueParam? get.

It will be generalized to multi ValueParam?.

Process info in receiver thread.

Add DispatchingExceptionHandler?.

Make waits in browser test longer.

Use FETCHED_MARK.

It is honored in GUI, where it used to decide whether to get values

after user action.

It is set in standard algorithm for processing fetched values.

Add remove operation to side notes.

Make loading more lazy.

Improve loading policy.

On node choose load itself, on node expansion, load children.

Minor improvement.

Fix bug with panel interleaving.

Minor improvements.

Improve panel management.

More cleaning around panels.

Reorganize panels.

Further improve tree.

Fix bug in TreeModel?.

Remove children from TreeNode?.

Implement TreeNode? hashCode and equals.

Make TreeNode? delegate equals and hashcode to internal reference.

Move listeners from TreeNode? to side notes.

Store path.textual as a side note.

Side note params instead of accesses for objects.

More refactorizations.

In TreeNode? bindAccess based on side notes.

Minor step.

Hide createAccess.

Rename AccessInterface? to Access.

Minor changes.

Several improvements in high load scenarios.

Change semantics of ArrayListAccess?.set(index, null);

It now removes the element, making list shorter
(it was set to null before).

Add path remove handler.

Handle exceptions in Connection.

Update .gitignore

Configure logging to file.

Move registration to TreeModel?.

Further refactorization.

Minor refactorization.

Minor improvements.

Use specialized event also for Modify action of ListChange?.

Use remove events.

Use the insertion events for tree.

Further improve tree refreshing.

Further improve reacting on events in GUI.

Fix problem with not adding objects on addition list change.

Migrate to log4j lazy String construction interface.

Migrate imports to log4j2.

Drop dependency on adapter to version 1.2.

Switch log4j implementation to log4j2.

Add dirty mark to the NodeAtFrame?.

Make selecting in AccessInterfaces? type safe.

Ignore containers size settings in Model and Genotype.

Use tree side notes to remember local changes and panels.

Add sideNotes to tree.

They will be used to store various accompanying information
right in the tree.

Use ReferenceIdentityMap? from apache in TreeNode?.

It suits the need perfectly (weak semantics on both key and value).

Make ArrayListParam? do not react size changes.

Guard in TableModel? before not yet loaded objects.

Add <include/> clause and AutoInjector?.

Extract common columns configuration to separate xml,
that can be included by other configurations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/communication/Connection.java

    r97 r100  
    88import com.framsticks.util.lang.Strings;
    99
    10 import org.apache.log4j.Level;
    11 import org.apache.log4j.Logger;
     10import org.apache.logging.log4j.Level;
     11import org.apache.logging.log4j.Logger;
     12import org.apache.logging.log4j.LogManager;
    1213import java.io.BufferedReader;
    1314import java.io.IOException;
     
    2223
    2324import com.framsticks.util.dispatching.AbstractJoinable;
     25import com.framsticks.util.dispatching.Dispatcher;
    2426import com.framsticks.util.dispatching.Dispatching;
     27import com.framsticks.util.dispatching.ExceptionResultHandler;
    2528import com.framsticks.util.dispatching.Joinable;
    2629import com.framsticks.util.dispatching.JoinableCollection;
     
    3235
    3336@FramsClassAnnotation
    34 public abstract class Connection extends AbstractJoinable implements JoinableParent {
    35 
    36         protected final static Logger log = Logger.getLogger(Connection.class);
     37public abstract class Connection extends AbstractJoinable implements JoinableParent, ExceptionResultHandler {
     38
     39        protected final static Logger log = LogManager.getLogger(Connection.class);
    3740
    3841        private PrintWriter output = null;
     
    4851        protected final JoinableCollection<Thread<Connection>> threads = new JoinableCollection<>();
    4952        protected final Set<ConnectionListener> listeners = new HashSet<>();
     53
     54        protected ExceptionResultHandler exceptionHandler = ThrowExceptionHandler.getInstance();
    5055
    5156        /**
     
    161166                        try {
    162167                                processNextInputBatch();
     168                        } catch (FramsticksException e) {
     169                                handle(e);
    163170                        } catch (Exception e) {
    164171                                log.log(isRunning() ? Level.ERROR : Level.DEBUG, "caught exception: ", e);
     
    183190        }
    184191
    185 
    186 
    187192        @Override
    188193        protected void joinableFinish() {
     
    197202                                input = null;
    198203                        }
    199 
    200204
    201205                        if (socket != null) {
     
    250254        }
    251255
    252 
    253256        @Override
    254257        protected void joinableJoin() throws InterruptedException {
     
    258261        protected static void startClientConnection(Connection connection) {
    259262                while (connection.isRunning() && !connection.isConnected()) {
    260                         log.debug("connecting to " + connection.address);
     263                        log.debug("connecting to {}", connection.address);
    261264                        try {
    262265                                connection.socket = new Socket(connection.getAddressObject().getHostName(), connection.getAddressObject().getPort());
    263266                        } catch (IOException e) {
    264                                 log.info(connection + " failed to connect (retrying): " + e);
     267                                log.info("{} failed to connect (retrying): ", connection, e);
    265268                                Dispatching.sleep(0.5);
    266269                        }
    267270                }
    268271
    269                 log.debug(connection + " connected");
     272                log.debug("{} connected", connection);
    270273                try {
    271274                        connection.socket.setSoTimeout(500);
     
    288291        }
    289292
    290 
    291293        /**
    292294         * @return the listeners
     
    294296        public Collection<ConnectionListener> getListeners() {
    295297                return listeners;
     298        }
     299
     300        /**
     301         * @return the handler
     302         */
     303        public ExceptionResultHandler getExceptionHandler() {
     304                return exceptionHandler;
     305        }
     306
     307        /**
     308         * @param handler the handler to set
     309         */
     310        public void setExceptionHandler(ExceptionResultHandler handler) {
     311                this.exceptionHandler = handler;
    296312        }
    297313
     
    301317        }
    302318
     319        @Override
     320        public void handle(FramsticksException exception) {
     321                exceptionHandler.handle(exception);
     322        }
     323
     324        public Dispatcher<Connection> getReceiverDispatcher() {
     325                return receiverThread;
     326        }
     327
     328        public Dispatcher<Connection> getSenderDispatcher() {
     329                return senderThread;
     330        }
     331
     332
    303333}
Note: See TracChangeset for help on using the changeset viewer.