@ApplicationScoped public class ApnsServiceHolder extends AbstractServiceHolder<com.notnoop.apns.ApnsService>
ApnsService with upper-bound limit of 10 created instances
per given push message and variant. This allows for 10 concurrent connections to the APNs push network.
Cache allows to return freed up services to the queue or free a slot for creating new services up to the limit.
This cache also listens for VariantCompletedEvent event and stops all instantiated ApnsServices and frees the cache.| Modifier and Type | Field and Description |
|---|---|
static long |
DISPOSING_DELAY |
static long |
INSTANCE_ACQUIRING_TIMEOUT |
static int |
INSTANCE_LIMIT |
| Constructor and Description |
|---|
ApnsServiceHolder() |
| Modifier and Type | Method and Description |
|---|---|
void |
freeUpAvailableServices(VariantCompletedEvent variantCompleted)
Listen to
VariantCompletedEvent to free up APNs bound resources after the (iOS) variant has
been completely processed for push notification delivery. |
javax.jms.Queue |
getFreeServiceSlotQueue()
Returns the Queue used as a counter of free services.
|
void |
initializeHolderForVariants(MessageHolderWithVariants msg) |
borrowServiceSlotFromQueue, dequeue, dequeueOrCreateNewService, destroy, freeUpSlot, initialize, queueFreedUpService, returnServiceSlotToQueuepublic static final int INSTANCE_LIMIT
public static final long INSTANCE_ACQUIRING_TIMEOUT
public static final long DISPOSING_DELAY
public javax.jms.Queue getFreeServiceSlotQueue()
AbstractServiceHoldergetFreeServiceSlotQueue in class AbstractServiceHolder<com.notnoop.apns.ApnsService>public void initializeHolderForVariants(@Observes
MessageHolderWithVariants msg)
throws ExecutionException
ExecutionExceptionpublic void freeUpAvailableServices(@Observes
VariantCompletedEvent variantCompleted)
throws ExecutionException
VariantCompletedEvent to free up APNs bound resources after the (iOS) variant has
been completely processed for push notification delivery.ExecutionExceptionCopyright © 2016 JBoss by Red Hat. All Rights Reserved.