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

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JPanel (javax.swing)
  • Top 17 Free Sublime Text Plugins
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