Question: public class Worker extends Thread { private Queue queue; private ClosedCaptioningListener listener; public Worker ( Queue queue, ClosedCaptioningListener listener ) { this.queue = queue; this.listener
public class Worker extends Thread
private Queue queue;
private ClosedCaptioningListener listener;
public WorkerQueue queue, ClosedCaptioningListener listener
this.queue queue;
this.listener listener;
@Override
public void run
while true
Get a recording from the queue
Recording recording queue.poll;
If there is no recording in the queue, break
if recording null
break;
Process the recording
Set the closed captioning for the recording
recording.setClosedCaptioningClosed captioning for recording recording.getId;
Call the listener to update the recording with the closed captioning
listener.onClosedCaptioningrecording;
public interface ClosedCaptioningListener
void onClosedCaptioningRecording recording;
To use the callback actions, we can create a listener and pass it to the closed captioning controller:
ClosedCaptioningListener listener new ClosedCaptioningListener
@Override
public void onClosedCaptioningRecording recording
Update the recording with the closed captioning
;
ClosedCaptioningController controller new ClosedCaptioningControllerqueue listener; give me code with class name
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
