本文整理汇总了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();
}
示例2: checkFail
import org.bitcoinj.utils.Threading; //导入方法依赖的package包/类
@After
public void checkFail() {
assertFalse(fail.get());
Threading.throwOnLockCycles();
}
示例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();
}