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

kikaha.urouting.producers.SessionContextProducer Maven / Gradle / Ivy

There is a newer version: 2.1.10.Final
Show newest version
package kikaha.urouting.producers;

import io.undertow.server.HttpServerExchange;
import kikaha.core.modules.security.SecurityContext;
import kikaha.core.modules.security.Session;
import kikaha.urouting.api.ContextProducer;
import kikaha.urouting.api.RoutingException;

import javax.enterprise.inject.Typed;
import javax.inject.Singleton;

@Singleton
@Typed(  ContextProducer.class )
public class SessionContextProducer implements ContextProducer {

	@Override
	public Session produce( HttpServerExchange exchange ) throws RoutingException {
		final SecurityContext context = (SecurityContext)exchange.getSecurityContext();
		return context != null ? context.getCurrentSession() : null;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy