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 *     bstefanescu
011 */
012package org.nuxeo.ecm.webengine.jaxrs;
013
014import java.io.IOException;
015import java.util.Map;
016
017import javax.ws.rs.core.Application;
018
019import org.osgi.framework.Bundle;
020
021/**
022 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
023 */
024public interface ApplicationFactory {
025
026    /**
027     * Create a new application instance given the bundle declaring the application and the attributes specified in the
028     * manifest.
029     *
030     * @param bundle the bundle defining the application
031     * @param args the arguments parsed from manifest WebModule entry.
032     */
033    Application getApplication(Bundle bundle, Map<String, String> args) throws ReflectiveOperationException,
034            IOException;
035
036}