/** * Lookup a child service in the ServiceManager with a relative path. * <p> * The lookup is a convenience method based on the ServiceManager's lookup. * * @param path a relative path to the service. */ default ServiceRef service(String path) { if (!path.startsWith("/")) { throw new IllegalArgumentException(path + " must start with '/'"); } return services().service(address() + path); }
@Override public void onActive() { _isReplay = false; if (_isActive) { return; } _isActive = true; _serviceSelf = ServiceRef.current(); if (_journalDelay > 0) { Services manager = _serviceSelf.services(); _timerService = manager.service("timer:").as(Timers.class); Consumer<Cancel> startSave = h->startSave(); _startSaveRef = (Consumer<Cancel>) _serviceSelf.pin(startSave).as(Consumer.class); } super.onActive(); startSave(); }