oracle.edge.driver
Class AbstractEventDevice
java.lang.Object
AbstractEdgeExtensionImpl
oracle.edge.driver.AbstractDevice
oracle.edge.driver.AbstractEventDevice
- All Implemented Interfaces:
- Device, EdgeExtension, EventDevice, java.lang.Runnable
- Direct Known Subclasses:
- SocketEventDevice
- public abstract class AbstractEventDevice
- extends AbstractDevice
- implements EventDevice
Abstract event device entity to provide basic add/remove filters and generic event collection mechanism. <br/> All customer-derived device driver should be extended from this class.
- See Also:
- Serialized Form
| Method Summary |
void |
addFilter(Filter NewFilter)
Add new filter to this device. |
void |
destroy()
Cleanup upon destroy of this device.<br/> The method will be called internally by DriverManager <p/> |
abstract ResizableArray |
interpretDeviceEvents(java.lang.String ReadContent)
Provides mechanism to interpret event object based on event raw data content collected from the corresponding physical device. |
void |
processEvents(java.lang.String ReadContent)
Provides mechanism to process events collected from the corresponding physical device. |
DeviceEventArray |
receive()
Fetch collected event data as a DeviceEventArray object to EventProcessor.<br/> EventProcessor will spawn a separated thread to pull collected events from this device by repeatedly calling this method. |
void |
removeFilter(Filter ExistingFilter)
Remove a filter from this device. |
void |
start()
Start device operation. |
void |
stop()
Stop device operation. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractEventDevice
public AbstractEventDevice()
addFilter
public void addFilter(Filter NewFilter)
- Add new filter to this device. <p/>
-
- Specified by:
addFilter in interface EventDevice
-
- Parameters:
NewFilter - a new filter to be added.
destroy
public void destroy()
throws DeviceException
- Cleanup upon destroy of this device.<br/> The method will be called internally by
DriverManager <p/>
-
- Specified by:
destroy in interface EdgeExtension
- Overrides:
destroy in class AbstractDevice
-
- Throws:
DeviceException - excpetion thrown upon cleanup failure.
interpretDeviceEvents
public abstract ResizableArray interpretDeviceEvents(java.lang.String ReadContent)
throws DeviceException
- Provides mechanism to interpret event object based on event raw data content collected from the corresponding physical device. <br/> This method has to be implemented by any device driver directly extended from this class. <p/>
-
- Returns:
- an array of event objects.
- Throws:
DeviceException
- See Also:
ResizableArray
processEvents
public void processEvents(java.lang.String ReadContent)
throws DeviceException
- Provides mechanism to process events collected from the corresponding physical device. <br/> <p/>
-
- Overrides:
processEvents in class AbstractDevice
-
- Parameters:
ReadContent - collected event content.
- Throws:
DeviceException
- See Also:
AbstractEventDevice
receive
public DeviceEventArray receive()
throws DeviceException
- Fetch collected event data as a
DeviceEventArray object to EventProcessor.<br/> EventProcessor will spawn a separated thread to pull collected events from this device by repeatedly calling this method. Each time when EventProcess receives the fetched events, it will send them to edge client through its event dispatcher.
-
- Specified by:
receive in interface EventDevice
-
- Returns:
- DeviceEventArray array of device events.
- Throws:
DeviceException
removeFilter
public void removeFilter(Filter ExistingFilter)
- Remove a filter from this device. <p/>
-
- Specified by:
removeFilter in interface EventDevice
-
- Parameters:
ExistingFilter - an existing filter to be removed.
start
public void start()
throws DeviceException
- Start device operation. <br/> This method will be called by
DriverManager after this device is registered and edge server is started. <p/>
-
- Specified by:
start in interface EdgeExtension
- Overrides:
start in class AbstractDevice
-
- Throws:
DeviceException - exception is thrown if this device fails to start up.
stop
public void stop()
throws DeviceException
- Stop device operation. <p/>
-
- Specified by:
stop in interface EdgeExtension
- Overrides:
stop in class AbstractDevice
-
- Throws:
DeviceException
Copyright © 2004 Oracle Corporation. All Rights Reserved.