|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.pepper.platform.net.NetworkMonitor
public final class NetworkMonitor
Watch for network events like IP address changes and online/offline events.
Assumes that hardware may be multihomed, but Pepper network services like chat and sharing are aware of only a single IP address on a single interface (the primary IP address).
Fires online/offline events in response to some (but not all) network changes:
Method Summary | |
---|---|
void |
addNetworkListener(NetworkListener listener)
Adds a listener for network events. |
static NetworkMonitor |
getInstance()
Returns the singleton instance of NetworkMonitor . |
void |
init()
Start the monitor. |
boolean |
isOnline()
Indicates if the Keeper is online. |
void |
removeNetworkListener(NetworkListener listener)
Removes a listener for network events. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void init()
public void addNetworkListener(NetworkListener listener)
listener
- a class instance which implements the
NetworkListener
interface.public static NetworkMonitor getInstance()
NetworkMonitor
.
NetworkMonitor
singleton instance.public boolean isOnline()
boolean
which indicates
if the Keeper is online.public void removeNetworkListener(NetworkListener listener)
listener
- a class instance which implements the
NetworkListener
interface.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |