Continued work on queue system. Soon threads may be started!
parent
273d132470
commit
5854e418bb
|
@ -5,5 +5,6 @@
|
|||
<classpathentry kind="lib" path="lib/commons-cli-1.2.jar" sourcepath="lib/commons-cli-1.2-sources.jar"/>
|
||||
<classpathentry kind="lib" path="lib/je-5.0.73.jar" sourcepath="lib"/>
|
||||
<classpathentry kind="lib" path="lib/js-14.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class DatabaseWriteEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class EmergeRequest extends MossEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MapChangeEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MossEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MossNetEventIn extends MossEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MossNetEventOut extends MossEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MossPlayerEvent extends MossEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public class MossScriptEvent extends MossEvent{
|
||||
|
||||
}
|
|
@ -1,15 +1,31 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
public final class ThreadManager {
|
||||
private static ThreadManager instance = null;
|
||||
static ThreadQueueManager queuemanager;
|
||||
private ThreadManager() {
|
||||
//A singleton to think about
|
||||
}
|
||||
public static ThreadManager getInstance() {
|
||||
if(instance == null) {
|
||||
instance = new ThreadManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
package org.nodetest.servercore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
|
||||
public final class ThreadManager {
|
||||
public static class ThreadQueueManager {
|
||||
HashMap<Script, PriorityBlockingQueue<MossScriptEvent>> scriptQueues;
|
||||
PriorityBlockingQueue<MossNetEventIn> netInQueue;
|
||||
PriorityBlockingQueue<MossNetEventOut> netOutQueue;
|
||||
PriorityBlockingQueue<MossPlayerEvent> playerEvtQueue;
|
||||
PriorityBlockingQueue<EmergeRequest> EmergeQueue;
|
||||
PriorityBlockingQueue<MapChangeEvent> MapWriteQueue;
|
||||
PriorityBlockingQueue<DatabaseWriteEvent> DBWriteQueue;//Underlying, slower queue for DB writes
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static ThreadManager instance = null;
|
||||
|
||||
private ThreadManager() {
|
||||
// A singleton to think about
|
||||
}
|
||||
|
||||
public static ThreadManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ThreadManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package org.nodetest.servercore;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ThreadQueueManager {
|
||||
HashMap<Script, ArrayBlockingQueue> ;
|
||||
}
|
Loading…
Reference in New Issue