Ejemplo n.º 1
0
 public MinaInstance(
     MinaConfig config, Application application, ScheduledThreadPoolExecutor executor) {
   // Make sure we know about exceptions
   log = getLogger(getClass());
   this.config = config;
   this.executor = executor;
   if (config.getNodeId() != null) myNodeId = config.getNodeId();
   else myNodeId = generateNodeId();
   log.fatal("Mina running on udp port " + config.getListenUdpPort() + ", node id: " + myNodeId);
   messageMgr = new MessageMgr(this);
   ccm = new CCMgr(this);
   netMgr = new NetworkMgr(this);
   try {
     bidStrategy = (BidStrategy) Class.forName(config.getBidStrategyClass()).newInstance();
     bidStrategy.setMinaInstance(this);
   } catch (Exception e) {
     throw new SeekInnerCalmException(e);
   }
   scm = new StreamConnsMgr(this);
   streamMgr = new StreamMgr(this);
   prm = new PageRequestMgr(this);
   flowRateMgr = new FlowRateMgr(this);
   if (config.isSupernode()) supernodeMgr = new SupernodeMgr(this);
   if (config.isAgoric()) {
     sellMgr = new SellMgr(this);
     buyMgr = new BuyMgr(this);
     escrowMgr = new EscrowMgr(this);
   }
   if (config.getRunEscrowProvider()) {
     escrowProvider = new EscrowProvider(this);
   }
   badNodes = new BadNodeList(this);
   eventMgr = new EventMgr(this);
   sourceMgr = new SourceMgr(this);
   streamAdvertiser = new StreamAdvertiser(this);
   implementingApplication = application;
 }
Ejemplo n.º 2
0
 public Log getLogger(Class callerClass) {
   return LogFactory.getLog(callerClass.getName() + ".INSTANCE." + myNodeId);
 }