|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectist.palcom.device.AbstractDevice
public abstract class AbstractDevice
The base class of a PalCom device. This abstract class creates no specific
managers. Subclasses implement the
createDeviceContext method
for creating a DeviceContext with the right set of managers.
| Field Summary | |
|---|---|
protected DeviceContext |
context
|
protected PalcomScheduler |
scheduler
|
| Constructor Summary | |
|---|---|
protected |
AbstractDevice(java.lang.String name)
WARNING! |
protected |
AbstractDevice(java.lang.String name,
DeviceID deviceID)
This constructor can be used by simulated devices that uses their own DeviceID and not the one stored in the file system. |
| Method Summary | |
|---|---|
protected abstract DeviceContext |
createDeviceContext(DeviceID deviceID,
PalcomScheduler scheduler)
Creates the DeviceContext of the device. |
DeviceContext |
getDeviceContext()
|
PRDDevice |
getDeviceInfo()
|
java.lang.String |
getName()
|
java.lang.String |
getRootPath()
|
protected void |
initDevice()
Initialize the device. |
void |
run()
Run the scheduler of the device until completion. |
void |
safePutEvent(Event event,
PalcomThread target)
Put an event in the mailbox of a PalcomThread in a way that does not interfere with this device's PalcomScheduler. |
void |
setHeartBeatPeriod(long period)
Set the time interval between heartbeats. |
void |
stop()
Stop the device. |
protected void |
stopDevice()
Stop the device. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PalcomScheduler scheduler
protected DeviceContext context
| Constructor Detail |
|---|
protected AbstractDevice(java.lang.String name)
throws java.io.IOException
java.io.IOException - if a file read/write error occurred when trying to read/write DeviceID
protected AbstractDevice(java.lang.String name,
DeviceID deviceID)
| Method Detail |
|---|
public DeviceContext getDeviceContext()
protected abstract DeviceContext createDeviceContext(DeviceID deviceID,
PalcomScheduler scheduler)
DeviceContext of the device. This method has to be
implemented in a concrete subclass.
deviceID - The device ID.scheduler - The scheduler.
public PRDDevice getDeviceInfo()
public void setHeartBeatPeriod(long period)
public java.lang.String getName()
public java.lang.String getRootPath()
public final void run()
run in interface java.lang.Runnablepublic void stop()
public void safePutEvent(Event event,
PalcomThread target)
protected void initDevice()
throws java.io.IOException
java.io.IOException
protected void stopDevice()
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||