import com.google.common.collect.ImmutableSet;
import java.util.HashSet;
import java.util.Set;
+import javax.inject.Inject;
+import javax.inject.Singleton;
import javax.ws.rs.core.Application;
import org.opendaylight.restconf.nb.rfc8040.handlers.DOMMountPointServiceHandler;
import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.NormalizedNodeJsonBodyWriter;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.NormalizedNodeXmlBodyWriter;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.XmlNormalizedNodeBodyReader;
+import org.opendaylight.restconf.nb.rfc8040.jersey.providers.errors.RestconfDocumentedExceptionMapper;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch.JsonToPatchBodyReader;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch.PatchJsonBodyWriter;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch.PatchXmlBodyWriter;
import org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema.SchemaExportContentYinBodyWriter;
import org.opendaylight.restconf.nb.rfc8040.services.wrapper.ServicesWrapper;
+@Singleton
public class RestconfApplication extends Application {
+
private final SchemaContextHandler schemaContextHandler;
private final DOMMountPointServiceHandler mountPointServiceHandler;
private final ServicesWrapper servicesWrapper;
+ @Inject
public RestconfApplication(SchemaContextHandler schemaContextHandler,
DOMMountPointServiceHandler mountPointServiceHandler, ServicesWrapper servicesWrapper) {
this.schemaContextHandler = schemaContextHandler;
singletons.add(new JsonToPatchBodyReader(schemaContextHandler, mountPointServiceHandler));
singletons.add(new XmlNormalizedNodeBodyReader(schemaContextHandler, mountPointServiceHandler));
singletons.add(new XmlToPatchBodyReader(schemaContextHandler, mountPointServiceHandler));
+ singletons.add(new RestconfDocumentedExceptionMapper(schemaContextHandler));
return singletons;
}
}