governator icon indicating copy to clipboard operation
governator copied to clipboard

Using LifecycleManager is not documented right?

Open asafm opened this issue 8 years ago • 4 comments

In the docs it says:

  1. Create an injector using the builder, and then
  2. LifecycleManager manager = injector.getInstance(LifecycleManager.class); manager.start();

I'm using version 1.12.0 (from Jan 2016) and from some reason LifecycleManager class doesn't have start() or stop() method.

How should I enable the Lifecycle feature?

asafm avatar Jun 20 '16 05:06 asafm

the issue is likely that the code above is referencing "com.netflix.governator.LifecycleManager" (governator-core), rather than "com.netflix.governator.lifecycle.LifecycleManager" (governator-legacy) which does have a start() method. We're working to simplify the Governator internals and move away from governator-legacy, but work is not yet complete. In the meantime if you change your imports to use "com.netflix.governator.lifecycle.LifecycleManager", then lifecycle management can be started per the docs.

tcellucci avatar Jul 07 '16 22:07 tcellucci

Sounds good. I think the correct approach would be to document it properly - exactly what you wrote above until you will fix it

asafm avatar Jul 10 '16 13:07 asafm

I would simply change this page to say: "Make sure you import the correct class which is com.netflix.governator.lifecycle.LifecycleManager and not com.netflix.governator.lifecycle.LifecycleManager which is the internal class"

asafm avatar Feb 16 '17 17:02 asafm

Just stumbled upon this also. Not sure, what is there right import here.

com.netflix.governator.guice.LifecycleInjector

has a start method, while

com.netflix.governator.LifecycleInjector

has not. So what is the correct approch?

svenkubiak avatar Apr 24 '17 09:04 svenkubiak