|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PushApplication
Interface for creating client-side push application.
The interface should be implemented by application starting point so that it could be instantiated on incoming message. It
should be a child of Application
or MIDlet
classes.
Method Summary | ||
---|---|---|
void |
onMessage(PushInputStream inputStream,
StreamConnection conn)
A notification on new push message. |
|
void |
onStatusChange(PushApplicationStatus status)
Called when subscription status changes due to some external event. |
Method Detail |
---|
void onMessage(PushInputStream inputStream, StreamConnection conn)
Note that this notification will be executed on the application event thread. If the application is instance of UiApplication and contains UI elements then it is recommended to read incoming data in another thread to prevent UI freeze.
Push application is responsible for closing both input stream and connection objects. It is recommended to wrap data reading in the try/finally blocks.
The connection object carries extra information about the message such as HTTP headers if the push request was based on HTTP protocol. Additionally, the connection object may be used to open an OutputStream to provide response back to the server.
inputStream
- input stream that represents message data as it was sent by serverconn
- represents connection specific propertiesvoid onStatusChange(PushApplicationStatus status)
status
- current subscription status
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal