org.apache.storm.cassandra.context

## Class BaseBeanFactory<T>

- java.lang.Object
- - org.apache.storm.cassandra.context.BaseBeanFactory<T>

- All Implemented Interfaces:
    Serializable, BeanFactory<T>
  Direct Known Subclasses:
    CassandraContext.CassandraConfFactory, CassandraContext.ClientFactory, ClusterFactory

      public abstract class BaseBeanFactory<T>
      extends Object
      implements BeanFactory<T>

  Base BeanProvider implementation.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected WorkerCtx` | `context`
    `protected T` | `instance`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseBeanFactory()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `get(Map<String,Object> topoConf)` Return an instance, which may be shared or independent, of the specified type.
    `protected abstract T` | `make(Map<String,Object> topoConf)` Return a new instance of T.
    `BeanFactory<T>` | `newInstance()` Returns a new copy if this factory.
    `void` | `setStormContext(WorkerCtx context)` Sets the storm context.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### context

          protected WorkerCtx context

    - #### instance

          protected volatile T instance

  - ### Constructor Detail

    - #### BaseBeanFactory

          public BaseBeanFactory()

  - ### Method Detail

    - #### setStormContext

          public void setStormContext(WorkerCtx context)

      Sets the storm context.

      Specified by:
        `setStormContext` in interface `BeanFactory<T>`

    - #### get

          public T get(Map<String,Object> topoConf)

      Return an instance, which may be shared or independent, of the specified type.

      Specified by:
        `get` in interface `BeanFactory<T>`
      Parameters:
        `topoConf` - The storm configuration

    - #### make

          protected abstract T make(Map<String,Object> topoConf)

      Return a new instance of T.

    - #### newInstance

          public BeanFactory<T> newInstance()

      Returns a new copy if this factory.

      Specified by:
        `newInstance` in interface `BeanFactory<T>`
      Returns:
        a new `BeanFactory` instance.

Copyright © 2021 The Apache Software Foundation. All rights reserved.