package org.openiot.scheduler.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; /** * 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 { private Set<Object> singletons = new HashSet<Object>(); private Set<Class<?>> empty = new HashSet<Class<?>>(); public JaxRsActivator() { singletons.add(new SchedulerRsControler()); } @Override public Set<Class<?>> getClasses() { return empty; } @Override public Set<Object> getSingletons() { return singletons; } }