Tabnine Logo
RequestScope.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.glassfish.jersey.process.internal.RequestScope
constructor

Best Java code snippets using org.glassfish.jersey.process.internal.RequestScope.<init> (Showing top 8 results out of 315)

origin: stackoverflow.com

beanFactory.registerScope(WebApplicationContext.SCOPE_REQUEST, new RequestScope());
origin: stackoverflow.com

 @BeforeClass(dependsOnMethod = "springTestContextPrepareTestInstance")
public void registerWebScopes() {
  ConfigurableBeanFactory factory = (ConfigurableBeanFactory) 
      this.applicationContext.getAutowireCapableBeanFactory();
  factory.registerScope("session", new SessionScope());
  factory.registerScope("request", new RequestScope());
}
origin: stackoverflow.com

 @Before
public void prepareTestInstance() throws Exception {
  applicationContext.getBeanFactory().registerScope("session", new SessionScope());
  applicationContext.getBeanFactory().registerScope("request", new RequestScope());
  MockHttpServletRequest request = new MockHttpServletRequest();

  ServletRequestAttributes attributes = new ServletRequestAttributes(request);
  RequestContextHolder.setRequestAttributes(attributes);

   .......
origin: stackoverflow.com

 @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(/* ... */)
public class Tests {

  @Autowired
  private GenericApplicationContext context;

  @Before
  public void defineRequestScope() {
    context.getBeanFactory().registerScope(
      WebApplicationContext.SCOPE_REQUEST, new RequestScope());
    RequestContextHolder.setRequestAttributes(
      new ServletRequestAttributes(new MockHttpServletRequest()));
  }

  // ...
origin: hstaudacher/osgi-jax-rs-connector

  @Override
  protected void configure() {
    bind(new RequestScope()).to(RequestScope.class);
  }
}
origin: hstaudacher/osgi-jax-rs-connector

  @Override
  protected void configure() {
    bind(new RequestScope()).to(RequestScope.class);
  }
}
origin: com.eclipsesource.jaxrs/jersey-all

  @Override
  protected void configure() {
    bind(new RequestScope()).to(RequestScope.class);
  }
}
origin: stackoverflow.com

 public class CompositeRequestScope implements Scope {
  private final Scope requestScope = new RequestScope();
  private final Scope fallbackScope = new SimpleThreadScope();

  public Object get(String name, ObjectFactory<?> objectFactory) {
    return activeScope().get(name, objectFactory);
  }

  ...

  private Scope activeScope() {
    if (RequestContextHolder.getRequestAttributes() != null) {
      return requestScope;    
    } else {
      return fallbackScope;
    }
  }
}
org.glassfish.jersey.process.internalRequestScope<init>

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
  • 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

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Collectors (java.util.stream)
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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