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

com.aol.micro.server.rest.jersey.JerseyPlugin Maven / Gradle / Ivy

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);
		
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy