Oracle Application Server Wireless Java API Reference
B14043-01


oracle.edge.driver
Class SocketEventDevice

java.lang.Object
  extended byAbstractEdgeExtensionImpl
      extended byoracle.edge.driver.AbstractDevice
          extended byoracle.edge.driver.AbstractEventDevice
              extended byoracle.edge.driver.SocketEventDevice

All Implemented Interfaces:
Device, EdgeExtension, EventDevice, java.lang.Runnable

public abstract class SocketEventDevice
extends AbstractEventDevice

Abstract event device entity that receives events through tcp/ip socket. This class is provided as a base class for all devices that are communicating with edge server through tcp/ip socket connection.

See Also:
Serialized Form

Field Summary

Fields inherited from class oracle.edge.driver.AbstractDevice
INSTRUCTION_RESP_FAILURE_CODE, INSTRUCTION_RESP_SUCCESS_CODE

Fields inherited from interface oracle.edge.common.EdgeExtension
DEVICE_DRIVER_TYPE, DISPATCHER_TYPE, FILTER_TYPE

Constructor Summary
SocketEventDevice()

Method Summary
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.
abstract java.lang.String prepareInstructionStream(Event CurInstruction)
Provides mechanism to encode instruction content to be sent to the corresponding physical device.
void processInstruction(Event CurInstruction)
Provides mechanism to send an instruction to the corresponding physical device.
java.lang.String readFromDevice()
Provides mechanism to obtain content from the corresponding physical device.
void start()
Start device operation.
void stop()
Stop device operation.

Methods inherited from class oracle.edge.driver.AbstractEventDevice
addFilter, processEvents, receive, removeFilter

Methods inherited from class oracle.edge.driver.AbstractDevice
interpretInstructionProcessResult, run

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

Methods inherited from interface oracle.edge.common.EdgeExtension
getDescription, getName, getVersion, init

Constructor Detail

SocketEventDevice

public SocketEventDevice()

Method Detail

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 AbstractEventDevice
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/>
Specified by:
interpretDeviceEvents in class AbstractEventDevice
Returns:
an array of event objects.
Throws:
DeviceException
See Also:
ResizableArray

prepareInstructionStream

public abstract java.lang.String prepareInstructionStream(Event CurInstruction)
                                                   throws DeviceException
Provides mechanism to encode instruction content to be sent to the corresponding physical device. <br/> This method has to be implemented by any device driver directly extended from this class. <p/>
Returns:
encoded instruction string.
Throws:
DeviceException

processInstruction

public void processInstruction(Event CurInstruction)
                        throws DeviceException
Provides mechanism to send an instruction to the corresponding physical device. <br/> <p/>
Specified by:
processInstruction in interface Device
Specified by:
processInstruction in class AbstractDevice
Parameters:
CurInstruction - an instruction to be sent.
Throws:
DeviceException

readFromDevice

public java.lang.String readFromDevice()
                                throws DeviceException
Provides mechanism to obtain content from the corresponding physical device. <br/> <p/>
Specified by:
readFromDevice in class AbstractDevice
Returns:
content obtained from physical device.
Throws:
DeviceException

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 AbstractEventDevice
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 AbstractEventDevice
Throws:
DeviceException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.