com.aol.micro.server.spring.boot.BootPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-spring-boot Show documentation
Show all versions of micro-spring-boot Show documentation
Opinionated rest microservices with Spring Boot
package com.aol.micro.server.spring.boot;
import java.util.Map;
import java.util.function.Function;
import javax.ws.rs.core.FeatureContext;
import cyclops.companion.MapXs;
import cyclops.collections.immutable.PersistentMapX;
import cyclops.collections.immutable.PersistentSetX;
import org.glassfish.jersey.CommonProperties;
import com.aol.micro.server.Plugin;
import com.aol.micro.server.rest.jersey.SpringBootJerseyRestApplication;
import com.aol.micro.server.spring.SpringBuilder;
/**
*
* @author johnmcclean
*
*/
public class BootPlugin implements Plugin{
/**
* @return Engine for building Spring Context
*/
public SpringBuilder springBuilder(){
return new BootFrontEndApplicationConfigurator();
}
@Override
public PersistentSetX springClasses() {
return PersistentSetX.of(SpringBootJerseyRestApplication.class);
}
@Override
public Function> jacksonFeatureProperties(){
return context-> PersistentMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.'
+ context.getConfiguration().getRuntimeType().name().toLowerCase(),true));
}
}