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

Lets only ONE picked action be between its confirm and its end. More...

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

Classes

class  Ticket
 One begun action. More...
 

Public Member Functions

 ActionFlight (LongSupplier nowMillis, long maxMillis)
 
synchronized Ticket tryBegin ()
 
synchronized boolean isActive ()
 

Static Public Member Functions

static ActionFlight createDefault ()
 The process-wide flight on the monotonic system clock, lasting at most ShareLimits#ACTION_FLIGHT_MAX_MILLIS.
 

Detailed Description

Lets only ONE picked action be between its confirm and its end.

The receiver selection that a picked action stores (UpnpClient#setReceiverDeviceIds) is global and read back later by the player service; a second action that confirmed meanwhile would replace it, or the first action's clearing would wipe it. While a flight is active no other action may begin, so the selection is only ever the active action's. Plain Java, thread-safe.

A flight that is never ended (a lost callback) expires after maxMillis, so one bug cannot block picking for good; a stale Ticket of such a flight cannot end the next one.

Constructor & Destructor Documentation

◆ ActionFlight()

de.yaacc.share.ActionFlight.ActionFlight ( LongSupplier nowMillis,
long maxMillis )
Parameters
nowMillisa monotonic clock in milliseconds
maxMillishow long a flight may last before it counts as lost, greater than zero

Referenced by de.yaacc.share.ActionFlight.createDefault().

Here is the caller graph for this function:

Member Function Documentation

◆ isActive()

synchronized boolean de.yaacc.share.ActionFlight.isActive ( )
Returns
true if an action is in flight and has not expired

◆ tryBegin()

synchronized Ticket de.yaacc.share.ActionFlight.tryBegin ( )
Returns
the ticket of the new flight, or null (nothing changes) if another action is in flight

Referenced by de.yaacc.share.GuardedPickedAction.onConfirmed().

Here is the caller graph for this function:

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