net.dpml.transit.monitor
Class NetworkMonitorRouter
java.lang.Object
net.dpml.transit.monitor.AbstractMonitorRouter
net.dpml.transit.monitor.NetworkMonitorRouter
- All Implemented Interfaces:
- Monitor, NetworkMonitor, Router
- public class NetworkMonitorRouter
- extends AbstractMonitorRouter
- implements NetworkMonitor, Router
A router that handles multicasr distribution of monitor events to registered monitors.
- Version:
- 1.0.0
- Author:
- The Digital Product Meta Library
Method Summary |
void |
addMonitor(Monitor monitor)
Add a monitor to the list of monitors managed by this router. |
void |
notifyCompletion(URL resource)
Notify all subscribing monitors of a download completion event. |
void |
notifyUpdate(URL resource,
int expected,
int count)
Notify all subscribing monitors of a updated event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NetworkMonitorRouter
public NetworkMonitorRouter()
notifyUpdate
public void notifyUpdate(URL resource,
int expected,
int count)
- Notify all subscribing monitors of a updated event.
- Specified by:
notifyUpdate
in interface NetworkMonitor
- Parameters:
resource
- the url of the updated resourceexpected
- the size in bytes of the downloadcount
- the progress in bytes
notifyCompletion
public void notifyCompletion(URL resource)
- Notify all subscribing monitors of a download completion event.
- Specified by:
notifyCompletion
in interface NetworkMonitor
- Parameters:
resource
- the url of the downloaded resource
addMonitor
public void addMonitor(Monitor monitor)
throws IllegalArgumentException
- Add a monitor to the list of monitors managed by this router.
- Specified by:
addMonitor
in interface Router
- Overrides:
addMonitor
in class AbstractMonitorRouter
- Parameters:
monitor
- the monitor to add
- Throws:
IllegalArgumentException
- if the supplied monitor is not a NetworkMonitor