Package ome.system

Class PreferenceContext

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

    public class PreferenceContext
    extends org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
    Central configuration for OMERO properties from (in order):
    • Any injected Properties instances
    • Java System.getProperties()
    • Any configured property files
    As of OMERO 4.2, server configurations are not stored in Java's Preferences API but in an IceGrid xml file under etc/grid of the server installation. The properties are set in the config file on node startup, for example in var/master/servers/Blitz-0/config/config. When the Java process starts, ome.services.blitz.Entry places the values in {#link System.getProperties().
    Since:
    3.0-Beta3
    See Also:
    #800
    • Field Summary

      • Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

        SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
      • Fields inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport

        DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, trimValues, valueSeparator
      • Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport

        localOverride, localProperties, logger
      • Fields inherited from interface org.springframework.core.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Constructor Summary

      Constructors 
      Constructor Description
      PreferenceContext()
      By default, configures this instance for PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE as well as ignoring unfound resources.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canRead​(EventContext ec, java.lang.String key)  
      boolean checkDatabase​(java.lang.String key)  
      java.util.Set<java.lang.String> getKeySet()  
      java.lang.String getProperty​(java.lang.String key)
      Lookup method for getting access to the merged properties for this instance.
      void postProcessBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory bf)  
      java.lang.String resolveAlias​(java.lang.String key)  
      void setPreferences​(java.util.List<Preference> preferences)  
      void setProperty​(java.lang.String key, java.lang.String value)
      With ticket:2214, preferences are no longer mutable.
      • Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

        parseStringValue, processProperties, resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
      • Methods inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport

        doProcessProperties, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparator
      • Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer

        convertProperties, convertProperty, convertPropertyValue, getOrder, setOrder
      • Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport

        loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PreferenceContext

        public PreferenceContext()
        By default, configures this instance for PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE as well as ignoring unfound resources.
    • Method Detail

      • postProcessBeanFactory

        public void postProcessBeanFactory​(org.springframework.beans.factory.config.ConfigurableListableBeanFactory bf)
        Specified by:
        postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
        Overrides:
        postProcessBeanFactory in class org.springframework.beans.factory.config.PropertyResourceConfigurer
      • getProperty

        public java.lang.String getProperty​(java.lang.String key)
        Lookup method for getting access to the merged properties for this instance.
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.String value)
        With ticket:2214, preferences are no longer mutable. For that, we will need a python server which can update the XML file.
      • setPreferences

        public void setPreferences​(java.util.List<Preference> preferences)
      • resolveAlias

        public java.lang.String resolveAlias​(java.lang.String key)
      • getKeySet

        public java.util.Set<java.lang.String> getKeySet()
      • checkDatabase

        public boolean checkDatabase​(java.lang.String key)
      • canRead

        public boolean canRead​(EventContext ec,
                               java.lang.String key)