tigase.kernel.core

## Class BeanConfig

- java.lang.Object
- - tigase.kernel.core.BeanConfig

- Direct Known Subclasses:
    Kernel.DelegatedBeanConfig

      public class BeanConfig
      extends Object

  This is internal configuration of each bean. It stores name of bean, dependencies, state of bean etc.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BeanConfig.Source`
    `static class` | `BeanConfig.State` State of bean.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRegisteredBean(BeanConfig beanConfig)`
    `void` | `addRegisteredBy(BeanConfig beanConfig)`
    `boolean` | `equals(Object obj)`
    `protected String` | `getBeanInstanceName()`
    `String` | `getBeanName()` Returns name of bean.
    `Class<?>` | `getClazz()` Returns class of bean.
    `BeanConfig` | `getFactory()` Return factory of bean.
    `Map<Field,Dependency>` | `getFieldDependencies()` Returns map of dependencies.
    `Kernel` | `getKernel()` Returns `Kernel` managing this bean.
    `Set<BeanConfig>` | `getRegisteredBeans()` List of beans registered by registration of this bean - related to `Bean::parent`.
    `Set<BeanConfig>` | `getRegisteredBy()` Set of beans which caused registration of this bean - related to `Bean::parent`.
    `BeanConfig.Source` | `getSource()` Returns information about source of the bean registration (annotation, code, config, etc.)
    `BeanConfig.State` | `getState()` Returns state of bean.
    `int` | `hashCode()`
    `boolean` | `isExportable()` Checks if bean may be visible in child Kernels.
    `boolean` | `isPinned()` Returns information if bean in pinned.
    `void` | `removeRegisteredBean(BeanConfig beanConfig)`
    `boolean` | `removeRegisteredBy(BeanConfig beanConfig)`
    `protected void` | `setBeanInstanceName(String beanInstanceName)`
    `void` | `setPinned(boolean pinned)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### getBeanName

          public String getBeanName()

      Returns name of bean.
      Returns:
        name of bean.

    - #### getClazz

          public Class<?> getClazz()

      Returns class of bean.
      Returns:
        class of bean.

    - #### getFactory

          public BeanConfig getFactory()

      Return factory of bean.
      Returns:
        factory of bean. It may return `null` if default factory is used.

    - #### getFieldDependencies

          public Map<Field,Dependency> getFieldDependencies()

      Returns map of dependencies. Note that Kernel has field-based-dependency model, it means that each dependency must be related to field in class.
      Returns:
        map of dependencies.

    - #### getKernel

          public Kernel getKernel()

      Returns `Kernel` managing this bean.
      Returns:
        `Kernel`.

    - #### getState

          public BeanConfig.State getState()

      Returns state of bean.
      Returns:
        state of bean.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### isExportable

          public boolean isExportable()

      Checks if bean may be visible in child Kernels.
      Returns:
        `true` if beans will be visible in child Kernel (other Kernels deployed as beans to current Kernel).

    - #### isPinned

          public boolean isPinned()

      Returns information if bean in pinned. If bean is pinned it will not be unloaded even if no other bean uses it.

    - #### setPinned

          public void setPinned(boolean pinned)

    - #### getSource

          public BeanConfig.Source getSource()

      Returns information about source of the bean registration (annotation, code, config, etc.)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getRegisteredBeans

          public Set<BeanConfig> getRegisteredBeans()

      List of beans registered by registration of this bean - related to `Bean::parent`.

    - #### addRegisteredBean

          public void addRegisteredBean(BeanConfig beanConfig)

    - #### removeRegisteredBean

          public void removeRegisteredBean(BeanConfig beanConfig)

    - #### addRegisteredBy

          public void addRegisteredBy(BeanConfig beanConfig)

    - #### removeRegisteredBy

          public boolean removeRegisteredBy(BeanConfig beanConfig)

    - #### getRegisteredBy

          public Set<BeanConfig> getRegisteredBy()

      Set of beans which caused registration of this bean - related to `Bean::parent`.

    - #### getBeanInstanceName

          protected String getBeanInstanceName()

    - #### setBeanInstanceName

          protected void setBeanInstanceName(String beanInstanceName)

Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.