public class Registrations extends Object
| Constructor and Description |
|---|
Registrations() |
Registrations(PushRegistrarFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
PushRegistrar |
get(String name)
Recalls a PushRegister instance which was created with
push(java.lang.String, org.jboss.aerogear.android.unifiedpush.PushConfig). |
protected static void |
notifyHandlers(android.content.Context context,
android.content.Intent message)
This will deliver an intent to all registered handlers.
|
static void |
notifyHandlers(android.content.Context context,
android.content.Intent message,
MessageHandler defaultHandler)
This will deliver an intent to all registered handlers.
|
PushRegistrar |
push(String name,
PushConfig config)
This method will try to build a PuserRegistrar based on the values
in the configuration bean.
|
static void |
registerBackgroundThreadHandler(MessageHandler handler)
When a push message is received, all background thread handlers will be
notified on a non UI thread.
|
static void |
registerMainThreadHandler(MessageHandler handler)
When a push message is received, all main thread handlers will be
notified on the main(UI) thread.
|
static void |
unregisterBackgroundThreadHandler(MessageHandler handler)
This will remove the given handler from the collection of background
thread handlers.
|
static void |
unregisterMainThreadHandler(MessageHandler handler)
This will remove the given handler from the collection of main thread
handlers.
|
public Registrations()
public Registrations(PushRegistrarFactory factory)
public PushRegistrar push(String name, PushConfig config)
get(java.lang.String)
and passing in the name parameter.name - the name which will be used to look up the registrar laterconfig - a configuration bean.IllegalArgumentException - is config.type is not a supported typepublic PushRegistrar get(String name)
push(java.lang.String, org.jboss.aerogear.android.unifiedpush.PushConfig).name - the name parameter to look uppublic static void registerMainThreadHandler(MessageHandler handler)
handler - a handler to added to the list of handlers to be notified.public static void registerBackgroundThreadHandler(MessageHandler handler)
handler - a handler to added to the list of handlers to be notified.public static void unregisterMainThreadHandler(MessageHandler handler)
handler - a new handlerpublic static void unregisterBackgroundThreadHandler(MessageHandler handler)
handler - a new handlerpublic static void notifyHandlers(android.content.Context context,
android.content.Intent message,
MessageHandler defaultHandler)
PushConstants for information on how messages will be routed.context - the application's contextmessage - the message to passdefaultHandler - a default handler is a handler which will be called
if there are no other handlers registered. May be nullprotected static void notifyHandlers(android.content.Context context,
android.content.Intent message)
context - the application's contextmessage - the message to passCopyright © 2014 JBoss by Red Hat. All rights reserved.