001/*
002 * Copyright (c) 2014 Maxim Yunusov
003 *    Licensed under the Apache License, Version 2.0 (the "License");
004 *    you may not use this file except in compliance with the License.
005 *    You may obtain a copy of the License at
006 *
007 *        http://www.apache.org/licenses/LICENSE-2.0
008 *
009 *    Unless required by applicable law or agreed to in writing, software
010 *    distributed under the License is distributed on an "AS IS" BASIS,
011 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 *    See the License for the specific language governing permissions and
013 *    limitations under the License.
014 */
015
016package org.maxur.perfmodel.backend;
017
018import org.glassfish.hk2.api.ServiceLocator;
019import org.glassfish.hk2.api.ServiceLocatorFactory;
020import org.maxur.perfmodel.backend.service.Application;
021
022import static org.glassfish.hk2.utilities.ServiceLocatorUtilities.bind;
023
024/**
025 * Performance Model Calculator Standalone Launcher.
026 *
027 * @author Maxim Yunusov
028 * @version 1.0 14.09.2014
029 */
030public final class Launcher {
031
032    /**
033     * Utils class.
034     */
035    private Launcher() {
036    }
037
038    /**
039     * Command line entry point. This method kicks off the building of a application  object
040     * and executes it.
041     * <p>
042     * @param args - arguments of command.
043     */
044    public static void main(String[] args) {
045        final ServiceLocatorFactory locatorFactory = ServiceLocatorFactory.getInstance();
046        final ServiceLocator locator = locatorFactory.create("PmcLocator");
047        bind(locator, new Config());
048        final Application application = locator.getService(Application.class);
049        application.start();
050    }
051
052
053}