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


Java Threading.throwOnLockCycles方法代码示例

本文整理汇总了Java中org.bitcoinj.utils.Threading.throwOnLockCycles方法的典型用法代码示例。如果您正苦于以下问题:Java Threading.throwOnLockCycles方法的具体用法?Java Threading.throwOnLockCycles怎么用?Java Threading.throwOnLockCycles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bitcoinj.utils.Threading的用法示例。


在下文中一共展示了Threading.throwOnLockCycles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import org.bitcoinj.utils.Threading; //导入方法依赖的package包/类
@Override
public void onCreate() {
    new LinuxSecureRandom(); // init proper random number generator

    initLogging();

    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads()
            .permitDiskWrites().penaltyLog().build());

    Threading.throwOnLockCycles();
    org.bitcoinj.core.Context.enableStrictMode();
    org.bitcoinj.core.Context.propagate(Constants.CONTEXT);

    log.info("=== starting app using configuration: {}, {}", Constants.TEST ? "test" : "prod",
            Constants.NETWORK_PARAMETERS.getId());

    super.onCreate();

    packageInfo = packageInfoFromContext(this);

    CrashReporter.init(getCacheDir());

    Threading.uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(final Thread thread, final Throwable throwable) {
            log.info("bitcoinj uncaught exception", throwable);
            CrashReporter.saveBackgroundTrace(throwable, packageInfo);
        }
    };

    initMnemonicCode();

    config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources());
    activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

    blockchainServiceIntent = new Intent(this, BlockchainServiceImpl.class);
    blockchainServiceCancelCoinsReceivedIntent = new Intent(BlockchainService.ACTION_CANCEL_COINS_RECEIVED, null,
            this, BlockchainServiceImpl.class);
    blockchainServiceResetBlockchainIntent = new Intent(BlockchainService.ACTION_RESET_BLOCKCHAIN, null, this,
            BlockchainServiceImpl.class);

    walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF);

    loadWalletFromProtobuf();

    if (config.versionCodeCrossed(packageInfo.versionCode, VERSION_CODE_SHOW_BACKUP_REMINDER)
            && !wallet.getImportedKeys().isEmpty()) {
        log.info("showing backup reminder once, because of imported keys being present");
        config.armBackupReminder();
    }

    config.updateLastVersionCode(packageInfo.versionCode);

    afterLoadWallet();

    cleanupFiles();

    initNotificationManager();
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:60,代码来源:WalletApplication.java

示例2: checkFail

import org.bitcoinj.utils.Threading; //导入方法依赖的package包/类
@After
public void checkFail() {
    assertFalse(fail.get());
    Threading.throwOnLockCycles();
}
 
开发者ID:Grant-Redmond,项目名称:cryptwallet,代码行数:6,代码来源:ChannelConnectionTest.java

示例3: onCreate

import org.bitcoinj.utils.Threading; //导入方法依赖的package包/类
@Override
public void onCreate()
{
    new LinuxSecureRandom(); // init proper random number generator

    initLogging();

    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads().permitDiskWrites().penaltyLog().build());

    Threading.throwOnLockCycles();

    log.info("=== starting app using configuration: {}, {}", Constants.TEST ? "test" : "prod", Constants.NETWORK_PARAMETERS.getId());

    super.onCreate();

    packageInfo = packageInfoFromContext(this);

    CrashReporter.init(getCacheDir());

    Threading.uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler()
    {
        @Override
        public void uncaughtException(final Thread thread, final Throwable throwable)
        {
            log.info("bitcoinj uncaught exception", throwable);
            CrashReporter.saveBackgroundTrace(throwable, packageInfo);
        }
    };

    initMnemonicCode();

    config = new Configuration(PreferenceManager.getDefaultSharedPreferences(this), getResources());
    activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

    blockchainServiceIntent = new Intent(this, BlockchainServiceImpl.class);
    blockchainServiceCancelCoinsReceivedIntent = new Intent(BlockchainService.ACTION_CANCEL_COINS_RECEIVED, null, this,
            BlockchainServiceImpl.class);
    blockchainServiceResetBlockchainIntent = new Intent(BlockchainService.ACTION_RESET_BLOCKCHAIN, null, this, BlockchainServiceImpl.class);

    walletFile = getFileStreamPath(Constants.Files.WALLET_FILENAME_PROTOBUF);

    loadWalletFromProtobuf();

    if (config.versionCodeCrossed(packageInfo.versionCode, VERSION_CODE_SHOW_BACKUP_REMINDER) && !wallet.getImportedKeys().isEmpty())
    {
        log.info("showing backup reminder once, because of imported keys being present");
        config.armBackupReminder();
    }

    config.updateLastVersionCode(packageInfo.versionCode);

    afterLoadWallet();

    cleanupFiles();
}
 
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:56,代码来源:WalletApplication.java


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