Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.messaging.transport
Interface DriverBase

All Known Subinterfaces:
Driver, XDriver

public interface DriverBase

The base driver interface. The actual driver interface Driver and XDriver extend this interface. The base interface defines the common interface of Driver and XDriver.

See Also:
Driver, XDriver

Field Summary
static int FAILED
          Initialization status: failed to init the driver.
static int MESSAGE_ID_MAX_LENGTH
          The maximum length in characters the returned message id can be.
static int RECEIVE
          Initialization status: drive can receive.
static int SEND
          Initialization status: driver can send.
static int SEND_RECEIVE
          Initialization status: driver can send and receive.

 

Method Summary
 void destroy()
          Destroy the driver.
 java.lang.String getInfo()
          Get additional information of the driver.
 Parameter[] getParameters()
          Get the expected parameter list.
 void getStatus(java.lang.String mid)
          Get the sending status of a message.
 void getStatus(java.lang.String[] mids)
          Get the sending statuses of a list of messages.
 java.lang.String getVersion()
          Get the version of the driver.
 int init(java.util.Properties properties)
          Initialize the driver.
 boolean queryNotifying()
          Check if query is required to get the notification.
 boolean queryTracking()
          Check if query is required to track the sending status.
 void receive()
          Drivers implement this method to perform whatever is appropriate for their particular protocols to receive messages.

 

Field Detail

FAILED

public static final int FAILED
Initialization status: failed to init the driver. Status can also be logical ORed "|"
See Also:
Constant Field Values

MESSAGE_ID_MAX_LENGTH

public static final int MESSAGE_ID_MAX_LENGTH
The maximum length in characters the returned message id can be.
See Also:
Constant Field Values

RECEIVE

public static final int RECEIVE
Initialization status: drive can receive. Status can also be logical ORed "|"
See Also:
Constant Field Values

SEND

public static final int SEND
Initialization status: driver can send. Status can also be logical ORed "|"
See Also:
Constant Field Values

SEND_RECEIVE

public static final int SEND_RECEIVE
Initialization status: driver can send and receive. Status can also be logical ORed "|"
See Also:
Constant Field Values

Method Detail

destroy

public void destroy()
Destroy the driver.

getInfo

public java.lang.String getInfo()
Get additional information of the driver.
Returns:
the information of the driver.

getParameters

public Parameter[] getParameters()
Get the expected parameter list.
Returns:
an array of Parameter.

getStatus

public void getStatus(java.lang.String mid)
Get the sending status of a message. The status got by this call should be reported the transport system via the driver listener onStatus callback.
Parameters:
mid - the id of the message.

getStatus

public void getStatus(java.lang.String[] mids)
Get the sending statuses of a list of messages. The statuses got by this call should be reported the transport system via the driver listener onStatus callback.
Parameters:
mids - the ids of these messages.

getVersion

public java.lang.String getVersion()
Get the version of the driver.
Returns:
the version of the driver.

init

public int init(java.util.Properties properties)
Initialize the driver. Properties passed in include those custom to each driver type and values provided to each instance, as well as an implicit set of common properties in the OracleAS Wireless environment. Please consult product documentaion for more detail. The init method should return the initialization status as defined above. The return indicates the capability of the driver instance. The meaning of the status is quite self explanatory. However, one has to make sure the capability returned here is consistent with those configured over the UI. If they differ, those returned here takes precedence.
Parameters:
properties - the driver's properties.
Returns:
the initialization status.

queryNotifying

public boolean queryNotifying()
Check if query is required to get the notification. With some protocols, an active poll to the external service must be performed to check status of messages previously sent. These methods are called by the Transport to determine whether a getStatus() must be issued to retrieve status, or the driver would pass status back to Transport without such call(in this case, typically the driver calls onStatus() inside receive()).
Returns:
true if required, false otherwise.

queryTracking

public boolean queryTracking()
Check if query is required to track the sending status.
Returns:
true if required, false otherwise.

receive

public void receive()
             throws DriverException
Drivers implement this method to perform whatever is appropriate for their particular protocols to receive messages. The transport system would drive the operation. Normally, the driver is expected to return from this method once a message is received. This way controlled is yielded back to the transport regularly so that the transport and decide the best step to take next. The receive() method is called continuously by the transport. Hence it is preferable the receive() method blocks if it does not receive any messages. However it should not block indefinitely otherwise it will be considered a runaway operation and the thread that calls the receive will be terminated. The time elapse for runaway threads can be configured by setting "Maximum Execution Time per Request" under runtime configuration (default is 120 second). When a message is received, it should call the onMessage method of the Message Listener to submit the message (or, the onStatus callback on Status Listener if the message was a status report). The method can throw an exception of type DriverException and mark it fatal to ask the transport to stop calling the receive () method. The reason for this design is to simplify the logic and thread control of the driver.
Throws:
DriverException.
DriverException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.