Ignore:
Timestamp:
06/24/13 13:38:40 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • upgrade to Java 7
    • use try-multi-catch clauses
    • use try-with-resources were appropriate
  • configure FindBugs? (use mvn site and then navigate in browser to the report)
    • remove most bugs found
  • parametrize Dispatching environment (Dispatcher, RunAt?) to enforce more control on the place of closures actual call

CHANGELOG:
Rework FavouritesXMLFactory.

FindBugs?. Thread start.

FindBugs?. Minor change.

FindBugs?. Iterate over entrySet.

FindBugs?. Various.

FindBug?.

FindBug?. Encoding.

FindBug?. Final fields.

FindBug?.

Remove synchronization bug in ClientConnection?.

Experiments with findbugs.

Finish parametrization.

Make RunAt? an abstract class.

More changes in parametrization.

More changes in parametrizing dispatching.

Several changes to parametrize tasks.

Rename Runnable to RunAt?.

Add specific framsticks Runnable.

Add JSR305 (annotations).

Add findbugs reporting.

More improvements to ParamBuilder? wording.

Make FramsClass? accept also ParamBuilder?.

Change wording of ParamBuilder?.

Change wording of Request creation.

Use Java 7 exception catch syntax.

Add ScopeEnd? class.

Upgrade to Java 7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/core/Entity.java

    r84 r85  
    11package com.framsticks.core;
     2
     3import javax.annotation.OverridingMethodsMustInvokeSuper;
    24
    35import com.framsticks.params.FramsClass;
     
    79import org.apache.commons.configuration.Configuration;
    810import org.apache.log4j.Logger;
     11import com.framsticks.util.dispatching.RunAt;
    912
    1013/**
    1114 * @author Piotr Sniegowski
    1215 */
    13 public abstract class Entity implements Dispatcher {
     16public abstract class Entity implements Dispatcher<Entity> {
    1417
    1518        private final static Logger log = Logger.getLogger(Entity.class.getName());
     
    1720        protected String name = "entity";
    1821        protected EntityOwner owner;
    19         protected Dispatcher dispatcher;
     22        protected Dispatcher<Entity> dispatcher;
    2023
    2124        public Entity() {
     
    3235                this.name = name;
    3336                if (dispatcher instanceof Thread) {
    34                         ((Thread) dispatcher).setName(name);
     37                        ((Thread<Entity>) dispatcher).setName(name);
    3538                }
    3639        }
     
    5659
    5760        @Override
    58         public final void invokeLater(Runnable runnable) {
     61        public final void invokeLater(RunAt<? extends Entity> runnable) {
    5962                assert dispatcher != null;
    6063                dispatcher.invokeLater(runnable);
    6164        }
    6265
    63         public Dispatcher createDefaultDispatcher() {
    64                 return new Thread(name);
     66        public Dispatcher<Entity> createDefaultDispatcher() {
     67                return new Thread<Entity>(name).start();
    6568        }
    6669
     70        @OverridingMethodsMustInvokeSuper
    6771        protected void run() {
    6872                assert isActive();
     
    7478        }
    7579
    76         public Dispatcher getDispatcher() {
     80        public Dispatcher<Entity> getDispatcher() {
    7781                return dispatcher;
    7882        }
     
    8185         * @param dispatcher the dispatcher to set
    8286         */
    83         public void setDispatcher(Dispatcher dispatcher) {
     87        public void setDispatcher(Dispatcher<Entity> dispatcher) {
    8488                this.dispatcher = dispatcher;
    8589        }
     
    9094                        setDispatcher(createDefaultDispatcher());
    9195                }
    92                 invokeLater(new Runnable() {
     96                invokeLater(new RunAt<Entity>() {
    9397                        @Override
    9498                        public void run() {
Note: See TracChangeset for help on using the changeset viewer.