本文整理汇总了Java中com.notnoop.apns.ApnsService.start方法的典型用法代码示例。如果您正苦于以下问题:Java ApnsService.start方法的具体用法?Java ApnsService.start怎么用?Java ApnsService.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.notnoop.apns.ApnsService
的用法示例。
在下文中一共展示了ApnsService.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.notnoop.apns.ApnsService; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
Configuration config = buildConfiguration(args);
//
// Database
//
WebPushStoreConfiguration pushStoreConfiguration = new WebPushStoreConfiguration(config);
SQLiteWebPushStore sqLiteWebPushStore = SQLiteWebPushStoreFactory.create(pushStoreConfiguration);
//
// PackageZip
//
PackageZipConfiguration packageZipConfiguration = new PackageZipConfiguration(config);
PackageZipSigner packageSigner = new PackageZipSigner(packageZipConfiguration);
PackageZipBuilder packageZipBuilder = new PackageZipBuilder(packageZipConfiguration, packageSigner);
PackageZipPool packageZipPool = new PackageZipPool(packageZipConfiguration);
PackageZipPoolPopulate packageZipPoolPopulate = new PackageZipPoolPopulate(packageZipPool, packageZipBuilder);
//
// Apns Push Service
//
ApnsConfiguration apnsConfiguration = new ApnsConfiguration(config);
ApnsService apnsService = APNS.newService().withCert(apnsConfiguration.apnsCertLocation, apnsConfiguration.apnsCertPassword).withProductionDestination().build();
ApnsPushManager apnsPushManager = new ApnsPushManager(apnsService, apnsConfiguration, sqLiteWebPushStore);
ApnsFeedbackService apnsFeedbackService = new ApnsFeedbackService(apnsService, apnsConfiguration, sqLiteWebPushStore);
//
// Jetty
//
HttpConfiguration httpConfiguration = new HttpConfiguration(config);
WebPushUserIdAuth webPushUserIdAuth = new WebPushUserIdAuth(sqLiteWebPushStore, httpConfiguration);
Server jettyServer = HttpServiceFactory.create(sqLiteWebPushStore, webPushUserIdAuth, packageZipPool, apnsPushManager, httpConfiguration);
// START
apnsService.start();
apnsFeedbackService.startAndWait();
Executors.newSingleThreadExecutor().submit(packageZipPoolPopulate);
jettyServer.start();
}
示例2: newService
import com.notnoop.apns.ApnsService; //导入方法依赖的package包/类
protected ApnsService newService(ApnsConnection connection, ApnsFeedbackConnection feedback) {
ApnsService service = new ApnsServiceImpl(connection, null);
ApnsService queued = new QueuedApnsService(service);
queued.start();
return queued;
}