|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.server.BasicComponent
tigase.server.AbstractMessageReceiver
tigase.server.MessageRouter
public class MessageRouter
Class MessageRouter Created: Tue Nov 22 07:07:11 2005
| Field Summary |
|---|
| Fields inherited from class tigase.server.AbstractMessageReceiver |
|---|
HOUR, INCOMING_FILTERS_PROP_KEY, INCOMING_FILTERS_PROP_VAL, MAX_QUEUE_SIZE_PROP_KEY, MAX_QUEUE_SIZE_PROP_VAL, maxInQueueSize, maxOutQueueSize, MINUTE, OUTGOING_FILTERS_PROP_KEY, OUTGOING_FILTERS_PROP_VAL, SECOND |
| Fields inherited from class tigase.server.BasicComponent |
|---|
admins, ALL_PROP_KEY, COMMAND_PROP_NODE, scriptCommands, SCRIPTS_DIR_PROP_DEF, SCRIPTS_DIR_PROP_KEY, vHostManager |
| Fields inherited from interface tigase.disco.XMPPService |
|---|
CMD_FEATURES, DEF_FEATURES, INFO_XMLNS, ITEMS_XMLNS |
| Constructor Summary | |
|---|---|
MessageRouter()
|
|
| Method Summary | |
|---|---|
void |
addComponent(ServerComponent component)
Method description |
void |
addRegistrator(ComponentRegistrator registr)
Method description |
void |
addRouter(MessageReceiver receiver)
Method description |
Map<String,Object> |
getDefaults(Map<String,Object> params)
Method description |
tigase.xml.Element |
getDiscoInfo(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
Method description |
protected Integer |
getMaxQueueSize(int def)
|
void |
getStatistics(StatisticsList list)
Method description |
int |
hashCodeForPacket(Packet packet)
This method decides how incoming packets are distributed among processing threads. |
int |
processingInThreads()
Method description |
int |
processingOutThreads()
Method description |
void |
processPacket(Packet packet)
Method description |
void |
processPacketMR(Packet packet,
Queue<Packet> results)
Method description |
void |
setConfig(ConfiguratorAbstract config)
Method description |
void |
setProperties(Map<String,Object> props)
Method description |
| Methods inherited from class tigase.server.AbstractMessageReceiver |
|---|
addOutPacket, addOutPacketNB, addOutPackets, addOutPacketWithTimeout, addPacket, addPacketNB, addPackets, addRegexRouting, addTimerTask, addTimerTask, clearRegexRoutings, everyHour, everyMinute, everySecond, getRegexRoutings, isInRegexRoutings, newPacketId, processingThreads, processOutPacket, processPacket, release, removeRegexRouting, setMaxQueueSize, setName, setParent, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface tigase.server.MessageRouterIfc |
|---|
start |
| Methods inherited from interface tigase.server.ServerComponent |
|---|
getComponentId, getName, initializationCompleted, processPacket, release, setName |
| Methods inherited from interface tigase.server.MessageReceiver |
|---|
getDefHostName |
| Constructor Detail |
|---|
public MessageRouter()
| Method Detail |
|---|
public void addComponent(ServerComponent component)
component - public void addRegistrator(ComponentRegistrator registr)
registr - public void addRouter(MessageReceiver receiver)
receiver - public Map<String,Object> getDefaults(Map<String,Object> params)
getDefaults in interface ConfigurablegetDefaults in class AbstractMessageReceiverparams -
public tigase.xml.Element getDiscoInfo(String node,
tigase.xmpp.JID jid,
tigase.xmpp.JID from)
getDiscoInfo in interface XMPPServicegetDiscoInfo in class BasicComponentnode - jid - from -
public void getStatistics(StatisticsList list)
getStatistics in interface StatisticsContainergetStatistics in class AbstractMessageReceiverlist - public void processPacket(Packet packet)
processPacket in class AbstractMessageReceiverpacket -
public void processPacketMR(Packet packet,
Queue<Packet> results)
packet - results - public int processingInThreads()
processingInThreads in class AbstractMessageReceiverpublic int processingOutThreads()
processingOutThreads in class AbstractMessageReceiverpublic void setConfig(ConfiguratorAbstract config)
setConfig in interface MessageRouterIfcconfig - public void setProperties(Map<String,Object> props)
setProperties in interface ConfigurablesetProperties in class AbstractMessageReceiverprops - protected Integer getMaxQueueSize(int def)
getMaxQueueSize in class AbstractMessageReceiverpublic int hashCodeForPacket(Packet packet)
AbstractMessageReceiverint threadNo = Math.abs(hashCodeForPacket(packet) % N);For a PubSub component, for example, a better packets distribution would be based on the PubSub channel name, for SM a better distribution is based on the destination address, etc....
hashCodeForPacket in class AbstractMessageReceiverpacket - is a Packet which needs to be processed by some
thread.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||