All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.java.trueupdate.server.maven.MavenUpdateServerApplication Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2013 Schlichtherle IT Services & Stimulus Software.
 * All rights reserved. Use is subject to license terms.
 */
package net.java.trueupdate.server.maven;

import java.util.*;
import javax.annotation.concurrent.Immutable;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import net.java.trueupdate.jaxrs.server.UpdateServiceExceptionMapper;

/**
 * An application which provides the class {@link UpdateServiceExceptionMapper}
 * and a new {@link MavenUpdateServer}.
 *
 * @author Christian Schlichtherle
 */
@ApplicationPath("/")
@Immutable
public final class MavenUpdateServerApplication extends Application {

    /** Returns a set with {@link UpdateServiceExceptionMapper}. */
    @SuppressWarnings("unchecked")
    @Override public Set> getClasses() {
        return (Set) Collections.singleton(UpdateServiceExceptionMapper.class);
    }

    /** Returns a set with a new {@link MavenUpdateServer}. */
    @Override public Set getSingletons() {
        return Collections.singleton((Object) new MavenUpdateServer());
    }
}