public abstract class SNMPRunBean extends SNMPBean implements java.lang.Runnable
This bean forms the base of the Runnable SNMP beans. It extends the SNMPBean class.
This bean is used when SNMP requests have to be sent continuously, instead of just once. For that purpose the update interval setUpdateInterval() can be set. The default value is 2000, i.e. 2 msec.
When implementing an extention of this class, the method action() should be implemented. It should somehow start the run by calling setRunning(true). Stopping the thread might be called by the application or applet.
OneInterfaceBean
,
InterfaceIndexesBean
Modifier and Type | Field and Description |
---|---|
protected int |
interval |
protected java.lang.Thread |
me |
protected boolean |
running |
bindAddr, community, context, host, message, port, propertyChangeListener, socketType
Constructor and Description |
---|
SNMPRunBean()
The default constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getUpdateInterval()
Returns the update interval.
|
boolean |
isRunning()
Returns if the bean is running.
|
abstract void |
run()
Method according to the Runnable interface.
|
void |
setRunning(boolean b)
Starts or stops the thread.
|
void |
setUpdateInterval(int i)
Sets the update interval.
|
void |
setUpdateInterval(java.lang.String i)
Sets the update interval as String.
|
action, addPropertyChangeListener, firePropertyChange, getBindAddress, getCommunityName, getHost, getMessage, getPort, getSocketType, isHostPortReachable, removePropertyChangeListener, setBindAddress, setCommunityName, setHost, setMessage, setPort, setPort, setSocketType
protected int interval
protected java.lang.Thread me
protected boolean running
public abstract void run()
run
in interface java.lang.Runnable
setUpdateInterval(int)
,
setRunning(boolean)
public int getUpdateInterval()
setUpdateInterval(int)
,
setUpdateInterval(String)
public void setUpdateInterval(int i)
i
- the interval in msecgetUpdateInterval()
,
setUpdateInterval(String)
public void setUpdateInterval(java.lang.String i)
i
- the interval in msec as StringgetUpdateInterval()
,
setUpdateInterval(int)
public boolean isRunning()
setRunning(boolean)
public void setRunning(boolean b)
isRunning()
,
SNMPBean.action()