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

com.expanset.jersey.utils.RequestScopeUtils Maven / Gradle / Ivy

The newest version!
package com.expanset.jersey.utils;

import org.glassfish.jersey.process.internal.RequestScope;
import org.glassfish.jersey.process.internal.RequestScope.Instance;

public final class RequestScopeUtils {
	
	public static boolean isInRequestScope(RequestScope requestScope) {
		// NOTE Because there is no method to direct check active scope. 
		final Instance scope = requestScope.suspendCurrent();
		if(scope == null) {
			return false;
		}
		scope.release();
		return true;
	}
	
	private RequestScopeUtils() {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy