com.devonfw.module.cxf.common.impl.server.rest.CxfServerRestAutoConfiguration Maven / Gradle / Ivy
package com.devonfw.module.cxf.common.impl.server.rest;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.ws.rs.ext.Provider;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.devonfw.module.json.common.base.ObjectMapperFactory;
import com.devonfw.module.rest.common.api.RestService;
import com.devonfw.module.rest.service.impl.RestServiceExceptionFacade;
import com.devonfw.module.service.common.api.constants.ServiceConstants;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
/**
* {@link Configuration} for REST (JAX-RS) services server using Apache CXF.
*
* @since 3.0.0
*/
@Configuration
public class CxfServerRestAutoConfiguration {
/** Logger instance. */
private static final Logger LOG = LoggerFactory.getLogger(CxfServerRestAutoConfiguration.class);
@Value("${security.expose.error.details:false}")
private boolean exposeInternalErrorDetails;
@Value("${service.rest.find-by-name:true}")
private boolean findRestServicesByName;
@Inject
private ConfigurableApplicationContext applicationContext;
@Inject
private SpringBus springBus;
@Inject
private ObjectMapperFactory objectMapperFactory;
/**
* @return the {@link Server} that provides the REST (JAX-RS) services.
*/
@Bean
public Server jaxRsServer() {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy