io.nuls.kernel.lite.annotation.Autowired类的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中io.nuls.kernel.lite.annotation.Autowired类的一些代码示例,展示了Autowired类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Autowired类的具体详情如下:
包路径:io.nuls.kernel.lite.annotation.Autowired
类名称:Autowired

Autowired介绍

暂无

代码示例

代码示例来源:origin: nuls-io/nuls

public class TotalCoinTask implements Runnable {
  @Autowired
  private UtxoLedgerUtxoStorageService utxoLedgerUtxoStorageService;

代码示例来源:origin: nuls-io/nuls

private static boolean injectionBeanField(Object obj, Field field) throws Exception {
  Annotation[] anns = field.getDeclaredAnnotations();
  if (anns == null || anns.length == 0) {
    return true;
  }
  Annotation automired = getFromArray(anns, Autowired.class);
  if (null == automired) {
    return true;
  }
  String name = ((Autowired) automired).value();
  Object value = null;
  if (null == name || name.trim().length() == 0) {
    Set<String> nameSet = CLASS_NAME_SET_MAP.get(field.getType());
    if (nameSet == null || nameSet.isEmpty()) {
      throw new Exception("Can't find the bean,field:" + field.getName());
    } else if (nameSet.size() == 1) {
      name = nameSet.iterator().next();
    } else {
      name = field.getName();
    }
  }
  value = getBean(name);
  if (null == value) {
    throw new Exception("Can't find the bean named:" + name);
  }
  field.setAccessible(true);
  field.set(obj, value);
  field.setAccessible(false);
  return true;
}

代码示例来源:origin: nuls-io/nuls

public class UtxoAccountsBalanceServiceImpl implements UtxoAccountsBalanceService {
  @Autowired
  UtxoAccountsStorageService utxoAccountsStorageService;
  @Override

代码示例来源:origin: nuls-io/nuls

@Component
public class UtxoAccountsThread implements Runnable {
  @Autowired
  private UtxoAccountsService utxoAccountsService;
  @Autowired
  private UtxoAccountsStorageService utxoAccountsStorageService;

代码示例来源:origin: nuls-io/nuls

public class RewardStatisticsProcess {
  @Autowired
  private DownloadService downloadService;
  @Autowired
  private BlockService blockService;
  @Autowired
  private AccountService accountService;
  @Autowired
  private PocRewardCacheService service;

代码示例来源:origin: nuls-io/nuls

public class AliasTransactionValidator implements NulsDataValidator<AliasTransaction> {
  @Autowired
  private AliasService aliasService;
  @Autowired
  private AliasStorageService aliasStorageService;
  @Autowired
  private AccountLedgerService accountledgerService;
  @Autowired
  private AccountService accountService;

代码示例来源:origin: nuls-io/nuls

public class CreateContractTxProcessor implements TransactionProcessor<CreateContractTransaction>, InitializingBean {
  @Autowired
  private ContractAddressStorageService contractAddressStorageService;
  @Autowired
  private ContractTxService contractTxService;
  @Autowired
  private ContractService contractService;
  @Autowired
  private ContractExecuteResultStorageService contractExecuteResultStorageService;
  @Autowired
  private ContractCollectionStorageService contractCollectionStorageService;
  @Autowired
  private VMHelper vmHelper;

代码示例来源:origin: nuls-io/nuls

@Component
public class CheckUnConfirmTxThread implements Runnable {
  @Autowired
  private AccountLedgerServiceImpl accountLedgerService;
  @Autowired
  private TransactionService transactionService;
  @Autowired
  private LedgerService ledgerService;
  @Autowired
  private UnconfirmedTransactionStorageService unconfirmedTransactionStorageService;
  @Autowired
  private LocalUtxoStorageService localUtxoStorageService;
  @Autowired
  private BalanceManager balanceManager;
  @Autowired
  private TransactionInfoService transactionInfoService;

代码示例来源:origin: nuls-io/nuls

public class DeleteContractTxValidator implements NulsDataValidator<DeleteContractTransaction> {
  @Autowired
  private ContractAddressStorageService contractAddressStorageService;
  @Autowired
  private ContractUtxoService contractUtxoService;

代码示例来源:origin: nuls-io/nuls

@Autowired
private BlockService blockService;
@Autowired
private LedgerService ledgerService;
@Autowired
private TransactionQueueStorageService transactionQueueStorageService;
@Autowired
private TransactionCacheStorageService transactionCacheStorageService;

代码示例来源:origin: nuls-io/nuls

public class StopAgentTxProcessor implements TransactionProcessor<StopAgentTransaction> {
  @Autowired
  private AgentStorageService agentStorageService;
  @Autowired
  private LedgerService ledgerService;
  @Autowired
  private AccountLedgerService accountLedgerService;
  @Autowired
  private DepositStorageService depositStorageService;

代码示例来源:origin: nuls-io/nuls

public class CancelDepositTxProcessor implements TransactionProcessor<CancelDepositTransaction> {
  @Autowired
  private DepositStorageService depositStorageService;
  @Autowired
  private AgentStorageService agentStorageService;
  @Autowired
  private LedgerService ledgerService;

代码示例来源:origin: nuls-io/nuls

public class DepositTxValidator extends BaseConsensusProtocolValidator<DepositTransaction> {
  @Autowired
  private PunishLogStorageService punishLogStorageService;
  @Autowired
  private AgentStorageService agentStorageService;
  @Autowired
  private DepositStorageService depositStorageService;

代码示例来源:origin: nuls-io/nuls

public class RedPunishTxProcessor implements TransactionProcessor<RedPunishTransaction> {
  @Autowired
  private PunishLogStorageService storageService;
  @Autowired
  private AgentStorageService agentStorageService;
  @Autowired
  private DepositStorageService depositStorageService;
  @Autowired
  private LedgerService ledgerService;
  @Autowired
  private AccountLedgerService accountLedgerService;

代码示例来源:origin: nuls-io/nuls

public class CallContractTxProcessor implements TransactionProcessor<CallContractTransaction> {
  @Autowired
  private VMHelper vmHelper;
  @Autowired
  private ContractAddressStorageService contractAddressStorageService;
  @Autowired
  private ContractTokenTransferStorageService contractTokenTransferStorageService;
  @Autowired
  private ContractService contractService;
  @Autowired
  private ContractUtxoService contractUtxoService;
  @Autowired
  private LedgerService ledgerService;
  @Autowired
  private AccountLedgerService accountLedgerService;
  @Autowired
  private ContractBalanceManager contractBalanceManager;

代码示例来源:origin: nuls-io/nuls

/**
 * @author: Charlie
 * @date: 2018/9/4
 */
@Component
public class BifurcationEvidenceStorageServiceImpl implements BifurcationEvidenceStorageService, InitializingBean {
  @Autowired
  private DBService dbService;

