oracle.edge.driver
Class AbstractDevice
java.lang.Object
AbstractEdgeExtensionImpl
oracle.edge.driver.AbstractDevice
- All Implemented Interfaces:
- Device, EdgeExtension, java.lang.Runnable
- Direct Known Subclasses:
- AbstractEventDevice, SocketDevice
- public abstract class AbstractDevice
- extends AbstractEdgeExtensionImpl
- implements Device, java.lang.Runnable
Abstract device entity to provide basic name, description, version info. All customer-derived device driver should be extended from this class.
- See Also:
- Serialized Form
Method Summary |
void |
destroy()
Clean up the edge extension object, Called by the edge server to indicate to an EdgeExtension that the extension is being taken out of service. |
abstract Event |
interpretInstructionProcessResult(java.lang.String ReadContent)
Provides mechanism to obtain any instruction response from the corresponding physical device. |
void |
processEvents(java.lang.String ReadContent)
Provides mechanism to process events collected from the corresponding physical device. |
abstract void |
processInstruction(Event CurInstruction)
Process each incoming instruction.<br/> DriverManager will call this function upon each matched incoming instruction received from edge client or UI. |
abstract java.lang.String |
readFromDevice()
Provides mechanism to obtain content from the corresponding physical device. |
void |
run()
|
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 |
Methods inherited from interface oracle.edge.driver.Device |
isAlive |
INSTRUCTION_RESP_FAILURE_CODE
public static final java.lang.String INSTRUCTION_RESP_FAILURE_CODE
-
- See Also:
- Constant Field Values
INSTRUCTION_RESP_SUCCESS_CODE
public static final java.lang.String INSTRUCTION_RESP_SUCCESS_CODE
-
- See Also:
- Constant Field Values
AbstractDevice
public AbstractDevice()
destroy
public void destroy()
throws EdgeExtensionException
- Clean up the edge extension object, Called by the edge server to indicate to an EdgeExtension that the extension is being taken out of service. This method gives the extension object an opportunity to clean up any resources that are being held (memory, file/socket et al) and make sure that any data/events are not lost.
-
- Specified by:
destroy
in interface EdgeExtension
-
- Throws:
EdgeExtensionException
- In case of errors occurred while cleaning up.
interpretInstructionProcessResult
public abstract Event interpretInstructionProcessResult(java.lang.String ReadContent)
throws DeviceException
- Provides mechanism to obtain any instruction response from the corresponding physical device. <br/> This method has to be implemented by any device driver directly extended from this class. <p/>
-
- Returns:
- instruction response obtained from physical device.
- Throws:
DeviceException
processEvents
public void processEvents(java.lang.String ReadContent)
throws DeviceException
- Provides mechanism to process events collected from the corresponding physical device. <br/> Default implementation is empty. This method will be overridden by
AbstractEventDevice
. <p/>
-
- Parameters:
ReadContent
- content collected from device.
- Throws:
DeviceException
- See Also:
AbstractEventDevice
processInstruction
public abstract void processInstruction(Event CurInstruction)
throws DeviceException
- Process each incoming instruction.<br/>
DriverManager
will call this function upon each matched incoming instruction received from edge client or UI. <p/>
-
- Specified by:
processInstruction
in interface Device
-
- Parameters:
CurInstruction
- instruction to be processed. //@return insturction process response
- Throws:
DeviceException
- exception to be thown upon failure for processing instruction.
readFromDevice
public abstract java.lang.String readFromDevice()
throws DeviceException
- Provides mechanism to obtain content from the corresponding physical device. <br/> This method has to be implemented by any device driver directly extended from this class. <p/>
-
- Returns:
- content obtained from physical device.
- Throws:
DeviceException
run
public void run()
-
- Specified by:
run
in interface java.lang.Runnable
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
-
- 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
-
- Throws:
DeviceException
Copyright © 2004 Oracle Corporation. All Rights Reserved.