Ignore:
Timestamp:
06/30/13 12:48:20 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • loading f0 schema with XmlLoader?
  • use XmlLoader? to load configuration
  • introduce unified fork-join model of various entities

(Instances, Connections, GUI Frames, etc.),
all those entities clean up gracefully on
shutdown, which may be initialized by user
or by some entity

  • basing on above, simplify several organizing classes

(Observer, main class)

(to host native frams server process from Java level)

CHANGELOG:
Remove redundant Observer class.

Clean up in AbstractJoinable?.

Update ExternalProcess? class to changes in joining model.

Another sweep through code with FindBugs?.

Find bug with not joining RemoteInstance?.

Joining almost works.

Much improved joining model.

More improvement to joining model.

Add logging messages around joinable operations.

Rename methods in AbstractJoinable?.

Improve Joinable.

Rewrite of entity structure.

More simplifications with entities.

Further improve joinables.

Let Frame compose from JFrame instead of inheriting.

Add join classes.

Improvements of closing.

Add Builder interface.

Add FramsServerTest?.xml

FramsServer? may be configured through xml.

Make Framsticks main class an Observer of Entities.

Make Observer a generic type.

Remove variables regarding to removed endpoint.

Simplify observer (remove endpoints).

More changes to Observer and Endpoint.

Minor improvements.

Add OutputListener? to ExternalProcess?.

Improve testing of ExternalProcess?.

Add ExternalProcess? runner.

Rename the Program class to Framsticks.

Migrate Program to use XmlLoader? configuration.

First steps with configuration using XmlLoader?.

Fix several bugs.

Move all f0 classes to apriopriate package.

XmlLoader? is able to load Schema.

XmlLoader? is loading classes and props.

Add GroupBuilder?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/hosting/ServerInstance.java

    r87 r88  
    44import com.framsticks.params.ConstructionException;
    55import com.framsticks.params.FramsClass;
    6 import com.framsticks.params.Param;
    76import com.framsticks.core.LocalInstance;
     7import com.framsticks.util.dispatching.Dispatching;
    88import com.framsticks.util.dispatching.Future;
     9import com.framsticks.util.dispatching.Joinable;
     10import com.framsticks.util.dispatching.JoinableParent;
     11import com.framsticks.util.dispatching.JoinableState;
    912
    10 import org.apache.commons.configuration.Configuration;
    1113import org.apache.log4j.Logger;
    1214
     
    1416 * @author Piotr Sniegowski
    1517 */
    16 public class ServerInstance extends LocalInstance {
     18public class ServerInstance extends LocalInstance implements JoinableParent {
    1719
    1820        private final static Logger log = Logger.getLogger(ServerInstance.class.getName());
     
    2426
    2527        @Override
    26         protected void run() {
    27                 super.run();
     28        protected void firstTask() {
     29                super.firstTask();
    2830                assert hosted != null;
    29                 hosted.start();
     31                Dispatching.use(hosted, this);
    3032        }
    3133
    32         @Override
    33         public void configure(Configuration config) {
    34                 super.configure(config);
     34        // @Override
     35        // public void configure(Configuration config) {
     36        //      super.configure(config);
    3537
    36                 Configuration hostedConfig = config.subset("hosted.entity");
    37                 hosted = Program.configureEntity(hostedConfig);
    38                 if (hosted == null) {
    39                         log.fatal("failed to create hosted entity");
    40                         return;
    41                 }
    42                 hosted.setName("hosted");
    43                 hosted.configure(hostedConfig);
    44                 root = new Node(Param.build().name("root").id("root").type("o" + hosted.getClass().getCanonicalName()), hosted);
    45         }
     38        //      Configuration hostedConfig = config.subset("hosted.entity");
     39        //      hosted = Program.configureEntity(hostedConfig);
     40        //      if (hosted == null) {
     41        //              log.fatal("failed to create hosted entity");
     42        //              return;
     43        //      }
     44        //      hosted.setName("hosted");
     45        //      hosted.configure(hostedConfig);
     46        //      root = new Node(Param.build().name("root").id("root").type("o" + hosted.getClass().getCanonicalName()), hosted);
     47        // }
    4648
    4749        @Override
     
    9395        }
    9496
     97        @Override
     98        public void childChangedState(Joinable joinable, JoinableState state) {
     99                proceedToState(state);
     100
     101        }
     102
     103        @Override
     104        protected void joinableInterrupt() {
     105                Dispatching.drop(hosted, this);
     106        }
     107
     108        @Override
     109        protected void joinableFinish() {
     110
     111        }
     112
    95113}
Note: See TracChangeset for help on using the changeset viewer.