@OnInit public void init() { _podServer.init(); }
@OnInit private void onInit() { _self = ServiceRef.current(); }
@OnInit public void onInit() { ServiceRefAmp serviceRef = ServiceRefAmp.current(); /* _deployService = serviceRef.as(PodsService.class); */ // ServiceManagerAmp manager = AmpSystem.getCurrentManager(); /* _rootService = manager.lookup("pod://cluster_root" + PodsServiceCluster.ADDRESS) .as(PodsServiceCluster.class); */ // serviceRef.pin(this).bind("public://" + PodsManagerService.ADDRESS); }
@OnInit public void onStart() { _serviceRef = ServiceRef.current(); ServicesAmp manager = AmpSystem.currentManager(); EventsSync events = manager.service(EventsSync.class); // XXX: events.subscriber(ServerOnUpdate.class, s->onServerUpdate(s)); // XXX: events.subscriber(PodOnUpdate.class, p->onPodUpdate(p)); }
@OnInit public void onInit(Result<Void> result) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "onInit: id=" + _id + ", url=" + toDebugSafe(_url)); } try { connect(); result.ok(null); } catch (SQLException e) { result.fail(e); } }
@OnInit private void onStart() { _lifecycle.toActive(); _timerSelf = ServiceRef.current().as(TimerServiceAmp.class); }
@OnInit public void init() { Asset table = AnnotationsUtil.getAnnotation(_entityClass, Asset.class); _entityDesc = new AssetInfo<>(_entityClass, _idClass, table, null); _idDesc = _entityDesc.id(); /* //xxx: inect hack _schemaManager = new SchemaManager(); _schemaManager.initializeSchema(_entityClass, _entityClass.getPackage(), _db, Result.ignore()); */ }
@OnInit public void onInit(Result<Void> result) { _self = ServiceRef.current().service(_id).as(RabbitPipeImpl.class); try { _config = RabbitConfig.from(_c, _id); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "onInit: " + _id + ", " + _config); } connect(); result.ok(null); } catch (Exception e) { _logger.log(Level.WARNING, "onInit: cannot connect, " + _id + ", " + _config, e); result.fail(e); } }
@OnInit public void init() { _pipes.publish((out, e) -> ready(out)); }
@OnInit public void init() { _pipes.consume((message, exception, fail) -> next(message)); }
@OnInit public void onActive() { FileChangeService listener = new FileChangeService(); Services manager = Services.current(); _fileTable.addListener(manager.newService(listener).as(TableListener.class)); // _dirTable.addListener(new DirChangeListener()); }
@OnInit public void init() { timers.runAfter(this::fire, 2, TimeUnit.SECONDS, Result.ignore()); }
@OnInit public void onInit() throws Exception { String address = ServiceRef.current().address() + _id; _logger.log(Level.CONFIG, "onInit: id=" + _id + ", service address=" + address); _jdbcConfig = JdbcConfig.from(_config, address); _logger.log(Level.CONFIG, "onInit: config=" + _jdbcConfig); Properties props = new Properties(); if (_jdbcConfig.user() != null) { props.setProperty("user", _jdbcConfig.user()); if (_jdbcConfig.pass() != null) { props.setProperty("password", _jdbcConfig.pass()); } } Supplier<JdbcConnection> supplier = new ConnectionSupplier(_jdbcConfig.url(), props, _jdbcConfig.testQueryBefore(), _jdbcConfig.testQueryAfter()); ServiceBuilder builder = Services.current().newService(JdbcConnection.class, supplier); ServiceRef ref = builder.workers(_jdbcConfig.poolSize()).start(); _conn = ref.as(JdbcConnection.class); }