package org.openiot.sdum.core.rest; /** * Copyright (c) 2011-2014, OpenIoT * * This file is part of OpenIoT. * * OpenIoT is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, version 3 of the License. * * OpenIoT is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with OpenIoT. If not, see <http://www.gnu.org/licenses/>. * * Contact: OpenIoT mailto: info@openiot.eu */ import java.util.Set; import java.util.HashSet; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; import org.slf4j.Logger; import org.slf4j.LoggerFactory; //import ch.qos.logback.classic.LoggerContext; //import ch.qos.logback.core.util.StatusPrinter; /** * A class extending {@link Application} and annotated with @ApplicationPath is the Java EE 6 "no XML" approach to activating * JAX-RS. * * <p> * Resources are served relative to the servlet path specified in the {@link ApplicationPath} annotation. * </p> */ /** * @author Nikos Kefalakis (nkef) e-mail: nkef@ait.edu.gr * */ @ApplicationPath("/rest") public class JaxRsActivator extends Application { // Initialize the Logger final static Logger logger = LoggerFactory.getLogger(JaxRsActivator.class.getName()); private Set<Object> singletons = new HashSet<Object>(); private Set<Class<?>> empty = new HashSet<Class<?>>(); public JaxRsActivator() { singletons.add(new ServiceDeliveryUtilityManagerRsControler()); // print Logger's internal state (not required for initialization) // LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // StatusPrinter.print(lc); // logger.debug("Hello world Debug by Logger. From : {}", JaxRsActivator.class.getName()); } @Override public Set<Class<?>> getClasses() { return empty; } @Override public Set<Object> getSingletons() { return singletons; } }