|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.clustering.ClusterManager
public abstract class ClusterManager
ClusterManager is a thread object that reads the receive queue and calls the objects (listeners) who need to know. The ClusterManager starts communication threads to handle the sending and receiving of messages.
| Field Summary | |
|---|---|
protected boolean |
compatible17
|
protected int |
follownr
Followup number of message |
protected Thread |
kicker
Thread which processes the messages |
protected int |
lastReceivedMessage
|
protected BlockingQueue<byte[]> |
nodesToSend
Queue with messages to send to other MMBase instances |
protected BlockingQueue<byte[]> |
nodesToSpawn
Queue with received messages from other MMBase instances |
protected Statistics |
receive
|
protected Statistics |
send
|
protected boolean |
spawnThreads
|
| Constructor Summary | |
|---|---|
ClusterManager()
|
|
| Method Summary | |
|---|---|
protected byte[] |
createMessage(Event event)
Format of a message: [<17 style message>],0 |
protected String |
createMessage(String machine,
int nodenr,
String tableName,
String type)
Creates MMBase 1.7 parseable message. |
protected void |
handleEvent(Event event)
|
void |
notify(Event event)
|
protected Event |
parseMessage(byte[] message)
|
protected NodeEvent |
parseMessageBackwardCompatible(String message)
|
protected void |
readConfiguration(Map<String,String> configuration)
|
void |
run()
|
void |
shutdown()
|
protected void |
start()
Starts the Changer Thread. |
protected abstract void |
startCommunicationThreads()
Subclasses should start the communication threads in this method |
protected abstract void |
stopCommunicationThreads()
Subclasses should stop the communication threads in this method |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Statistics receive
protected final Statistics send
protected final BlockingQueue<byte[]> nodesToSend
protected final BlockingQueue<byte[]> nodesToSpawn
protected Thread kicker
protected boolean spawnThreads
protected boolean compatible17
protected int follownr
protected int lastReceivedMessage
| Constructor Detail |
|---|
public ClusterManager()
| Method Detail |
|---|
public final void shutdown()
protected void readConfiguration(Map<String,String> configuration)
protected abstract void startCommunicationThreads()
protected abstract void stopCommunicationThreads()
public void notify(Event event)
notify in interface AllEventListenerprotected void start()
protected byte[] createMessage(Event event)
protected String createMessage(String machine,
int nodenr,
String tableName,
String type)
machine - MMBase 'machine name'.nodenr - node numbertableName - node type (tablename)type - command type
protected Event parseMessage(byte[] message)
protected NodeEvent parseMessageBackwardCompatible(String message)
public void run()
run in interface RunnableRunnable.run()protected void handleEvent(Event event)
event -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||