Class 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.core.env.EnvironmentCapable, org.springframework.core.io.ResourceLoader, org.springframework.core.io.support.ResourcePatternResolver

    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 log  
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      Configuration()  
    • Field Detail

      • log

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

      • Configuration

        public Configuration()
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • 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
      • runMigrator

        protected void runMigrator()
        Execute any database changes before calling configure().
      • 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,
                        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.
      • isAutoStart

        public boolean isAutoStart()
      • isStubbed

        public boolean isStubbed()
      • 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)
      • registerInclude

        public void registerInclude​(Include module)
        Include the referenced Module in this configuration
      • registerAdapter

        public void registerAdapter​(Adapter adapter)
        Add adapter.
      • setScheduleManager

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

        @Deprecated
        public void registerScheduledJob​(IJob jobdef)
        Deprecated.
        Register 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:
        for a description of Cron triggers
      • 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
      • setVersion

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

        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()
      • setSapSystems

        public void setSapSystems​(SapSystems sapSystems)
      • setMonitoring

        public void setMonitoring​(MonitorManager monitorManager)
        Container for monitor objects
      • 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
      • setAdapterManager

        public void setAdapterManager​(AdapterManager adapterManager)
      • getVersion

        public String getVersion()
      • getOriginalConfiguration

        public String getOriginalConfiguration()
      • getLoadedConfiguration

        public String getLoadedConfiguration()
      • isConfigured

        public boolean isConfigured()