  @Override
  public Map<String, List<EvidencePo>> getBifurcationEvidence() {
    Map<String, List<EvidencePo>> map = dbService.getModel(ConsensusStorageConstant.DB_NAME_CONSENSUS_BIFURCATION_EVIDENCE,
        ConsensusStorageConstant.DB_BIFURCATION_EVIDENCE_KEY.getBytes(), Map.class);
    return map;
  }

  @Override
  public boolean save(Map<String, List<EvidencePo>> map) {
    Result result = dbService.putModel(ConsensusStorageConstant.DB_NAME_CONSENSUS_BIFURCATION_EVIDENCE,
        ConsensusStorageConstant.DB_BIFURCATION_EVIDENCE_KEY.getBytes(), map);
    return result.isSuccess();
  }

  @Override
  public void afterPropertiesSet() throws NulsException {
    dbService.createArea(ConsensusStorageConstant.DB_NAME_CONSENSUS_BIFURCATION_EVIDENCE);
  }
}

代码示例来源:origin: nuls-io/nuls

/**
 * @desription:
 * @author: PierreLuo
 * @date: 2018/6/8
 */
@Component
public class DeleteContractTxProcessor implements TransactionProcessor<DeleteContractTransaction> {

  @Autowired
  private ContractService contractService;

  @Override
  public Result onRollback(DeleteContractTransaction tx, Object secondaryData) {
    contractService.deleteContractExecuteResult(tx.getHash());
    return Result.getSuccess();
  }

  @Override
  public Result onCommit(DeleteContractTransaction tx, Object secondaryData) {
    ContractResult contractResult = tx.getContractResult();
    contractService.saveContractExecuteResult(tx.getHash(), contractResult);
    return Result.getSuccess();
  }

  @Override
  public ValidateResult conflictDetect(List<Transaction> txList) {
    return ValidateResult.getSuccessResult();
  }
}

代码示例来源:origin: nuls-io/nuls

@Service
public class UtxoAccountsStorageServiceImpl implements UtxoAccountsStorageService, InitializingBean {
  @Autowired
  private DBService dbService;
  @Autowired
  BlockService blockService;
  @Autowired
  LedgerService ledgerService;
  @Override

代码示例来源:origin: nuls-io/nuls

@Autowired
private MessageBusService messageBusService;
@Autowired
private LedgerService ledgerService;
@Autowired
private ConsensusService consensusService;
@Autowired
private AccountService accountService;

代码示例来源:origin: nuls-io/nuls

public class ContractUtxoServiceImpl implements ContractUtxoService {
  @Autowired
  private LedgerService ledgerService;
  @Autowired
  private ContractUtxoStorageService contractUtxoStorageService;
  @Autowired
  private ContractTransferTransactionStorageService contractTransferTransactionStorageService;
  @Autowired
  private ContractBalanceManager contractBalanceManager;
  @Autowired
  private AccountLedgerService accountLedgerService;

相关文章

Autowired类方法