public class DefaultBootstrapContext extends Object implements ConfigurableBootstrapContext
ConfigurableBootstrapContext implementation.BootstrapRegistry.InstanceSupplier<T>| Constructor and Description |
|---|
DefaultBootstrapContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(ApplicationListener<BootstrapContextClosedEvent> listener)
Add an
ApplicationListener that will be called with a
BootstrapContextClosedEvent when the BootstrapContext is closed and
the ApplicationContext has been prepared. |
void |
close(ConfigurableApplicationContext applicationContext)
Method to be called when
BootstrapContext is closed and the
ApplicationContext is prepared. |
<T> T |
get(Class<T> type)
Return an instance from the context, creating it if it hasn't been accessed
previously.
|
<T> BootstrapRegistry.InstanceSupplier<T> |
getRegisteredInstanceSupplier(Class<T> type)
Return any existing
BootstrapRegistry.InstanceSupplier for the given type. |
<T> boolean |
isRegistered(Class<T> type)
Return if a registration exists for the given type.
|
<T> void |
register(Class<T> type,
BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
Register a specific type with the registry.
|
<T> void |
registerIfAbsent(Class<T> type,
BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
Register a specific type with the registry if one is not already present.
|
public <T> void register(Class<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
BootstrapRegistryregister in interface BootstrapRegistryT - the instance typetype - the instance typeinstanceSupplier - the instance supplierpublic <T> void registerIfAbsent(Class<T> type, BootstrapRegistry.InstanceSupplier<T> instanceSupplier)
BootstrapRegistryregisterIfAbsent in interface BootstrapRegistryT - the instance typetype - the instance typeinstanceSupplier - the instance supplierpublic <T> boolean isRegistered(Class<T> type)
BootstrapRegistryisRegistered in interface BootstrapRegistryT - the instance typetype - the instance typetrue if the type has already been registeredpublic <T> BootstrapRegistry.InstanceSupplier<T> getRegisteredInstanceSupplier(Class<T> type)
BootstrapRegistryBootstrapRegistry.InstanceSupplier for the given type.getRegisteredInstanceSupplier in interface BootstrapRegistryT - the instance typetype - the instance typeBootstrapRegistry.InstanceSupplier or nullpublic void addCloseListener(ApplicationListener<BootstrapContextClosedEvent> listener)
BootstrapRegistryApplicationListener that will be called with a
BootstrapContextClosedEvent when the BootstrapContext is closed and
the ApplicationContext has been prepared.addCloseListener in interface BootstrapRegistrylistener - the listener to addpublic <T> T get(Class<T> type) throws IllegalStateException
BootstrapContextget in interface BootstrapContextT - the instance typetype - the instance typeIllegalStateException - if the type has not been registeredpublic void close(ConfigurableApplicationContext applicationContext)
BootstrapContext is closed and the
ApplicationContext is prepared.applicationContext - the prepared context