public virtual void stop() { if (this.state != 3) { return; } this.state = 1; this.log.info("Stopping"); NDC.push(Name); try { stopService(); } catch (Exception throwable) { this.state = 4; this.log.error("Stoping failed", throwable); return; } finally { NDC.pop(); } this.state = 0; this.log.info("Stopped"); }
public virtual void destroy() { if (this.state == 5) { return; } if (this.state != 0) { stop(); } this.log.info("Destroying"); NDC.push(Name); try { destroyService(); } catch (Exception throwable) { this.log.error("Destroying failed", throwable); } finally { NDC.pop(); } this.state = 5; this.log.info("Destroyed"); }
public virtual void start() { if (this.state != 5 && this.state != 0 && this.state != 4) { return; } this.state = 2; this.log.info("Starting"); NDC.push(Name); try { startService(); } catch (Exception exception) { this.state = 4; this.log.error("Starting failed", exception); throw exception; } finally { NDC.pop(); } this.state = 3; this.log.info("Started"); }
public virtual void create() { this.log.info("Creating"); NDC.push(Name); try { createService(); } catch (Exception exception) { this.log.error("Initialization failed", exception); throw exception; } finally { NDC.pop(); } this.log.info("Created"); }