All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.daedafusion.service.bootstrap.BootstrapServiceFramework Maven / Gradle / Ivy

There is a newer version: 1.1
Show newest version
package com.daedafusion.service.bootstrap;

import com.daedafusion.sf.ServiceFramework;
import com.daedafusion.sf.ServiceFrameworkException;
import com.daedafusion.sf.ServiceFrameworkFactory;
import org.apache.log4j.Logger;

/**
 * Created by mphilpot on 7/24/14.
 */
public class BootstrapServiceFramework implements Bootstrap
{
    private static final Logger log = Logger.getLogger(BootstrapServiceFramework.class);

    @Override
    public Bootstrap boot() throws BootstrapException
    {
        ServiceFramework framework = ServiceFrameworkFactory.getInstance().getFramework();
        try
        {
            framework.start();
        }
        catch (ServiceFrameworkException e)
        {
            log.error("", e);
            throw new BootstrapException(e);
        }

        return this;
    }

    @Override
    public void teardown()
    {
        ServiceFramework framework = ServiceFrameworkFactory.getInstance().getFramework();

        framework.stop();

        ServiceFrameworkFactory.getInstance().destroy();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy