net.rim.blackberry.api.push
Interface PushApplication


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.

Since:
BlackBerry API 5.0.0

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

onMessage

void onMessage(PushInputStream inputStream,
               StreamConnection conn)
A notification on new push message.

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.

Parameters:
inputStream - input stream that represents message data as it was sent by server
conn - represents connection specific properties
Since:
BlackBerry API 5.0.0

onStatusChange

void onStatusChange(PushApplicationStatus status)
Called when subscription status changes due to some external event.

Parameters:
status - current subscription status
Since:
BlackBerry API 5.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.