Package tigase.kernel.core

## Class BeanConfig

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

- Direct Known Subclasses:
    `Kernel.DelegatedBeanConfig`

      public class BeanConfig
      extends java.lang.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 | Description
    --- | --- | ---
    `static class` | `BeanConfig.Source` |
    `static class` | `BeanConfig.State` | State of bean.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addRegisteredBean​(BeanConfig beanConfig)` |
    `void` | `addRegisteredBy​(BeanConfig beanConfig)` |
    `boolean` | `equals​(java.lang.Object obj)` |
    `protected java.lang.String` | `getBeanInstanceName()` |
    `java.lang.String` | `getBeanName()` | Returns name of bean.
    `java.lang.Class<?>` | `getClazz()` | Returns class of bean.
    `BeanConfig` | `getFactory()` | Return factory of bean.
    `java.util.Map<java.lang.reflect.Field,​Dependency>` | `getFieldDependencies()` | Returns map of dependencies.
    `Kernel` | `getKernel()` | Returns `Kernel` managing this bean.
    `java.util.Set<BeanConfig>` | `getRegisteredBeans()` | List of beans registered by registration of this bean - related to `Bean::parent`.
    `java.util.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​(java.lang.String beanInstanceName)` |
    `void` | `setPinned​(boolean pinned)` |
    `java.lang.String` | `toString()` |

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

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

- - ### Method Detail

    - #### equals

          public boolean equals​(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getBeanName

          public java.lang.String getBeanName()

      Returns name of bean.
      Returns:
        name of bean.

    - #### getClazz

          public java.lang.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 java.util.Map<java.lang.reflect.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 `java.lang.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 java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getRegisteredBeans

          public java.util.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 java.util.Set<BeanConfig> getRegisteredBy()

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

    - #### getBeanInstanceName

          protected java.lang.String getBeanInstanceName()

    - #### setBeanInstanceName

          protected void setBeanInstanceName​(java.lang.String beanInstanceName)