public abstract class ConfigUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_WILDCARD |
static String |
CONTEXT_LOCATION_SEPARATOR |
static String |
DIRECTIVE_CREATE_ASYNCHRONOUSLY
Create asynchronously directive.
|
static boolean |
DIRECTIVE_CREATE_ASYNCHRONOUSLY_DEFAULT |
static long |
DIRECTIVE_NO_TIMEOUT |
static String |
DIRECTIVE_PUBLISH_CONTEXT
Directive for publishing Spring application context as a service.
|
static boolean |
DIRECTIVE_PUBLISH_CONTEXT_DEFAULT |
static String |
DIRECTIVE_SEPARATOR
Token used for separating directives inside a header.
|
static String |
DIRECTIVE_TIMEOUT
Directive for indicating wait-for time when satisfying mandatory
dependencies defined in seconds
|
static long |
DIRECTIVE_TIMEOUT_DEFAULT |
static String |
DIRECTIVE_TIMEOUT_VALUE_NONE |
static String |
DIRECTIVE_WAIT_FOR_DEPS
Wait for dependencies or directly start the context.
|
static boolean |
DIRECTIVE_WAIT_FOR_DEPS_DEFAULT
DIRECTIVE_WAIT_FOR_DEPS default. |
static String |
EQUALS |
static String |
EXTENDER_VERSION |
static String |
SPRING_CONTEXT_HEADER
Manifest entry name for configuring Spring application context.
|
Constructor and Description |
---|
ConfigUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getCreateAsync(Dictionary headers)
Shortcut for finding the boolean value for
DIRECTIVE_CREATE_ASYNCHRONOUSLY directive using the given
headers. |
static String |
getDirectiveValue(String header,
String directive)
Return the directive value as a String.
|
static String[] |
getHeaderLocations(Dictionary headers)
Returns the location headers (if any) specified by the Spring-Context
header (if available).
|
static String[] |
getLocationsFromHeader(String header,
String defaultValue)
Similar to
getHeaderLocations(Dictionary) but looks at a
specified header directly. |
static boolean |
getPublishContext(Dictionary headers)
Shortcut for finding the boolean value for
DIRECTIVE_PUBLISH_CONTEXT directive using the given headers. |
static String |
getSpringContextHeader(Dictionary headers)
Return the "Spring-Context" if present from the given
dictionary.
|
static long |
getTimeOut(Dictionary headers)
Shortcut for finding the boolean value for
DIRECTIVE_TIMEOUT
directive using the given headers. |
static boolean |
getWaitForDependencies(Dictionary headers)
Shortcut for finding the boolean value for
DIRECTIVE_WAIT_FOR_DEPS directive using the given headers. |
static boolean |
isDirectiveDefined(Dictionary headers,
String directiveName)
Returns true if the given directive is present or false otherwise.
|
static boolean |
matchExtenderVersionRange(org.osgi.framework.Bundle bundle,
String header,
org.osgi.framework.Version versionToMatch) |
public static final String EXTENDER_VERSION
public static final String CONFIG_WILDCARD
public static final String SPRING_CONTEXT_HEADER
public static final String DIRECTIVE_PUBLISH_CONTEXT
public static final String DIRECTIVE_TIMEOUT
public static final String DIRECTIVE_TIMEOUT_VALUE_NONE
public static final String DIRECTIVE_CREATE_ASYNCHRONOUSLY
public static final String DIRECTIVE_WAIT_FOR_DEPS
public static final boolean DIRECTIVE_WAIT_FOR_DEPS_DEFAULT
DIRECTIVE_WAIT_FOR_DEPS
default.public static final String EQUALS
public static final String DIRECTIVE_SEPARATOR
public static final String CONTEXT_LOCATION_SEPARATOR
public static final boolean DIRECTIVE_PUBLISH_CONTEXT_DEFAULT
public static final boolean DIRECTIVE_CREATE_ASYNCHRONOUSLY_DEFAULT
public static final long DIRECTIVE_TIMEOUT_DEFAULT
public static final long DIRECTIVE_NO_TIMEOUT
public static boolean matchExtenderVersionRange(org.osgi.framework.Bundle bundle, String header, org.osgi.framework.Version versionToMatch)
public static String getSpringContextHeader(Dictionary headers)
headers
- public static String getDirectiveValue(String header, String directive)
header
- directive
- public static boolean isDirectiveDefined(Dictionary headers, String directiveName)
headers
- directiveName
- public static boolean getPublishContext(Dictionary headers)
DIRECTIVE_PUBLISH_CONTEXT
directive using the given headers.
Assumes the headers belong to a Spring powered bundle.headers
- public static boolean getCreateAsync(Dictionary headers)
DIRECTIVE_CREATE_ASYNCHRONOUSLY
directive using the given
headers.
Assumes the headers belong to a Spring powered bundle.headers
- public static long getTimeOut(Dictionary headers)
DIRECTIVE_TIMEOUT
directive using the given headers.
Assumes the headers belong to a Spring powered bundle. Returns the
timeout (in seconds) for which the application context should wait to
have its dependencies satisfied.headers
- public static boolean getWaitForDependencies(Dictionary headers)
DIRECTIVE_WAIT_FOR_DEPS
directive using the given headers.
Assumes the headers belong to a Spring powered bundle.headers
- public static String[] getHeaderLocations(Dictionary headers)
ResourceLoader
for loading the
configurations.headers
- bundle headerspublic static String[] getLocationsFromHeader(String header, String defaultValue)
getHeaderLocations(Dictionary)
but looks at a
specified header directly.header
- header to look atdefaultValue
- default locations if none is specifiedCopyright © 2006–2019. All rights reserved.