com.aol.micro.server.rest.jersey.JerseyPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-jersey Show documentation
Show all versions of micro-jersey Show documentation
Opinionated rest microservices
The newest version!
package com.aol.micro.server.rest.jersey;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import javax.servlet.ServletContextListener;
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.RestConfiguration;
import com.aol.micro.server.servers.model.ServerData;
public class JerseyPlugin implements Plugin{
@Override
public Optional restServletConfiguration(){
return Optional.of(new ConfigureMainServlet().servletConfig());
}
@Override
public Function> jacksonFeatureProperties(){
return context-> PersistentMapX.fromMap(MapXs.of( CommonProperties.MOXY_JSON_FEATURE_DISABLE + '.'
+ context.getConfiguration().getRuntimeType().name().toLowerCase(),true));
}
@Override
public Optional jaxWsRsApplication(){
return Optional.of(JerseyRestApplication.class.getCanonicalName());
}
@Override
public PersistentSetX> servletContextListeners(){
Function f = serverData ->new JerseySpringIntegrationContextListener(serverData);
return PersistentSetX.of(f);
}
}