Tabnine Logo
BeanDefinition.scopeLookup
Code IndexAdd Tabnine to your IDE (free)

How to use
scopeLookup
method
in
jodd.petite.BeanDefinition

Best Java code snippets using jodd.petite.BeanDefinition.scopeLookup (Showing top 3 results out of 315)

origin: oblac/jodd

/**
 * Returns Petite bean instance.
 * Petite container will find the bean in corresponding scope and all its dependencies,
 * either by constructor or property injection. When using constructor injection, cyclic dependencies
 * can not be prevented, but at least they are detected.
 *
 * @see PetiteContainer#createBean(Class)
 */
public <T> T getBean(final String name) {
  // Lookup for registered bean definition.
  BeanDefinition def = lookupBeanDefinition(name);
  if (def == null) {
    // try provider
    ProviderDefinition providerDefinition = providers.get(name);
    if (providerDefinition != null) {
      return (T) invokeProvider(providerDefinition);
    }
    return null;
  }
  // Find the bean in its scope
  Object bean = def.scopeLookup();
  if (bean == null) {
    // Create new bean in the scope
    initBeanDefinition(def);
    final BeanData beanData = new BeanData(this, def);
    registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
    bean = beanData.bean();
  }
  return (T) bean;
}
origin: org.jodd/jodd-petite

/**
 * Returns Petite bean instance.
 * Petite container will find the bean in corresponding scope and all its dependencies,
 * either by constructor or property injection. When using constructor injection, cyclic dependencies
 * can not be prevented, but at least they are detected.
 *
 * @see PetiteContainer#createBean(Class)
 */
public <T> T getBean(final String name) {
  // Lookup for registered bean definition.
  BeanDefinition def = lookupBeanDefinition(name);
  if (def == null) {
    // try provider
    ProviderDefinition providerDefinition = providers.get(name);
    if (providerDefinition != null) {
      return (T) invokeProvider(providerDefinition);
    }
    return null;
  }
  // Find the bean in its scope
  Object bean = def.scopeLookup();
  if (bean == null) {
    // Create new bean in the scope
    initBeanDefinition(def);
    final BeanData beanData = new BeanData(this, def);
    registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
    bean = beanData.bean();
  }
  return (T) bean;
}
origin: org.jodd/jodd-wot

bean = def.scopeLookup();
if (bean == null) {
jodd.petiteBeanDefinitionscopeLookup

Javadoc

Delegates to jodd.petite.scope.Scope#lookup(String).

Popular methods of BeanDefinition

  • name
    Returns bean name.
  • type
    Returns bean type.
  • <init>
  • addInitMethodPoints
    Adds init methods.
  • addMethodInjectionPoint
    Adds method injection point.
  • addPropertyInjectionPoint
    Adds property injection point.
  • addSetInjectionPoint
    Adds set injection point.
  • scopeRegister
    Delegates to jodd.petite.scope.Scope#register(jodd.petite.BeanDefinition,Object)if scope is defined.
  • scopeRemove
    Delegates to jodd.petite.scope.Scope#remove(String).
  • addDestroyMethodPoints
    Adds destroy methods.
  • consumer
    Returns an optional consumer.
  • destroyMethodPoints
    Returns destroy method points.
  • consumer,
  • destroyMethodPoints,
  • initMethodPoints,
  • scope

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • CodeWhisperer alternatives
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