Class IbisContext
- java.lang.Object
-
- nl.nn.adapterframework.lifecycle.IbisApplicationContext
-
- nl.nn.adapterframework.configuration.IbisContext
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class IbisContext extends IbisApplicationContext
Main entry point for creating and starting Ibis instances from the configuration file. This class can not be created from the Spring context, because it is the place where the Spring context is created.- Since:
- 4.8
- Author:
- Tim van der Leeuw, Jaco de Groot
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nl.nn.adapterframework.lifecycle.IbisApplicationContext
IbisApplicationContext.BootState
-
-
Field Summary
-
Fields inherited from class nl.nn.adapterframework.lifecycle.IbisApplicationContext
APP_CONSTANTS
-
-
Constructor Summary
Constructors Constructor Description IbisContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Shuts down the IbisContext, and therefore the Spring contextvoid
fullReload()
Completely rebuilds the ibisContext and therefore also the Spring contextString
getApplicationName()
IbisManager
getIbisManager()
void
init()
Creates the Spring context, and load the configuration.void
init(boolean reconnect)
Creates the Spring context, and load the configuration.boolean
isLoadingConfigs()
void
load(String configurationName)
Loads, digests and starts the specified configuration, or all configurations Does not check if the configuration already exists.void
log(String message, MessageKeeper.MessageKeeperLevel level, Exception e)
void
reload(String configurationName)
Reloads the given configuration.protected Map<String,Class<? extends IConfigurationClassLoader>>
retrieveAllConfigNames()
Helper method to create stubbed configurations used in JunitTestsvoid
unload(String configurationName)
Be aware that the configuration may be unloaded but it's resources wont! There is currently no way to cleanup old ClassLoaders, these are kept in memory.-
Methods inherited from class nl.nn.adapterframework.lifecycle.IbisApplicationContext
createApplicationContext, createBeanAutowireByName, getApplicationContext, getBean, getBootState, getSpringConfigurationFiles, setParentContext
-
-
-
-
Method Detail
-
init
public void init()
Creates the Spring context, and load the configuration. Optionally with a specific ClassLoader which might for example override the getResource method to load configuration and related resources from a different location from the standard classpath.
-
init
public void init(boolean reconnect)
Creates the Spring context, and load the configuration. Optionally with a specific ClassLoader which might for example override the getResource method to load configuration and related resources from a different location from the standard classpath.- Parameters:
reconnect
- retry startup when failures occur- Throws:
org.springframework.beans.factory.BeanCreationException
- when Spring can't start up- See Also:
ClassLoaderUtils.getResourceURL(IScopeProvider, String)
,AppConstants.getInstance(ClassLoader)
-
close
public void close()
Shuts down the IbisContext, and therefore the Spring context- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classIbisApplicationContext
- See Also:
IbisApplicationContext.close()
-
reload
public void reload(String configurationName)
Reloads the given configuration. First it checks if the resources can be found. It then replaces the old resources with the new resources. If all is successful it will unload the old configuration from the IbisManager, and load the new configuration.
-
unload
public void unload(String configurationName)
Be aware that the configuration may be unloaded but it's resources wont! There is currently no way to cleanup old ClassLoaders, these are kept in memory. Removing the ClassLoader will cause a ClassLoader-leak, leaving a small footprint behind in memory! Usereload(String)
where possible.
-
fullReload
public void fullReload()
Completely rebuilds the ibisContext and therefore also the Spring context
-
load
public void load(String configurationName)
Loads, digests and starts the specified configuration, or all configurations Does not check if the configuration already exists. Does not unload old configurations!- Parameters:
configurationName
- name of the configuration to load or null when you want to load all configurations- See Also:
ClassLoaderManager.get(String)
,ConfigurationUtils.retrieveAllConfigNames(ApplicationContext)
,createAndConfigureConfigurationWithClassLoader(ClassLoader, String, ClassLoaderException)
-
retrieveAllConfigNames
protected Map<String,Class<? extends IConfigurationClassLoader>> retrieveAllConfigNames()
Helper method to create stubbed configurations used in JunitTests
-
log
public void log(String message, MessageKeeper.MessageKeeperLevel level, Exception e)
-
getApplicationName
public String getApplicationName()
-
isLoadingConfigs
public boolean isLoadingConfigs()
-
getIbisManager
public IbisManager getIbisManager()
-
-