YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.share.QueueShareWindow Class Reference

The shares of one picked queue, held just in time: a file is reachable by a receiver only while a player holds it. More...

Collaboration diagram for de.yaacc.share.QueueShareWindow:
Collaboration graph

Classes

interface  Binder
 Creates the share of one item. More...
 
interface  Bound
 A bound share; release() makes the file unreachable again. More...
 
class  Lease
 What one player holds: the shares of the items it plays. More...
 

Public Member Functions

 QueueShareWindow (List<?> items, Binder binder)
 A window for the given queue items: Lease#moveToItems finds their index by identity.
 
Lease newLease ()
 A new holder, one per player.
 

Static Public Attributes

static final int NONE = -1
 No index: a lease with no next item.
 

Detailed Description

The shares of one picked queue, held just in time: a file is reachable by a receiver only while a player holds it.

The window counts the holders of each item; the first holder binds the share (Binder), the last one releases it. A player takes a Lease.

Items are identified by the object of the queue (the placeholder item), not by their position in a player's list: a player's playlist can be edited (remove, move, add) after the queue was set. An item that is not part of the queue is not this window's business.

Binding a share (open the file, register it, build the url) can take seconds, so it runs outside every lock: Lease#close() and releaseAll() never wait for it, and a bind that finishes after the close releases its share again at once.


The documentation for this class was generated from the following file: