Tabnine Logo
PetiteContainer.registerBeanAndWireAndInjectParamsAndInvokeInitMethods
Code IndexAdd Tabnine to your IDE (free)

How to use
registerBeanAndWireAndInjectParamsAndInvokeInitMethods
method
in
jodd.petite.PetiteContainer

Best Java code snippets using jodd.petite.PetiteContainer.registerBeanAndWireAndInjectParamsAndInvokeInitMethods (Showing top 8 results out of 315)

origin: oblac/jodd

/**
 * Adds object instance to the container as singleton bean.
 */
public void addBean(final String name, final Object bean, WiringMode wiringMode) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
  BeanDefinition def = lookupExistingBeanDefinition(name);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: oblac/jodd

/**
 * Wires provided bean with the container and optionally invokes init methods.
 * Bean is <b>not</b> registered withing container.
 */
public void wire(final Object bean, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
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: oblac/jodd

/**
 * Creates and wires a bean within the container and optionally invokes init methods. However, bean is
 * <b>not</b> registered.
 */
@SuppressWarnings({"unchecked"})
public <E> E createBean(final Class<E> type, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    type, () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(type, finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData<E> beanData = new BeanData(this, def);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
  return beanData.bean();
}
origin: org.jodd/jodd-petite

/**
 * Adds object instance to the container as singleton bean.
 */
public void addBean(final String name, final Object bean, WiringMode wiringMode) {
  wiringMode = petiteConfig.resolveWiringMode(wiringMode);
  registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
  BeanDefinition def = lookupExistingBeanDefinition(name);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, bean));
}
origin: org.jodd/jodd-petite

/**
 * Wires provided bean with the container and optionally invokes init methods.
 * Bean is <b>not</b> registered withing container.
 */
public void wire(final Object bean, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    bean.getClass(), () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(bean.getClass(), finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(new BeanData(this, def, 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-petite

/**
 * Creates and wires a bean within the container and optionally invokes init methods. However, bean is
 * <b>not</b> registered.
 */
@SuppressWarnings({"unchecked"})
public <E> E createBean(final Class<E> type, final WiringMode wiringMode) {
  final WiringMode finalWiringMode = petiteConfig.resolveWiringMode(wiringMode);
  final BeanDefinition def = externalsCache.get(
    type, () -> {
      final BeanDefinition beanDefinition = createBeandDefinitionForExternalBeans(type, finalWiringMode);
      initBeanDefinition(beanDefinition);
      return beanDefinition;
    });
  final BeanData<E> beanData = new BeanData(this, def);
  registerBeanAndWireAndInjectParamsAndInvokeInitMethods(beanData);
  return beanData.bean();
}
jodd.petitePetiteContainerregisterBeanAndWireAndInjectParamsAndInvokeInitMethods

Javadoc

Wires bean, injects parameters and invokes init methods. Such a loooong name :)

Popular methods of PetiteContainer

  • addBean
    Adds object instance to the container as singleton bean.
  • getBean
    Returns Petite bean instance named as one of the provided names.
  • registerPetiteBean
  • createBean
    Creates and wires a bean within the container and optionally invokes init methods. However, bean isn
  • defineParameters
  • wire
    Wires provided bean with the container and optionally invokes init methods. Bean is not registered.
  • <init>
    Creates new Petite container using PetiteContainer.
  • addSelf
    Adds self instance to the container so internal beans may fetch container for further usage. No wiri
  • lookupBeanDefinition
  • resolveBeanName
  • shutdown
    Shutdowns container. After container is down, it can't be used anymore.
  • beansCount
  • shutdown,
  • beansCount,
  • config,
  • createBeanDefinitionForRegistration,
  • forEachBeanType,
  • lookupExistingBeanDefinition,
  • registerPetiteCtorInjectionPoint,
  • registerPetiteInitMethods,
  • registerPetiteMethodInjectionPoint,
  • registerPetitePropertyInjectionPoint

Popular in Java

  • Parsing JSON documents to java classes using gson
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • putExtra (Intent)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
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