ome.system
Class PreferenceContext

java.lang.Object
  extended by org.springframework.core.io.support.PropertiesLoaderSupport
      extended by org.springframework.beans.factory.config.PropertyResourceConfigurer
          extended by org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
              extended by org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
                  extended by ome.system.PreferenceContext
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

public class PreferenceContext
extends org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer

Central configuration for OMERO properties from (in order):

Since:
3.0-Beta3
Author:
Josh Moore, josh at glencoesoftware.com
See Also:
#800
To do:
Code duplication with prefs.java

Field Summary
static String DEFAULT
           
static String ENV
           
static String ROOT
           
 
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
 
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
PreferenceContext()
          By default, configures this instance for PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE as well as ignoring unfound resources.
 
Method Summary
 boolean canRead(EventContext ec, String key)
           
 boolean checkDatabase(String key)
           
 String getProperty(String key)
          Lookup method for getting access to the merged properties for this instance.
 String resolveAlias(String key)
           
 void setPreferences(List<Preference> preferences)
           
 void setProperty(String key, String value)
           
 void setUserTreePath(String userTreePath)
           
 
Methods inherited from class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer
afterPropertiesSet, resolvePlaceholder, resolvePlaceholder, setSystemTreePath
 
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
parseStringValue, processProperties, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
 
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, postProcessBeanFactory, 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
 

Field Detail

DEFAULT

public static final String DEFAULT
See Also:
Constant Field Values

ROOT

public static final String ROOT
See Also:
Constant Field Values

ENV

public static final String ENV
See Also:
Constant Field Values
Constructor Detail

PreferenceContext

public PreferenceContext()
By default, configures this instance for PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE as well as ignoring unfound resources. The setUserTreePath(String) user-tree is set according to a similar logic as in the prefs command-line tool, using first ENV from the environment if present, otherwise the value of "default" under "/omero/prefs". If no value is found, then the node "/omero/prefs/default" will be used.

Method Detail

setUserTreePath

public void setUserTreePath(String userTreePath)
Overrides:
setUserTreePath in class org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer

getProperty

public String getProperty(String key)
Lookup method for getting access to the merged properties for this instance.


setProperty

public void setProperty(String key,
                        String value)

setPreferences

public void setPreferences(List<Preference> preferences)

resolveAlias

public String resolveAlias(String key)

checkDatabase

public boolean checkDatabase(String key)

canRead

public boolean canRead(EventContext ec,
                       String key)


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.