|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.util.EndpointServiceStatsFilter
public class EndpointServiceStatsFilter
Instances of this clas can be registered with an EndpointService to gather statistics about what kind of messages pass through it.
This class is not MT-safe, so make sure you plug it only into one endpoint service.
EndpointService.addIncomingMessageFilterListener(net.jxta.endpoint.MessageFilterListener, java.lang.String, java.lang.String)
Field Summary | |
---|---|
(package private) Hashtable |
channelTrafficTable
|
(package private) Hashtable |
destCountTable
|
(package private) long |
lastMessageTime
|
(package private) Hashtable |
sourceCountTable
|
Constructor Summary | |
---|---|
EndpointServiceStatsFilter()
|
Method Summary | |
---|---|
Message |
filterMessage(Message msg,
EndpointAddress source,
EndpointAddress dest)
This method is called by the EndpointService to give us a chance to look at the message before it is dispatched to any listeners. |
Enumeration |
getChannelNames()
|
long |
getLastMessageTime()
Get the time we last saw a message. |
long |
getMessageCountFrom(EndpointAddress addr)
Get the number of messages received from a given address. |
long |
getMessageCountTo(EndpointAddress addr)
Get the number of messages we've seen that were adderssed to a given address. |
long |
getTrafficOnChannel(String channel)
Get the number of messages seen with a given message element namespace or full message element name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
long lastMessageTime
Hashtable channelTrafficTable
Hashtable sourceCountTable
Hashtable destCountTable
Constructor Detail |
---|
public EndpointServiceStatsFilter()
Method Detail |
---|
public Message filterMessage(Message msg, EndpointAddress source, EndpointAddress dest)
filterMessage
in interface MessageFilterListener
msg
- Incoming messagesource
- Endpoint Address of the original source of the messagedest
- Endpoint Address of the original destination of the message
public long getLastMessageTime()
public long getTrafficOnChannel(String channel)
public Enumeration getChannelNames()
public long getMessageCountFrom(EndpointAddress addr)
public long getMessageCountTo(EndpointAddress addr)
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |