@ApplicationScoped public class ApnsServiceCache extends AbstractServiceCache<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.AbstractServiceCache#dequeueOrCreateNewService(String, org.jboss.aerogear.unifiedpush.api.Variant, org.jboss.aerogear.unifiedpush.message.cache.AbstractServiceCache.ServiceConstructor),
AbstractServiceCache#queueFreedUpService(String, org.jboss.aerogear.unifiedpush.api.Variant, Object),
AbstractServiceCache#freeUpSlot(String, org.jboss.aerogear.unifiedpush.api.Variant)AbstractServiceCache.ServiceConstructor<T>| Modifier and Type | Field and Description |
|---|---|
static long |
INSTANCE_ACQUIRING_TIMEOUT |
static int |
INSTANCE_LIMIT |
| Constructor and Description |
|---|
ApnsServiceCache() |
| Modifier and Type | Method and Description |
|---|---|
void |
freeUpAvailableServices(VariantCompletedEvent variantCompleted) |
dequeue, dequeueOrCreateNewService, freeUpSlot, queueFreedUpServicepublic static final int INSTANCE_LIMIT
public static final long INSTANCE_ACQUIRING_TIMEOUT
public void freeUpAvailableServices(@Observes
VariantCompletedEvent variantCompleted)
Copyright © 2015 JBoss by Red Hat. All Rights Reserved.