use of com.notnoop.apns.internal.ApnsServiceImpl in project java-apns by notnoop.
the class ApnsServiceBuilder method build.
/**
* Returns a fully initialized instance of {@link ApnsService},
* according to the requested settings.
*
* @return a new instance of ApnsService
*/
public ApnsService build() {
checkInitialization();
ApnsService service;
SSLSocketFactory sslFactory = sslContext.getSocketFactory();
ApnsFeedbackConnection feedback = new ApnsFeedbackConnection(sslFactory, feedbackHost, feedbackPort, proxy, readTimeout, connectTimeout, proxyUsername, proxyPassword);
ApnsConnection conn = new ApnsConnectionImpl(sslFactory, gatewayHost, gatewayPort, proxy, proxyUsername, proxyPassword, reconnectPolicy, delegate, errorDetection, errorDetectionThreadFactory, cacheLength, autoAdjustCacheLength, readTimeout, connectTimeout);
if (pooledMax != 1) {
conn = new ApnsPooledConnection(conn, pooledMax, executor);
}
service = new ApnsServiceImpl(conn, feedback);
if (isQueued) {
service = new QueuedApnsService(service, queueThreadFactory);
}
if (isBatched) {
service = new BatchApnsService(conn, feedback, batchWaitTimeInSec, batchMaxWaitTimeInSec, batchThreadPoolExecutor);
}
service.start();
return service;
}
Aggregations