Tabnine Logo
RequestScope.current
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: jersey/jersey

/**
 * Get a new reference for to currently running request scope context. This call
 * prevents automatic {@link RequestContext#release() release} of the scope
 * context once the task that runs in the scope has finished.
 * <p>
 * The returned scope context may be used to run additional task(s) in the
 * same request scope using one of the {@code #runInScope(RequestContext, ...)} methods.
 * </p>
 * <p>
 * Note that the returned context must be {@link RequestContext#release()
 * released} manually once not needed anymore to prevent memory leaks.
 * </p>
 *
 * @return currently active {@link RequestContext request scope context}.
 * @throws IllegalStateException in case there is no active request scope associated
 *                               with the current thread or if the request scope has
 *                               been already shut down.
 * @see #suspendCurrent()
 */
public RequestContext referenceCurrent() throws IllegalStateException {
  return current().getReference();
}
origin: jersey/jersey

/**
 * Get a new reference for to currently running request scope context. This call
 * prevents automatic {@link RequestContext#release() release} of the scope
 * context once the task that runs in the scope has finished.
 * <p>
 * The returned scope context may be used to run additional task(s) in the
 * same request scope using one of the {@code #runInScope(RequestContext, ...)} methods.
 * </p>
 * <p>
 * Note that the returned context must be {@link RequestContext#release()
 * released} manually once not needed anymore to prevent memory leaks.
 * </p>
 *
 * @return currently active {@link RequestContext request scope context}.
 * @throws IllegalStateException in case there is no active request scope associated
 *                               with the current thread or if the request scope has
 *                               been already shut down.
 * @see #suspendCurrent()
 */
public RequestContext referenceCurrent() throws IllegalStateException {
  return current().getReference();
}
origin: jersey/jersey

@Override
public boolean containsKey(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  return instance.contains(ForeignDescriptor.wrap(descriptor));
}
origin: jersey/jersey

@Override
public boolean containsKey(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  return instance.contains(ForeignDescriptor.wrap(descriptor));
}
origin: jersey/jersey

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  instance.remove(ForeignDescriptor.wrap(descriptor));
}
origin: jersey/jersey

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  instance.remove(ForeignDescriptor.wrap(descriptor));
}
origin: jersey/jersey

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  U retVal = instance.get(ForeignDescriptor.wrap(activeDescriptor));
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(ForeignDescriptor.wrap(activeDescriptor, obj -> activeDescriptor.dispose((U) obj)), retVal);
  }
  return retVal;
}
origin: jersey/jersey

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  U retVal = instance.get(ForeignDescriptor.wrap(activeDescriptor));
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(ForeignDescriptor.wrap(activeDescriptor, obj -> activeDescriptor.dispose((U) obj)), retVal);
  }
  return retVal;
}
origin: hstaudacher/osgi-jax-rs-connector

@Override
public boolean containsKey(ActiveDescriptor<?> descriptor) {
  final Instance instance = current();
  return instance.contains(descriptor);
}
origin: hstaudacher/osgi-jax-rs-connector

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  final Instance instance = current();
  instance.remove(descriptor);
}
origin: hstaudacher/osgi-jax-rs-connector

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  final Instance instance = current();
  instance.remove(descriptor);
}
origin: com.eclipsesource.jaxrs/jersey-all

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  final Instance instance = current();
  instance.remove(descriptor);
}
origin: org.glassfish.jersey.inject/jersey-hk2

@Override
public boolean containsKey(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  return instance.contains(ForeignDescriptor.wrap(descriptor));
}
origin: org.glassfish.jersey.inject/jersey-hk2

@Override
public void destroyOne(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  instance.remove(ForeignDescriptor.wrap(descriptor));
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

@Override
public boolean containsKey(ActiveDescriptor<?> descriptor) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  return instance.contains(ForeignDescriptor.wrap(descriptor));
}
origin: hstaudacher/osgi-jax-rs-connector

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  final Instance instance = current();
  U retVal = instance.get(activeDescriptor);
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(activeDescriptor, retVal);
  }
  return retVal;
}
origin: hstaudacher/osgi-jax-rs-connector

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  final Instance instance = current();
  U retVal = instance.get(activeDescriptor);
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(activeDescriptor, retVal);
  }
  return retVal;
}
origin: com.eclipsesource.jaxrs/jersey-all

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  final Instance instance = current();
  U retVal = instance.get(activeDescriptor);
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(activeDescriptor, retVal);
  }
  return retVal;
}
origin: org.glassfish.jersey.inject/jersey-hk2

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  U retVal = instance.get(ForeignDescriptor.wrap(activeDescriptor));
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(ForeignDescriptor.wrap(activeDescriptor, obj -> activeDescriptor.dispose((U) obj)), retVal);
  }
  return retVal;
}
origin: org.glassfish.jersey.bundles/jaxrs-ri

@Override
public <U> U findOrCreate(ActiveDescriptor<U> activeDescriptor, ServiceHandle<?> root) {
  Hk2RequestScope.Instance instance = (Hk2RequestScope.Instance) requestScope.current();
  U retVal = instance.get(ForeignDescriptor.wrap(activeDescriptor));
  if (retVal == null) {
    retVal = activeDescriptor.create(root);
    instance.put(ForeignDescriptor.wrap(activeDescriptor, obj -> activeDescriptor.dispose((U) obj)), retVal);
  }
  return retVal;
}
org.glassfish.jersey.process.internalRequestScopecurrent

Javadoc

Returns the current RequestContext which has to be active on the given thread.

Popular methods of RequestScope

  • 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>
  • activate
    Stores the provided RequestContext to thread-local variable belonging to current request scope.
  • 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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Notification (javax.management)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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