Package com.netflix.governator.guice.actions

Source Code of com.netflix.governator.guice.actions.LifecycleManagerStarter

package com.netflix.governator.guice.actions;

import com.google.inject.Injector;
import com.netflix.governator.guice.PostInjectorAction;
import com.netflix.governator.lifecycle.LifecycleManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LifecycleManagerStarter implements PostInjectorAction {
    private static final Logger log = LoggerFactory.getLogger(LifecycleManagerStarter.class);

    @Override
    public void call(Injector injector) {
        LifecycleManager manager = injector.getInstance(LifecycleManager.class);
        try {
            manager.start();
        } catch (Exception e) {
            log.error("Failed to start LifecycleManager", e);
        }
    }
}
TOP

Related Classes of com.netflix.governator.guice.actions.LifecycleManagerStarter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.