com.expanset.jersey.utils.RequestScopeUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jersey-contrib Show documentation
Show all versions of jersey-contrib Show documentation
Features for static handling, securing etc
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() {}
}