- Timestamp:
- 06/30/13 12:48:20 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/hosting/ServerInstance.java
r87 r88 4 4 import com.framsticks.params.ConstructionException; 5 5 import com.framsticks.params.FramsClass; 6 import com.framsticks.params.Param;7 6 import com.framsticks.core.LocalInstance; 7 import com.framsticks.util.dispatching.Dispatching; 8 8 import com.framsticks.util.dispatching.Future; 9 import com.framsticks.util.dispatching.Joinable; 10 import com.framsticks.util.dispatching.JoinableParent; 11 import com.framsticks.util.dispatching.JoinableState; 9 12 10 import org.apache.commons.configuration.Configuration;11 13 import org.apache.log4j.Logger; 12 14 … … 14 16 * @author Piotr Sniegowski 15 17 */ 16 public class ServerInstance extends LocalInstance {18 public class ServerInstance extends LocalInstance implements JoinableParent { 17 19 18 20 private final static Logger log = Logger.getLogger(ServerInstance.class.getName()); … … 24 26 25 27 @Override 26 protected void run() {27 super. run();28 protected void firstTask() { 29 super.firstTask(); 28 30 assert hosted != null; 29 hosted.start();31 Dispatching.use(hosted, this); 30 32 } 31 33 32 @Override33 public void configure(Configuration config) {34 super.configure(config);34 // @Override 35 // public void configure(Configuration config) { 36 // super.configure(config); 35 37 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 // } 46 48 47 49 @Override … … 93 95 } 94 96 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 95 113 }
Note: See TracChangeset
for help on using the changeset viewer.