org.cybergarage.upnp.device.Disposer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of upnp-stack Show documentation
Show all versions of upnp-stack Show documentation
A pure Java Open Source implementation of the UPnP stack for JDK 1.4 or above
The newest version!
/******************************************************************
*
* CyberLink for Java
*
* Copyright (C) Satoshi Konno 2002-2004
*
* File: Disposer.java
*
* Revision:
*
* 01/05/04
* - first revision.
* 02/01/08
* - added guard checking on awaking (francesco)
*
******************************************************************/
package org.cybergarage.upnp.device;
import org.cybergarage.upnp.*;
import org.cybergarage.util.*;
public class Disposer extends ThreadCore
{
////////////////////////////////////////////////
// Constructor
////////////////////////////////////////////////
public Disposer(ControlPoint ctrlp)
{
setControlPoint(ctrlp);
}
////////////////////////////////////////////////
// Member
////////////////////////////////////////////////
private ControlPoint ctrlPoint;
public void setControlPoint(ControlPoint ctrlp)
{
ctrlPoint = ctrlp;
}
public ControlPoint getControlPoint()
{
return ctrlPoint;
}
////////////////////////////////////////////////
// Thread
////////////////////////////////////////////////
public void run()
{
ControlPoint ctrlp = getControlPoint();
long monitorInterval = ctrlp.getExpiredDeviceMonitoringInterval() * 1000;
while (isRunnable() == true) {
try {
Thread.sleep(monitorInterval);
} catch (InterruptedException e) {}
if (isRunnable())
ctrlp.removeExpiredDevices();
else
return;
//ctrlp.print();
}
}
}