java.lang.Object
org.cybergarage.util.ThreadCore
org.cybergarage.upnp.control.RenewSubscriber
- All Implemented Interfaces:
Runnable
Thread for automatically renewing UPnP event subscriptions. Runs periodically to refresh subscriptions before they expire.
Field Summary
Modifier and TypeFieldDescriptionprivate ControlPoint/////////////////////////////////////////////static final longDefault renewal interval in seconds (120 seconds = 2 minutes)Constructor Summary
ConstructorsConstructorDescriptionRenewSubscriber(ControlPoint ctrlp) Constructs a RenewSubscriber for the specified control point.Method Summary
All MethodsModifier and TypeMethodDescriptionGets the control point for this subscriber.voidrun()Main thread loop that periodically renews subscriptions.voidsetControlPoint(ControlPoint ctrlp) Sets the control point for this subscriber.Methods inherited from class ThreadCore
getThreadObject, isRunnable, restart, setThreadObject, start, stopModifier and TypeMethodDescriptionGets the internal Thread object.booleanChecks if the current thread is the same as this ThreadCore's thread.voidrestart()Restarts the thread by stopping it first and then starting it again.voidsetThreadObject(Thread obj) Sets the internal Thread object.voidstart()Starts the thread if it's not already running.voidstop()Stops the thread safely using interruption.
Field Details
INTERVAL
public static final long INTERVALDefault renewal interval in seconds (120 seconds = 2 minutes)- See Also:
ctrlPoint
/////////////////////////////////////////////
Constructor Details
RenewSubscriber
Constructs a RenewSubscriber for the specified control point.- Parameters:
ctrlp- the control point whose subscriptions should be renewed
Method Details
setControlPoint
Sets the control point for this subscriber.- Parameters:
ctrlp- the control point to set
getControlPoint
Gets the control point for this subscriber.- Returns:
- the control point
run
public void run()Main thread loop that periodically renews subscriptions. Sleeps for the configured interval, then calls the control point to renew all active subscriptions.- Specified by:
runin interfaceRunnable- Overrides:
runin classThreadCore