|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.monitors.stream.StreamMonitorRouter
public class StreamMonitorRouter
A router that handles multicasr distribution of monitor events to registered monitors.
Constructor Summary | |
---|---|
StreamMonitorRouter()
Creation of a new network monitor router. |
Method Summary | |
---|---|
void |
addStreamMonitor(StreamMonitor monitor)
Add a monitor to the list of monitors managed by this router. |
StreamMonitor |
getMonitor(int index)
Returns a Monitor. |
void |
notifyCompletion(URL resource)
Notify all subscribing monitors of a download completion event. |
void |
notifyError(URL resource,
String message)
Notify the monitor of the an error during the download process. |
void |
notifyUpdate(URL resource,
int expected,
int count)
Notify all subscribing monitors of a updated event. |
void |
removeStreamMonitor(StreamMonitor monitor)
Remove a monitor to the list of monitors managed by this router. |
int |
size()
Returns the number of Monitors that are being handled by this router. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StreamMonitorRouter()
Method Detail |
---|
public void notifyUpdate(URL resource, int expected, int count)
notifyUpdate
in interface StreamMonitor
resource
- the url of the updated resourceexpected
- the size in bytes of the downloadcount
- the progress in bytespublic void notifyCompletion(URL resource)
notifyCompletion
in interface StreamMonitor
resource
- the url of the downloaded resourcepublic void notifyError(URL resource, String message)
notifyError
in interface StreamMonitor
resource
- the name of the remote resource.message
- a non-localized message describing the problem in english.public void addStreamMonitor(StreamMonitor monitor)
monitor
- the monitor to addpublic void removeStreamMonitor(StreamMonitor monitor)
monitor
- the monitor to addpublic int size()
public StreamMonitor getMonitor(int index)
index
- The index in the List of the Monitor to return.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |