001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Nuxeo - initial API and implementation
011 *
012 * $Id$
013 */
014
015package org.nuxeo.ecm.core;
016
017import org.nuxeo.ecm.core.lifecycle.LifeCycleService;
018import org.nuxeo.ecm.core.lifecycle.impl.LifeCycleServiceImpl;
019import org.nuxeo.ecm.core.security.SecurityService;
020import org.nuxeo.runtime.api.Framework;
021
022/**
023 * CoreSession facade for services provided by NXCore module.
024 * <p>
025 * This is the main entry point to the core services.
026 *
027 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
028 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a>
029 */
030public final class NXCore {
031
032    private NXCore() {
033    }
034
035    /**
036     * Returns the life cycle service.
037     *
038     * @see LifeCycleServiceImpl
039     * @return the life cycle service
040     */
041    public static LifeCycleService getLifeCycleService() {
042        return (LifeCycleService) Framework.getRuntime().getComponent(LifeCycleServiceImpl.NAME);
043    }
044
045    public static SecurityService getSecurityService() {
046        return (SecurityService) Framework.getRuntime().getComponent(SecurityService.NAME);
047    }
048
049}