ist.palcom.device
Class DeviceIO

java.lang.Object
  extended by ist.palcom.device.DeviceIO
All Implemented Interfaces:
IDeviceIO

public class DeviceIO
extends java.lang.Object
implements IDeviceIO

This class implements the sending of I/O events between the "hardware" and "Palcom" domains. If polling is required, this class should be extended and get{In|Out}Event and/or wait{In|Out}Event overridden. The implementations in this class throws an Error.


Constructor Summary
DeviceIO(PalcomScheduler scheduler)
           
 
Method Summary
 void addOutEventListener(OutEventListener l)
          Register a listener for events from the palcom side.
 void close()
          close and do cleanup.
 Event getInEvent()
          non-blocking polling of input events
 Event getOutEvent()
          non-blocking polling of input events
 void putInEvent(Event e)
          send an event from the hardware to the palcom side code
 void putOutEvent(Event e)
          Send an event to the hardware from the palcom side code.
 void removeInEventReceiver()
          unregister the receiver for events from the hardware side.
 void removeOutEventListener(OutEventListener l)
          unregister a listener for events from the palcom side.
 void setInEventReceiver(PalcomThread t)
          register the receiver for events from the hardware side.
 Event waitInEvent()
          blocking polling of input events
 Event waitOutEvent()
          blocking polling of input events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceIO

public DeviceIO(PalcomScheduler scheduler)
Method Detail

close

public void close()
Description copied from interface: IDeviceIO
close and do cleanup.

Specified by:
close in interface IDeviceIO

putInEvent

public void putInEvent(Event e)
Description copied from interface: IDeviceIO
send an event from the hardware to the palcom side code

Specified by:
putInEvent in interface IDeviceIO

putOutEvent

public void putOutEvent(Event e)
Description copied from interface: IDeviceIO
Send an event to the hardware from the palcom side code. If listeners have been registered using addOutEventListener, the hardware-side event handler call-back may run in the context of the palcom thread that calls putOutEvent.

Specified by:
putOutEvent in interface IDeviceIO

setInEventReceiver

public void setInEventReceiver(PalcomThread t)
Description copied from interface: IDeviceIO
register the receiver for events from the hardware side. N.B.! There can be at most one receiver thread on the PalcomThread side.

Specified by:
setInEventReceiver in interface IDeviceIO

removeInEventReceiver

public void removeInEventReceiver()
Description copied from interface: IDeviceIO
unregister the receiver for events from the hardware side.

Specified by:
removeInEventReceiver in interface IDeviceIO

addOutEventListener

public void addOutEventListener(OutEventListener l)
Description copied from interface: IDeviceIO
Register a listener for events from the palcom side. On the hardware side, a set of listeners is allowed.

Specified by:
addOutEventListener in interface IDeviceIO

removeOutEventListener

public void removeOutEventListener(OutEventListener l)
Description copied from interface: IDeviceIO
unregister a listener for events from the palcom side.

Specified by:
removeOutEventListener in interface IDeviceIO

getInEvent

public Event getInEvent()
Description copied from interface: IDeviceIO
non-blocking polling of input events

Specified by:
getInEvent in interface IDeviceIO

waitInEvent

public Event waitInEvent()
Description copied from interface: IDeviceIO
blocking polling of input events

Specified by:
waitInEvent in interface IDeviceIO

getOutEvent

public Event getOutEvent()
Description copied from interface: IDeviceIO
non-blocking polling of input events

Specified by:
getOutEvent in interface IDeviceIO

waitOutEvent

public Event waitOutEvent()
Description copied from interface: IDeviceIO
blocking polling of input events

Specified by:
waitOutEvent in interface IDeviceIO