Package com.adaptris.core.management
Class BootstrapProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- com.adaptris.core.management.BootstrapProperties
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
public class BootstrapProperties extends java.util.Properties
This class holds the necessary information for startup and provides a extra method for getting the available adapter configuration.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BootstrapProperties()
BootstrapProperties(java.lang.String resourceName)
BootstrapProperties(java.util.Properties p)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Adapter
createAdapter()
Deprecated.usegetConfigManager()
to create an AdapterManagerMBean instead.java.lang.String
findAdapterResource()
AdapterConfigManager
getConfigManager()
java.io.InputStream
getConfigurationStream()
java.lang.String[]
getConfigurationUrls()
URLString
getPrimaryUrl()
java.lang.Long
getProperty(java.lang.String key, java.lang.Long defaultValue)
Add overloaded method to get numerical values from bootstrap.properties.boolean
isEnabled(java.lang.String key)
static boolean
isEnabled(java.util.Properties p, java.lang.String key)
boolean
isPrimaryUrlAvailable()
void
reconfigureLogging()
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Method Detail
-
getProperty
public java.lang.Long getProperty(java.lang.String key, java.lang.Long defaultValue)
Add overloaded method to get numerical values from bootstrap.properties.- Parameters:
key
- The property key to get.defaultValue
- The default numerical value if the key isn't found (or cannot be parsed as numercial).- Returns:
- The numerical value for the given property key, or default if necessary.
-
createAdapter
@Deprecated public Adapter createAdapter() throws java.lang.Exception
Deprecated.usegetConfigManager()
to create an AdapterManagerMBean instead.Convenience method to create an adapter based on the existing bootstrap properties- Returns:
- the adapter object.
- Throws:
java.lang.Exception
- if an exception occured.
-
getConfigurationStream
public java.io.InputStream getConfigurationStream() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getConfigurationUrls
public java.lang.String[] getConfigurationUrls()
-
findAdapterResource
public java.lang.String findAdapterResource()
-
isPrimaryUrlAvailable
public boolean isPrimaryUrlAvailable()
-
getPrimaryUrl
public URLString getPrimaryUrl()
-
getConfigManager
public AdapterConfigManager getConfigManager() throws java.lang.Exception
- Throws:
java.lang.Exception
-
reconfigureLogging
public void reconfigureLogging()
-
isEnabled
public boolean isEnabled(java.lang.String key)
-
isEnabled
public static boolean isEnabled(java.util.Properties p, java.lang.String key)
-
-