org.springframework.web.socket.handler

## Class BeanCreatingHandlerProvider<T>

- java.lang.Object
- - org.springframework.web.socket.handler.BeanCreatingHandlerProvider<T>

- All Implemented Interfaces:
    Aware, BeanFactoryAware

      public class BeanCreatingHandlerProvider<T>
      extends Object
      implements BeanFactoryAware

  Instantiates a target handler through a Spring `BeanFactory` and also provides an equivalent destroy method. Mainly for internal use to assist with initializing and destroying handlers with per-connection lifecycle.
  Since:
    4.0
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BeanCreatingHandlerProvider(Class<? extends T> handlerType)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy(T handler)`
    `T` | `getHandler()`
    `Class<? extends T>` | `getHandlerType()`
    `void` | `setBeanFactory(BeanFactory beanFactory)` Callback that supplies the owning factory to a bean instance.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### BeanCreatingHandlerProvider

          public BeanCreatingHandlerProvider(Class<? extends T> handlerType)

  - ### Method Detail

    - #### setBeanFactory

          public void setBeanFactory(BeanFactory beanFactory)
                              throws BeansException

      Description copied from interface: `BeanFactoryAware`
      Callback that supplies the owning factory to a bean instance.

      Invoked after the population of normal bean properties but before an initialization callback such as `InitializingBean.afterPropertiesSet()` or a custom init-method.

      Specified by:
        `setBeanFactory` in interface `BeanFactoryAware`
      Parameters:
        `beanFactory` - owning BeanFactory (never `null`). The bean can immediately call methods on the factory.
      Throws:
        `BeansException` - in case of initialization errors
      See Also:
        `BeanInitializationException`

    - #### getHandlerType

          public Class<? extends T> getHandlerType()

    - #### getHandler

          public T getHandler()

    - #### destroy

          public void destroy(T handler)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`