• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java API类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中nxt.http.API的典型用法代码示例。如果您正苦于以下问题:Java API类的具体用法?Java API怎么用?Java API使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: shutdown

import nxt.http.API; //导入依赖的package包/类
public static void shutdown() {
    Logger.logShutdownMessage("Shutting down...");
    API.shutdown();
    Users.shutdown();
    Peers.shutdown();
    ThreadPool.shutdown();
    Db.shutdown();
    if(BlockchainProcessorImpl.oclVerify) {
        OCLPoC.destroy();
    }
    Logger.logShutdownMessage("Burst server " + VERSION + " stopped.");
    Logger.shutdown();
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:14,代码来源:Nxt.java


示例2: shutdown

import nxt.http.API; //导入依赖的package包/类
public static void shutdown() {
    Logger.logShutdownMessage("Shutting down...");
    API.shutdown();
    Users.shutdown();
    Peers.shutdown();
    ThreadPool.shutdown();
    Db.shutdown();
    Logger.logShutdownMessage("Nxt server " + VERSION + " stopped.");
    Logger.shutdown();
}
 
开发者ID:giannisKonst,项目名称:blockchain,代码行数:11,代码来源:Nxt.java


示例3: shutdown

import nxt.http.API; //导入依赖的package包/类
public static void shutdown() {
    Logger.logShutdownMessage("Shutting down...");
    API.shutdown();
    Users.shutdown();
    ThreadPool.shutdown();
    Peers.shutdown();
    Db.shutdown();
    Logger.logShutdownMessage("Horizon server " + VERSION + " stopped.");
    Logger.shutdown();
    runtimeMode.shutdown();
}
 
开发者ID:BitcoinFullnode,项目名称:ROKOS-OK-Bitcoin-Fullnode,代码行数:12,代码来源:Nxt.java


示例4: shutdown

import nxt.http.API; //导入依赖的package包/类
public static void shutdown() {
    API.shutdown();
    Users.shutdown();
    Peers.shutdown();
    TransactionProcessorImpl.getInstance().shutdown();
    ThreadPool.shutdown();
    Db.shutdown();
    Logger.logMessage("Nas server " + VERSION + " stopped.");
}
 
开发者ID:aspnmy,项目名称:NasCoin,代码行数:10,代码来源:Nxt.java


示例5: displayStatus

import nxt.http.API; //导入依赖的package包/类
private void displayStatus() {
    Block lastBlock = Nxt.getBlockchain().getLastBlock();
    Collection<Generator> allGenerators = Generator.getAllGenerators();

    StringBuilder generators = new StringBuilder();
    for (Generator generator : allGenerators) {
        generators.append(Convert.rsAccount(generator.getAccountId())).append(' ');
    }
    Object optionPaneBackground = UIManager.get("OptionPane.background");
    UIManager.put("OptionPane.background", Color.WHITE);
    Object panelBackground = UIManager.get("Panel.background");
    UIManager.put("Panel.background", Color.WHITE);
    Object textFieldBackground = UIManager.get("TextField.background");
    UIManager.put("TextField.background", Color.WHITE);
    Container statusPanelParent = null;
    if (statusDialog != null && statusPanel != null) {
        statusPanelParent = statusPanel.getParent();
        statusPanelParent.remove(statusPanel);
    }
    statusPanel = new JPanel();
    statusPanel.setLayout(new BoxLayout(statusPanel, BoxLayout.Y_AXIS));

    addLabelRow(statusPanel, "Installation");
    addDataRow(statusPanel, "Application", Nxt.APPLICATION);
    addDataRow(statusPanel, "Version", Nxt.VERSION);
    addDataRow(statusPanel, "Network", (Constants.isTestnet) ? "TestNet" : "MainNet");
    addDataRow(statusPanel, "Working offline", "" + Constants.isOffline);
    addDataRow(statusPanel, "Wallet", String.valueOf(API.getBrowserUri()));
    addDataRow(statusPanel, "Peer port", String.valueOf(Peers.getDefaultPeerPort()));
    addDataRow(statusPanel, "Program folder", String.valueOf(Paths.get(".").toAbsolutePath().getParent()));
    addDataRow(statusPanel, "User folder", String.valueOf(Paths.get(Nxt.getUserHomeDir()).toAbsolutePath()));
    addDataRow(statusPanel, "Database URL", Db.db == null ? "unavailable" : Db.db.getUrl());
    addEmptyRow(statusPanel);

    if (lastBlock != null) {
        addLabelRow(statusPanel, "Last Block");
        addDataRow(statusPanel, "Height", String.valueOf(lastBlock.getHeight()));
        addDataRow(statusPanel, "Timestamp", String.valueOf(lastBlock.getTimestamp()));
        addDataRow(statusPanel, "Time", String.valueOf(new Date(Convert.fromEpochTime(lastBlock.getTimestamp()))));
        addDataRow(statusPanel, "Seconds passed", String.valueOf(Nxt.getEpochTime() - lastBlock.getTimestamp()));
        addDataRow(statusPanel, "Forging", String.valueOf(allGenerators.size() > 0));
        if (allGenerators.size() > 0) {
            addDataRow(statusPanel, "Forging accounts", generators.toString());
        }
    }

    addEmptyRow(statusPanel);
    addLabelRow(statusPanel, "Environment");
    addDataRow(statusPanel, "Number of peers", String.valueOf(Peers.getAllPeers().size()));
    addDataRow(statusPanel, "Available processors", String.valueOf(Runtime.getRuntime().availableProcessors()));
    addDataRow(statusPanel, "Max memory", humanReadableByteCount(Runtime.getRuntime().maxMemory()));
    addDataRow(statusPanel, "Total memory", humanReadableByteCount(Runtime.getRuntime().totalMemory()));
    addDataRow(statusPanel, "Free memory", humanReadableByteCount(Runtime.getRuntime().freeMemory()));
    addDataRow(statusPanel, "Process id", Nxt.getProcessId());
    addEmptyRow(statusPanel);
    addDataRow(statusPanel, "Updated", dateFormat.format(new Date()));
    if (statusDialog == null || !statusDialog.isVisible()) {
        JOptionPane pane = new JOptionPane(statusPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, imageIcon);
        statusDialog = pane.createDialog(wrapper, "Horizon Server Status");
        statusDialog.setVisible(true);
        statusDialog.dispose();
    } else {
        if (statusPanelParent != null) {
            statusPanelParent.add(statusPanel);
            statusPanelParent.revalidate();
        }
        statusDialog.getContentPane().validate();
        statusDialog.getContentPane().repaint();
        EventQueue.invokeLater(statusDialog::toFront);
    }
    UIManager.put("OptionPane.background", optionPaneBackground);
    UIManager.put("Panel.background", panelBackground);
    UIManager.put("TextField.background", textFieldBackground);
}
 
开发者ID:BitcoinFullnode,项目名称:ROKOS-OK-Bitcoin-Fullnode,代码行数:75,代码来源:DesktopSystemTray.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ShlExpr类代码示例发布时间:2022-05-23
下一篇:
Java SignerSecretProvider类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap