|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable jap.forward.JAPRoutingServerStatisticsListener
public class JAPRoutingServerStatisticsListener
This class is the implementation for the forwarding server statistics update. Every class interested in the forwarding server statistics should add itself to the observers of this class. It gets an update message with JAPRoutingMessage.SERVER_STATISTICS_UPDATED, every time some values might have changed. So it can ask for the instance of this class for the new values. This class is also available, if the server is not running (but fetching of new statistics is only done, when the forwarding server is running).
Field Summary | |
---|---|
private int |
m_acceptedConnections
Stores the number of accepted connections. |
private int |
m_currentBandwidthUsage
Stores the current bandwidth usage in bytes/sec. |
private int |
m_currentlyForwardedConnections
Stores the number of currently forwarded connections. |
private ForwardSchedulerStatistics |
m_currentStatisticsInstance
Stores the current statistics instance from where we obtain the data. |
private int |
m_rejectedConnections
Stores the number of rejected connections. |
private java.lang.Thread |
m_statisticsThread
Stores the current instance of the statistics fetching thread (if we are in server mode). |
private long |
m_transferedBytes
Stores the number of transfered bytes. |
private static long |
SERVER_STATISTICS_UPDATE_INTERVAL
This is the update interval for the server statistics panel in milliseconds. |
Constructor Summary | |
---|---|
JAPRoutingServerStatisticsListener()
Creates a new instance of JAPForwardingServerStatisticsListener. |
Method Summary | |
---|---|
int |
getAcceptedConnections()
Returns the number of accepted connections. |
int |
getCurrentBandwidthUsage()
Returns the current bandwidth usage. |
int |
getCurrentlyForwardedConnections()
Returns the number of currently forwarded connections. |
int |
getRejectedConnections()
Returns the number of rejected connections. |
long |
getTransferedBytes()
Returns the total number of transfered bytes in the current forwarding server session. |
void |
run()
This is the implementation of the forwarding server statistics fetch thread. |
private void |
startStatistics()
This starts fetching the statistics from the forwarding server. |
private void |
stopStatistics()
This stops the fetch thread of the forwarding server statistics. |
void |
update(java.util.Observable a_notifier,
java.lang.Object a_message)
This is the observer implementation. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long SERVER_STATISTICS_UPDATE_INTERVAL
private int m_rejectedConnections
private int m_acceptedConnections
private int m_currentlyForwardedConnections
private long m_transferedBytes
private int m_currentBandwidthUsage
private ForwardSchedulerStatistics m_currentStatisticsInstance
private java.lang.Thread m_statisticsThread
Constructor Detail |
---|
public JAPRoutingServerStatisticsListener()
Method Detail |
---|
public int getRejectedConnections()
public int getAcceptedConnections()
public int getCurrentlyForwardedConnections()
public int getCurrentBandwidthUsage()
public long getTransferedBytes()
public void update(java.util.Observable a_notifier, java.lang.Object a_message)
update
in interface java.util.Observer
a_notifier
- The observed Object. This should always be JAPRoutingSettings at the moment.a_message
- The reason of the notification. This should always be a JAPRoutingMessage
at the moment.public void run()
run
in interface java.lang.Runnable
private void startStatistics()
private void stopStatistics()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |