congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RequestScope.activate
Code IndexAdd Tabnine to your IDE (free)

How to use
activate
method
in
org.glassfish.jersey.process.internal.RequestScope

Best Java code snippets using org.glassfish.jersey.process.internal.RequestScope.activate (Showing top 20 results out of 315)

origin: jersey/jersey

@Override
protected void activate(RequestContext context, RequestContext oldContext) {
  super.activate(context, oldContext);
  if (oldContext != null) {
    CdiRequestContext oldRequestContext = (CdiRequestContext) oldContext;
    requestContextController.deactivate();
    requestContextController.dissociate(oldRequestContext.getStore());
  }
  CdiRequestContext cdiRequestContext = (CdiRequestContext) context;
  requestContextController.associate(cdiRequestContext.getStore());
  requestContextController.activate();
}
origin: jersey/jersey

/**
 * Runs the {@link Callable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}.
 * @throws Exception Exception thrown by the {@code task}.
 */
public <T> T runInScope(RequestContext context, Callable<T> task) throws Exception {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Runnable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 */
public void runInScope(RequestContext context, Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Runnable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 */
public void runInScope(Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Runnable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 */
public void runInScope(RequestContext context, Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Runnable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 */
public void runInScope(Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the request scope initialized
 * from the {@link RequestContext scope context}.
 * The {@link RequestContext scope context} is NOT released by the method (this
 * must be done explicitly). The current thread might be already in any request scope
 * and in that case the scope will be changed to the scope defined by the
 * {@link RequestContext scope context}. At the end of the method the request
 * scope is returned to its original state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}
 */
public <T> T runInScope(RequestContext context, Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the request scope initialized
 * from the {@link RequestContext scope context}.
 * The {@link RequestContext scope context} is NOT released by the method (this
 * must be done explicitly). The current thread might be already in any request scope
 * and in that case the scope will be changed to the scope defined by the
 * {@link RequestContext scope context}. At the end of the method the request
 * scope is returned to its original state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}
 */
public <T> T runInScope(RequestContext context, Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the new request scope. The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state. The newly created {@link RequestContext scope context} will be
 * implicitly released at the end of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 * @param <T>  {@code task} result type.
 * @return result returned by the {@code task}.
 */
public <T> T runInScope(Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the new request scope. The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state. The newly created {@link RequestContext scope context} will be
 * implicitly released at the end of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 * @param <T>  {@code task} result type.
 * @return result returned by the {@code task}.
 */
public <T> T runInScope(Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Callable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}.
 * @throws Exception Exception thrown by the {@code task}.
 */
public <T> T runInScope(RequestContext context, Callable<T> task) throws Exception {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Callable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 * @param <T>  {@code task} result type.
 * @return result returned by the {@code task}.
 * @throws Exception Exception thrown by the {@code task}.
 */
public <T> T runInScope(Callable<T> task) throws Exception {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: jersey/jersey

/**
 * Runs the {@link Callable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 * @param <T>  {@code task} result type.
 * @return result returned by the {@code task}.
 * @throws Exception Exception thrown by the {@code task}.
 */
public <T> T runInScope(Callable<T> task) throws Exception {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.core/jersey-common

/**
 * Runs the {@link Runnable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 */
public void runInScope(RequestContext context, Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.core/jersey-common

/**
 * Runs the {@link Runnable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 */
public void runInScope(Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

/**
 * Runs the {@link Runnable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 */
public void runInScope(RequestContext context, Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

/**
 * Runs the {@link Runnable task} in the new request scope. The current thread might
 * be already in any request scope and in that case the scope will be changed to the
 * scope defined by the {@link RequestContext scope context}. At the end of
 * the method the request scope is returned to its original state. The newly created
 * {@link RequestContext scope context} will be implicitly released at the end
 * of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 */
public void runInScope(Runnable task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.core/jersey-common

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the new request scope. The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state. The newly created {@link RequestContext scope context} will be
 * implicitly released at the end of the method call except the task will call
 * {@link RequestScope#suspendCurrent}.
 *
 * @param task Task to be executed.
 * @param <T>  {@code task} result type.
 * @return result returned by the {@code task}.
 */
public <T> T runInScope(Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  final RequestContext context = createContext();
  try {
    activate(context, oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.core/jersey-common

/**
 * Runs the {@link org.glassfish.jersey.internal.util.Producer task} in the request scope initialized
 * from the {@link RequestContext scope context}.
 * The {@link RequestContext scope context} is NOT released by the method (this
 * must be done explicitly). The current thread might be already in any request scope
 * and in that case the scope will be changed to the scope defined by the
 * {@link RequestContext scope context}. At the end of the method the request
 * scope is returned to its original state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}
 */
public <T> T runInScope(RequestContext context, Producer<T> task) {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
origin: org.glassfish.jersey.core/jersey-common

/**
 * Runs the {@link Callable task} in the request scope initialized from the
 * {@link RequestContext scope context}. The {@link RequestContext
 * scope context} is NOT released by the method (this must be done explicitly). The
 * current thread might be already in any request scope and in that case the scope
 * will be changed to the scope defined by the {@link RequestContext scope
 * instance}. At the end of the method the request scope is returned to its original
 * state.
 *
 * @param context The request scope context from which the request scope will be initialized.
 * @param task    Task to be executed.
 * @param <T>     {@code task} result type.
 * @return result returned by the {@code task}.
 * @throws Exception Exception thrown by the {@code task}.
 */
public <T> T runInScope(RequestContext context, Callable<T> task) throws Exception {
  final RequestContext oldContext = retrieveCurrent();
  try {
    activate(context.getReference(), oldContext);
    return Errors.process(task);
  } finally {
    release(context);
    resume(oldContext);
  }
}
org.glassfish.jersey.process.internalRequestScopeactivate

Javadoc

Stores the provided RequestContext to thread-local variable belonging to current request scope.

Popular methods of RequestScope

  • current
  • referenceCurrent
    Get a new reference for to currently running request scope instance. This call prevents automatic Re
  • runInScope
    Runs the org.glassfish.jersey.internal.util.Producer in the request scope initialized from the Reque
  • retrieveCurrent
  • <init>
  • createContext
    Creates a new instance of the RequestContext. This instance can be then used to run task in the requ
  • release
    Releases the provided RequestContext to thread-local variable belonging to current request scope.
  • resume
    Resumes the provided RequestContext to thread-local variable belonging to current request scope.
  • createInstance
    Creates a new instance of the RequestScope.Instance. This instance can be then used to run task in t
  • isActive
  • resumeCurrent
  • setCurrent
  • resumeCurrent,
  • setCurrent,
  • shutdown,
  • suspend

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now