当前位置: 首页>>代码示例>>Java>>正文


Java ApnsService.start方法代码示例

本文整理汇总了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();
}
 
开发者ID:chriskearney,项目名称:stickypunch,代码行数:35,代码来源:Main.java

示例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;
}
 
开发者ID:wangqi,项目名称:gameserver,代码行数:7,代码来源:QueuedApnsServiceTest.java


注:本文中的com.notnoop.apns.ApnsService.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。