@InterfaceAudience.Public @InterfaceStability.Evolving public final class VarraProperties extends Object implements Constants
CR, DEF_MONITORING_INTERVAL, ENV_VARIABLE_REGEX, FIRST_PART, GT_KEEP_ALIVE_TIME_DEFAULT_VALUE, GT_KEEP_ALIVE_TIME_PROPERTY, LF, LOG_PROPS_FILE, LOG_XML_FILE, NEW_LINE, OS_DOMAIN, RAPID_TYPE, RAPIDAPPSERVER_HOME, REPLACE_UNKNOWN_2_SPACE_PROPERTY, RESOLVE_REQUIRED_PROPERTY, RUNTIME_DOMAIN, SECOND_PART, SPRING_CONTEXT_ENABLED, SPRING_CONTEXT_FILE, TAB, THIS_INTERVAL_PROPERTY, THREADING_DOMAIN, UTF_8| Modifier and Type | Method and Description |
|---|---|
static boolean |
addApplicationProperties(ApplicationProperties properties)
Adds the application properties.
|
static Map<? extends Object,? extends Object> |
getAppProperties(String fileName)
Gets the application property.
|
static Object |
getAppProperty(String propName)
Gets the application property.
|
static Object |
getAppProperty(String fileName,
String propName)
Gets the application property.
|
static boolean |
getBooleanProperty(String propName,
boolean defValue)
Deprecated.
|
static int |
getIntegerProperty(String propName,
int defValue)
Deprecated.
|
static Object |
getProperty(String propName)
Gets the global property, it could be a
SpringContext bean,
application monitoring property or an environment property. |
static Object |
getProperty(String propName,
Object defValue)
Gets the property value if it is available, else returns the defValue
provided.
|
static <T> T |
getPropertyAsGeneric(String propName)
Gets the property as generic, But be careful in taking care of TYPE while
using it.
|
static <T> T |
getPropertyAsGeneric(String propName,
Class<T> klass)
Gets the property as generic, But be careful in taking care of TYPE while
using it.
|
static Set<ApplicationProperties> |
getPropertyFileList()
Gets the property file list, contains only the valid.
|
static String |
getSystemProperty(String propName)
Gets the system property.
|
static <T> T |
getWrapperProperty(String propName,
T defValue)
Gets the property value if it is available, else returns the defValue
provided.
|
static void |
registerPropertyChangeListener(PropertyChangeListener listener,
String... properties)
Register property change listener.
|
static boolean |
removeApplicationProperties(ApplicationProperties properties)
Removes the application properties.
|
static void |
setProperty(String propName,
Object value)
Sets the property.
|
static void |
setProperty(String propName,
Object value,
Object source)
Sets the property.
|
static void |
setSystemProperty(String propName,
String value)
Sets the system property.
|
static void |
startMonitoring()
Deprecated.
|
static List<String> |
startsWith(String prefix)
Gets the global property, it could be a
SpringContext bean,
application monitoring property or an environment property which starts
with the given prefix. |
static void |
unregisterPropertyChangeListener(PropertyChangeListener listener)
Unregister property change listener.
|
static void |
unregisterPropertyChangeListener(String property,
PropertyChangeListener listener)
Unregister property change listener.
|
public static <T> T getPropertyAsGeneric(String propName)
getPropertyAsGeneric(String, Class).T - the generic typepropName - the prop namegetPropertyAsGeneric(String, Class)public static <T> T getPropertyAsGeneric(String propName, Class<T> klass)
T - the generic typepropName - the prop nameklass - the klasspublic static Object getProperty(String propName)
SpringContext bean,
application monitoring property or an environment property.propName - the prop namepublic static Object getAppProperty(String propName)
propName - the prop namepublic static Object getAppProperty(String fileName, String propName)
propName - the prop namepublic static Map<? extends Object,? extends Object> getAppProperties(String fileName)
fileName - the file namepublic static String getSystemProperty(String propName)
propName - the prop namepublic static Object getProperty(String propName, Object defValue)
propName - the prop namedefValue - the default value@Deprecated public static int getIntegerProperty(String propName, int defValue)
getWrapperProperty(String, Object), as it is @Deprecated.propName - the prop namedefValue - the default value@Deprecated public static boolean getBooleanProperty(String propName, boolean defValue)
getWrapperProperty(String, Object), as it is @deprecated.propName - the prop namedefValue - the default valuepublic static <T> T getWrapperProperty(String propName, T defValue)
T - the generic typepropName - the prop namedefValue - the default valuepublic static List<String> startsWith(String prefix)
SpringContext bean,
application monitoring property or an environment property which starts
with the given prefix.prefix - the prefixpublic static void setProperty(String propName, Object value)
propName - the prop namevalue - the valuepublic static void setSystemProperty(String propName, String value)
propName - the prop namevalue - the valuepublic static void setProperty(String propName, Object value, Object source)
propName - the prop namevalue - the valuesource - the sourcepublic static Set<ApplicationProperties> getPropertyFileList()
ApplicationProperties entries.public static boolean addApplicationProperties(ApplicationProperties properties) throws PropertyFileLoaderException
properties - the propertiesPropertyFileLoaderException - the property file loader exceptionpublic static boolean removeApplicationProperties(ApplicationProperties properties)
properties - the propertiespublic static void registerPropertyChangeListener(PropertyChangeListener listener, String... properties) throws VarraPropertiesException
listener - the listenerproperties - the propertiesVarraPropertiesException - the mind tree properties exceptionpublic static void unregisterPropertyChangeListener(String property, PropertyChangeListener listener)
property - the propertylistener - the listenerpublic static void unregisterPropertyChangeListener(PropertyChangeListener listener)
listener - the listener@Deprecated public static void startMonitoring()
Copyright © 2016 utils4j. All Rights Reserved.