|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConnection
Defines contract for the connection to the OpenTick service.
This is the central interface of the API. It allows one to prepare and submit a request for data. Note that connection is asynchronous, which means that connection/login process might still be in progress by the time user gets object implementing this interface. But even if so, nothing prevents user from using it: submitted requests will be queued and sent as soon as connection is established. Implementations must be thread-safe. All implementations provided byorg.otfeed
driver are thread-safe.
Method Summary | |
---|---|
IRequest |
prepareRequest(ICommand command)
Prepares a request. |
void |
runInEventThread(java.lang.Runnable job)
Schedules a job for execution in the event-dispatching thread. |
void |
shutdown()
Closes connection to the server. |
void |
waitForCompletion()
Blocks till connection terminates (on error, or as a result of calling shutdown() method). |
boolean |
waitForCompletion(long millis)
Blocks for the earliest of (i) connection termination, or (ii) timeout expiration. |
Method Detail |
---|
void shutdown()
void waitForCompletion()
boolean waitForCompletion(long millis)
millis
- for how long to block.
void runInEventThread(java.lang.Runnable job)
job
- a job to be submitted.IRequest prepareRequest(ICommand command)
IConnection
interface. It allowas caller to
prepare a request to the OpenTick server.
Command parameter must be one of the known request
commands, see org.otfeed.command
package.
See also: IRequest
.
command
- object describing request parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |