Class Configuration

java.lang.Object
org.springframework.core.io.DefaultResourceLoader
org.springframework.context.support.AbstractApplicationContext
org.springframework.context.support.AbstractRefreshableApplicationContext
org.springframework.context.support.AbstractRefreshableConfigApplicationContext
org.springframework.context.support.AbstractXmlApplicationContext
org.springframework.context.support.ClassPathXmlApplicationContext
org.frankframework.configuration.Configuration
All Implemented Interfaces:
Closeable, AutoCloseable, IConfigurable, IConfigurationAware, INamedObject, IScopeProvider, ConfigurableLifecycle, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactory, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.ListableBeanFactory, org.springframework.context.ApplicationContext, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationEventPublisher, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.Lifecycle, org.springframework.context.MessageSource, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.core.env.EnvironmentCapable, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

@FrankDocGroup(OTHER) public class Configuration extends org.springframework.context.support.ClassPathXmlApplicationContext implements IConfigurable, org.springframework.context.ApplicationContextAware, ConfigurableLifecycle
Container of Adapters that belong together. A configuration may be deployed independently from other configurations. Names of nested elements like Adapters, Receivers, listeners and senders can be reused in other configurations.

Configurations are shown in the Frank!Console along with their Adapters, Receivers, listeners and senders. The Adapter Status page of the Frank!Console has a tab for each configuration that only shows information about that configuration. See the Frank!Manual for details.
Author:
Johan Verrips
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.core.io.DefaultResourceLoader

    org.springframework.core.io.DefaultResourceLoader.ClassPathContextResource
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.logging.log4j.Logger
     

    Fields inherited from class org.springframework.context.support.AbstractApplicationContext

    APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, logger, MESSAGE_SOURCE_BEAN_NAME

    Fields inherited from interface org.springframework.beans.factory.BeanFactory

    FACTORY_BEAN_PREFIX

    Fields inherited from interface org.springframework.context.ConfigurableApplicationContext

    APPLICATION_STARTUP_BEAN_NAME, CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, ENVIRONMENT_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME

    Fields inherited from interface org.springframework.core.io.ResourceLoader

    CLASSPATH_URL_PREFIX

    Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver

    CLASSPATH_ALL_URL_PREFIX

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add adapter.
    void
    Include the referenced Module in this configuration
    void
    Deprecated.
    void
    Deprecated.
    void
     
    void
     
    void
    Spring's configure method.
    void
     
    void
    Digest the configuration and generate flow diagram.
     
    org.springframework.context.ApplicationContext
     
    getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)
     
    If no ClassLoader has been set it tries to fall back on the `configurations.xxx.classLoaderType` property.
    This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.
     
     
     
     
     
     
    Get a registered adapter by its name through AdapterManager.getAdapter(String)
     
     
     
     
     
     
    boolean
    By default these beans are not started.
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    void
    log(String message)
    Log a message to the MessageKeeper that corresponds to this configuration
    void
    log(String message, Exception e)
    Log a message to the MessageKeeper that corresponds to this configuration
    void
    Log a message to the MessageKeeper that corresponds to this configuration
    void
    publishEvent(org.springframework.context.ApplicationEvent event)
     
    void
    Don't manually call this method.
    void
    Deprecated.
    void
     
    void
     
    void
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     
    void
    setAutoStart(boolean autoStart)
    If the Configuration should automatically start all Adapters and Scheduled Jobs.
    void
    Overwrite the DisplayName created by the super.setBeanName which prepends 'ApplicationContext'.
    void
     
    void
     
    void
     
    void
    setLoadedConfiguration(String loadedConfiguration)
    The loaded (with resolved properties) configuration
    void
    setMonitoring(MonitorManager monitorManager)
    Container for monitor objects
    void
    Configurations should be wired through Spring, which in turn should call setBeanName(String).
    void
    setOriginalConfiguration(String originalConfiguration)
    The entire (raw) configuration
    void
     
    void
    Container for jobs scheduled for periodic execution.
    void
     
    void
    setVersion(String version)
    The version of the Configuration, typically provided by the BuildInfo.properties file.
    void
    Spring method which starts the ApplicationContext.
    void
     

    Methods inherited from class org.springframework.context.support.ClassPathXmlApplicationContext

    getConfigResources

    Methods inherited from class org.springframework.context.support.AbstractXmlApplicationContext

    initBeanDefinitionReader, loadBeanDefinitions, loadBeanDefinitions, setValidating

    Methods inherited from class org.springframework.context.support.AbstractRefreshableConfigApplicationContext

    getConfigLocations, getDefaultConfigLocations, resolvePath, setConfigLocation, setConfigLocations, setId

    Methods inherited from class org.springframework.context.support.AbstractRefreshableApplicationContext

    assertBeanFactoryActive, cancelRefresh, closeBeanFactory, createBeanFactory, customizeBeanFactory, getBeanFactory, hasBeanFactory, refreshBeanFactory, setAllowBeanDefinitionOverriding, setAllowCircularReferences

    Methods inherited from class org.springframework.context.support.AbstractApplicationContext

    addApplicationListener, addBeanFactoryPostProcessor, containsBean, containsBeanDefinition, containsLocalBean, createEnvironment, destroyBeans, doClose, findAllAnnotationsOnBean, findAnnotationOnBean, findAnnotationOnBean, finishBeanFactoryInitialization, finishRefresh, getAliases, getApplicationListeners, getApplicationName, getApplicationStartup, getAutowireCapableBeanFactory, getBean, getBean, getBean, getBean, getBean, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactoryPostProcessors, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDisplayName, getEnvironment, getId, getInternalParentBeanFactory, getInternalParentMessageSource, getMessage, getMessage, getMessage, getParent, getParentBeanFactory, getResourcePatternResolver, getResources, getStartupDate, getType, getType, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isSingleton, isTypeMatch, isTypeMatch, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, registerBeanPostProcessors, registerListeners, registerShutdownHook, removeApplicationListener, resetCommonCaches, setApplicationStartup, setDisplayName, setEnvironment, setParent, toString

    Methods inherited from class org.springframework.core.io.DefaultResourceLoader

    addProtocolResolver, clearResourceCaches, getClassLoader, getProtocolResolvers, getResource, getResourceByPath, getResourceCache, setClassLoader

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.springframework.context.ConfigurableApplicationContext

    addProtocolResolver, setClassLoader

    Methods inherited from interface org.frankframework.lifecycle.ConfigurableLifecycle

    getPhase

    Methods inherited from interface org.springframework.core.io.ResourceLoader

    getClassLoader, getResource

    Methods inherited from interface org.springframework.context.SmartLifecycle

    stop
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface IConfigurationAware
    • afterPropertiesSet

      public void afterPropertiesSet()
      Spring's configure method. Only called when the Configuration has been added through a parent context!
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
    • refresh

      public void refresh() throws org.springframework.beans.BeansException, IllegalStateException
      Don't manually call this method. Spring should automatically trigger this when super.afterPropertiesSet(); is called.
      Specified by:
      refresh in interface org.springframework.context.ConfigurableApplicationContext
      Overrides:
      refresh in class org.springframework.context.support.AbstractApplicationContext
      Throws:
      org.springframework.beans.BeansException
      IllegalStateException
    • getBeanNamesForType

      public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)
      Specified by:
      getBeanNamesForType in interface org.springframework.beans.factory.ListableBeanFactory
      Overrides:
      getBeanNamesForType in class org.springframework.context.support.AbstractApplicationContext
    • start

      public void start()
      Spring method which starts the ApplicationContext. Loads + digests the configuration and calls start() in all registered beans that implement the Spring Lifecycle interface.
      Specified by:
      start in interface org.springframework.context.Lifecycle
      Overrides:
      start in class org.springframework.context.support.AbstractApplicationContext
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
      Overrides:
      stop in class org.springframework.context.support.AbstractApplicationContext
    • configure

      public void configure() throws ConfigurationException
      Digest the configuration and generate flow diagram.
      Specified by:
      configure in interface ConfigurableLifecycle
      Specified by:
      configure in interface IConfigurable
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.springframework.context.ConfigurableApplicationContext
      Overrides:
      close in class org.springframework.context.support.AbstractApplicationContext
    • publishEvent

      public void publishEvent(org.springframework.context.ApplicationEvent event)
      Specified by:
      publishEvent in interface org.springframework.context.ApplicationEventPublisher
      Overrides:
      publishEvent in class org.springframework.context.support.AbstractApplicationContext
    • log

      public void log(String message)
      Log a message to the MessageKeeper that corresponds to this configuration
    • log

      public void log(String message, MessageKeeper.MessageKeeperLevel level)
      Log a message to the MessageKeeper that corresponds to this configuration
    • log

      public void log(String message, Exception e)
      Log a message to the MessageKeeper that corresponds to this configuration
    • isUnloadInProgressOrDone

      public boolean isUnloadInProgressOrDone()
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
      Overrides:
      isRunning in class org.springframework.context.support.AbstractApplicationContext
    • setAutoStart

      public void setAutoStart(boolean autoStart)
      If the Configuration should automatically start all Adapters and Scheduled Jobs.
    • isAutoStartup

      public boolean isAutoStartup()
      Description copied from interface: ConfigurableLifecycle
      By default these beans are not started. The Configuration may do so in the configure() method.
      Specified by:
      isAutoStartup in interface ConfigurableLifecycle
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle
    • isStubbed

      public boolean isStubbed()
    • getRegisteredAdapter

      public Adapter getRegisteredAdapter(String name)
      Get a registered adapter by its name through AdapterManager.getAdapter(String)
      Parameters:
      name - the adapter to retrieve
      Returns:
      Adapter
    • getRegisteredAdapters

      public List<Adapter> getRegisteredAdapters()
    • addStartAdapterThread

      public void addStartAdapterThread(Runnable runnable)
    • removeStartAdapterThread

      public void removeStartAdapterThread(Runnable runnable)
    • addStopAdapterThread

      public void addStopAdapterThread(Runnable runnable)
    • removeStopAdapterThread

      public void removeStopAdapterThread(Runnable runnable)
    • addInclude

      public void addInclude(Include module)
      Include the referenced Module in this configuration
    • addAdapter

      public void addAdapter(Adapter adapter)
      Add adapter.
    • setScheduleManager

      public void setScheduleManager(ScheduleManager scheduleManager)
      Container for jobs scheduled for periodic execution.
    • addScheduledJob

      @Deprecated public void addScheduledJob(IJob jobdef)
      Deprecated.
      Add an job for scheduling at the configuration. The configuration will create an AdapterJob instance and a JobDetail with the information from the parameters, after checking the parameters of the job. (basically, it checks whether the adapter and the receiver are registered.

      See the Quartz scheduler documentation

      Parameters:
      jobdef - a JobDef object
      Since:
      4.0
      See Also:
    • setName

      public void setName(String name)
      Configurations should be wired through Spring, which in turn should call setBeanName(String). Once the ConfigurationContext has a name it should not be changed anymore, hence super.setBeanName(String) only sets the name once. If not created by Spring, the setIdCalled flag in AbstractRefreshableConfigApplicationContext wont be set, allowing the name to be updated. The DisplayName will always be updated, which is purely used for logging purposes.
      Specified by:
      setName in interface INamedObject
    • getName

      public String getName()
      Specified by:
      getName in interface IConfigurationAware
      Specified by:
      getName in interface INamedObject
    • setVersion

      @Protected public void setVersion(String version)
      The version of the Configuration, typically provided by the BuildInfo.properties file.
    • getClassLoaderType

      @Nullable public String getClassLoaderType()
      If no ClassLoader has been set it tries to fall back on the `configurations.xxx.classLoaderType` property. Because of this, it may not always represent the correct or accurate type.
    • setIbisManager

      public void setIbisManager(IbisManager ibisManager)
    • setOriginalConfiguration

      @Protected public void setOriginalConfiguration(String originalConfiguration)
      The entire (raw) configuration
    • setLoadedConfiguration

      @Protected public void setLoadedConfiguration(String loadedConfiguration)
      The loaded (with resolved properties) configuration
    • getScheduledJob

      public IJob getScheduledJob(String name)
    • getScheduledJobs

      public List<IJob> getScheduledJobs()
    • setConfigurationException

      public void setConfigurationException(ConfigurationException exception)
    • getConfigurationWarnings

      public ConfigurationWarnings getConfigurationWarnings()
    • getConfigurationClassLoader

      public ClassLoader getConfigurationClassLoader()
      Description copied from interface: IScopeProvider
      This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.
      Specified by:
      getConfigurationClassLoader in interface IScopeProvider
      Returns:
      returns the ClassLoader created by the ClassLoaderManager.
    • setSapSystems

      public void setSapSystems(SapSystems sapSystems)
    • setJmsRealms

      public void setJmsRealms(JmsRealmFactory realm)
    • addJmsRealm

      @Deprecated public void addJmsRealm(JmsRealm realm)
      Deprecated.
    • setMonitoring

      public void setMonitoring(MonitorManager monitorManager)
      Container for monitor objects
    • registerMonitoring

      @Deprecated public void registerMonitoring(MonitorManager factory)
      Deprecated.
    • setSharedResources

      public void setSharedResources(SharedResources resource)
    • setBeanName

      @Protected public void setBeanName(String name)
      Overwrite the DisplayName created by the super.setBeanName which prepends 'ApplicationContext'. The BeanName can only be set once, after which it only updates the DisplayName.
      Specified by:
      setBeanName in interface org.springframework.beans.factory.BeanNameAware
      Overrides:
      setBeanName in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext
    • getAdapterManager

      public AdapterManager getAdapterManager()
    • setAdapterManager

      public void setAdapterManager(AdapterManager adapterManager)
    • getScheduleManager

      public ScheduleManager getScheduleManager()
    • getState

      public RunState getState()
    • getVersion

      public String getVersion()
    • getIbisManager

      public IbisManager getIbisManager()
    • getOriginalConfiguration

      public String getOriginalConfiguration()
    • getLoadedConfiguration

      public String getLoadedConfiguration()
    • isConfigured

      public boolean isConfigured()
    • getConfigurationException

      public ConfigurationException getConfigurationException()