Package net.shibboleth.shared.service.reloadable

# Class ProxiedFactoryBean<T>

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<T>
net.shibboleth.shared.service.reloadable.ProxiedFactoryBean<T>

Type Parameters:
  `T` - bean type

All Implemented Interfaces:
  `Aware`, `BeanClassLoaderAware`, `BeanFactoryAware`, `DisposableBean`, `FactoryBean<T>`, `InitializingBean`

public class ProxiedFactoryBean<T> extends AbstractFactoryBean<T>
Factory bean that proxies the creation of a bean through a managed/reloadable `ApplicationContext`.

The bean may be treated as a singleton or not, depending on whether it should allow for underlying refresh.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`backupName`
Backup bean name.
`private String`
`beanName`
Bean name.
`private final Class<T>`
`beanType`
Bean type.
`private final ReloadableService<ApplicationContext>`
`contextService`
Bean source.

### Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

`logger`

### Fields inherited from interface org.springframework.beans.factory.FactoryBean

`OBJECT_TYPE_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`ProxiedFactoryBean(ReloadableService<ApplicationContext> service, Class<T> type)`
Constructor.
`ProxiedFactoryBean(ReloadableService<ApplicationContext> service, Class<T> type, String name)`
Constructor.
`ProxiedFactoryBean(ReloadableService<ApplicationContext> service, Class<T> type, String name, String backup)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected T`
`createInstance()`
`Class<T>`
`getObjectType()`

### Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

`afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton`

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

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

## Field Details

### beanType

@Nonnull private final Class<T> beanType
Bean type.

### beanName

@Nullable @NotEmpty private String beanName
Bean name.

### backupName

@Nullable @NotEmpty private String backupName
Backup bean name.

### contextService

@Nonnull private final ReloadableService<ApplicationContext> contextService
Bean source.

## Constructor Details

### ProxiedFactoryBean

public ProxiedFactoryBean(@Nonnull @ParameterName(name="service") ReloadableService<ApplicationContext> service, @Nonnull @ParameterName(name="type") Class<T> type)
Constructor.

Parameters:
  `service` - bean source
  `type` - type of bean

### ProxiedFactoryBean

public ProxiedFactoryBean(@Nonnull @ParameterName(name="service") ReloadableService<ApplicationContext> service, @Nonnull @ParameterName(name="type") Class<T> type, @Nonnull @NotEmpty @ParameterName(name="name") String name)
Constructor.

Parameters:
  `service` - bean source
  `type` - type of bean
  `name` - name of bean

### ProxiedFactoryBean

public ProxiedFactoryBean(@Nonnull @ParameterName(name="service") ReloadableService<ApplicationContext> service, @Nonnull @ParameterName(name="type") Class<T> type, @Nonnull @NotEmpty @ParameterName(name="name") String name, @Nonnull @NotEmpty @ParameterName(name="backup") String backup)
Constructor.

Parameters:
  `service` - bean source
  `type` - type of bean
  `name` - name of bean
  `backup` - backup name in case primary doesn't exist

## Method Details

### getObjectType

@Nonnull public Class<T> getObjectType()

Specified by:
  `getObjectType` in interface `FactoryBean<T>`
Specified by:
  `getObjectType` in class `AbstractFactoryBean<T>`

### createInstance

@Nonnull protected T createInstance() throws Exception

Specified by:
  `createInstance` in class `AbstractFactoryBean<T>`
Throws:
  `Exception`