|
JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jxta.impl.content.defprovider.ActiveTransferTracker
public class ActiveTransferTracker
This class provides a somewhat efficient mechanism for tracking active transfers and providing a cache for information related to those transfers. As an example, Contents currently only have streamed data accessors. Requests for data will typically come in a linear fashion, so it makes good sense from a performance perspective to leave the stream open for a period of time. Additionally, this tracker class puts some absolute limits in place as to how many concurrent clients will be served, giving preference to transfers already in progress.
| Constructor Summary | |
|---|---|
ActiveTransferTracker(PeerGroup peerGroup,
ScheduledExecutorService executor)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addActiveTransferListener(ActiveTransferTrackerListener listener)
Adds an tracker listener to notify of interesting events. |
ActiveTransfer |
getSession(DefaultContentShare share,
PipeAdvertisement destination)
Creates and/or retrieves the active transfer session for the provided combination of share and destination. |
void |
removeActiveTransferListener(ActiveTransferTrackerListener listener)
Removes a transfer listener, preventin further event notifications. |
void |
start()
Start tracking and serving. |
void |
stop()
Stop tracking and serving, freeing any resources held. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ActiveTransferTracker(PeerGroup peerGroup,
ScheduledExecutorService executor)
peerGroup - PeerGroup to use to resolve pipesexecutor - executor to submit garbage collection tasks to| Method Detail |
|---|
public void addActiveTransferListener(ActiveTransferTrackerListener listener)
listener - listener to addpublic void removeActiveTransferListener(ActiveTransferTrackerListener listener)
listener - listener to add
public ActiveTransfer getSession(DefaultContentShare share,
PipeAdvertisement destination)
throws TooManyClientsException,
IOException
share - content share to serve to the destinationdestination - pipe to send data to
TooManyClientsException
IOExceptionpublic void start()
public void stop()
|
JXSE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||