Search in sources :

Example 1 with EventCallback

use of org.aion.evtmgr.impl.callback.EventCallback in project aion by aionnetwork.

the class AionPendingStateImpl method init.

public void init(final AionBlockchainImpl blockchain) {
    this.blockchain = blockchain;
    this.transactionStore = blockchain.getTransactionStore();
    this.evtMgr = blockchain.getEventMgr();
    this.pendingTxCache = new PendingTxCache(CfgAion.inst().getTx().getCacheMax());
    this.pendingState = repository.startTracking();
    ees = new EventExecuteService(1000, "EpPS", Thread.MAX_PRIORITY, LOG);
    ees.setFilter(setEvtFilter());
    regBlockEvents();
    IHandler blkHandler = this.evtMgr.getHandler(2);
    if (blkHandler != null) {
        blkHandler.eventCallback(new EventCallback(ees, LOG));
    }
    ees.start(new EpPS());
}
Also used : EventExecuteService(org.aion.evtmgr.impl.es.EventExecuteService) IHandler(org.aion.evtmgr.IHandler) EventCallback(org.aion.evtmgr.impl.callback.EventCallback)

Example 2 with EventCallback

use of org.aion.evtmgr.impl.callback.EventCallback in project aion by aionnetwork.

the class AionPoW method registerCallback.

/**
 * Registers callback for the
 * {@link org.aion.evtmgr.impl.evt.EventConsensus.CALLBACK#ON_SOLUTION}
 * event.
 */
public void registerCallback() {
    IHandler consensusHandler = eventMgr.getHandler(IHandler.TYPE.CONSENSUS.getValue());
    consensusHandler.eventCallback(new EventCallback(ees, LOG));
    IHandler blockHandler = eventMgr.getHandler(IHandler.TYPE.BLOCK0.getValue());
    blockHandler.eventCallback(new EventCallback(ees, LOG));
    IHandler transactionHandler = eventMgr.getHandler(IHandler.TYPE.TX0.getValue());
    transactionHandler.eventCallback(new EventCallback(ees, LOG));
}
Also used : IHandler(org.aion.evtmgr.IHandler) EventCallback(org.aion.evtmgr.impl.callback.EventCallback)

Aggregations

IHandler (org.aion.evtmgr.IHandler)2 EventCallback (org.aion.evtmgr.impl.callback.EventCallback)2 EventExecuteService (org.aion.evtmgr.impl.es.EventExecuteService)1