child(Map, ScopedRunner) or child(String, Object, ScopedRunner) methods.
Values set in parent scopes are visible in child scopes, but values in child scopes are not visible to parent scopes.
Values with the same key in different scopes "mask" each other with the value furthest down the scope chain being returned.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Scope.
Enumeration containing standard attributes. |
| public static interface | |
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | |
| public static final String | |
| private LiquibaseListener | |
| private final Scope | |
| private final String | |
| private static ScopeManager | |
| private final SmartMap |
| Access | Constructor and Description |
|---|---|
| private | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public MdcObject | |
| public MdcObject | addMdcValue(String key, String value, boolean
if true, this key value pair will be automatically removed from the MDC when this
scope exits. If there is not a demonstrable reason for setting this parameter to false
then it should be set to true. removeWhenScopeExits)Add a key value pair to the MDC using the MDC manager. |
| public MdcObject | addMdcValue(String key, Map<String, Object> value)
Add a key value pair to the MDC using the MDC manager. |
| public MdcObject | addMdcValue(String key, Map<String, Object> value, boolean
if true, this key value pair will be automatically removed from the MDC when this
scope exits. If there is not a demonstrable reason for setting this parameter to false
then it should be set to true. removeWhenScopeExits)Add a key value pair to the MDC using the MDC manager. |
| public MdcObject | addMdcValue(String key, CustomMdcObject customMdcObject)
Add a key value pair to the MDC using the MDC manager. |
| public MdcObject | addMdcValue(String key, CustomMdcObject customMdcObject, boolean
if true, this key value pair will be automatically removed from the MDC when this
scope exits. If there is not a demonstrable reason for setting this parameter to false
then it should be set to true. removeWhenScopeExits)Add a key value pair to the MDC using the MDC manager. |
| public static void | |
| public static <ReturnType> ReturnType | |
| public static void | child(LiquibaseListener listener, Scope.
Creates a new child scope that includes the given |
| public static void | |
| public static <T> T | child(LiquibaseListener listener, Map<String, Object> scopeValues, Scope.
|
| public static void | child(String newValueKey, Object newValue, Scope.
Creates a new scope that is a child of this scope. |
| public static void | |
| public String | |
| public static String | enter(Map<String, Object> scopeValues)
Convenience version of |
| public static String | Returns: Returns the scopeId to pass to toexit(String)Creates a new scope without passing a ScopedRunner. |
| public static void | exit(String
The id of the scope to exit. Throws an exception if the name does not match the current scope. scopeId)Exits the scope started with |
| private String | |
| public synchronized <T> T | |
| public <T> T | |
| public <T> T | |
| public synchronized <T> T | |
| public ChecksumVersion | |
| public ClassLoader | |
| public ClassLoader | |
| public static Scope | |
| public Database | |
| public Charset | |
| public String | |
| public <T extends LiquibaseListener> Collection | getListeners(Class<T> type)
Returns |
| public Logger | |
| public MdcManager | |
| public Scope | |
| public ResourceAccessor | |
| public ServiceLocator | |
| public synchronized <T extends SingletonObject> T | |
| public UIService | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if there is an existing key, false otherwiseCheck if the provided mdc key is present |
| private void | |
| public static void | |
| public String |
| addedMdcEntries | back to summary |
|---|---|
| private static final Map<String, List<MdcObject>> addedMdcEntries | |
| JAVA_PROPERTIES | back to summary |
|---|---|
| public static final String JAVA_PROPERTIES | |
| listener | back to summary |
|---|---|
| private LiquibaseListener listener | |
| parent | back to summary |
|---|---|
| private final Scope parent | |
| scopeId | back to summary |
|---|---|
private final String scopeId
| |
| scopeManager | back to summary |
|---|---|
| private static ScopeManager scopeManager | |
| values | back to summary |
|---|---|
| private final SmartMap values | |
| Scope | back to summary |
|---|---|
| private Scope() Creates a new "root" scope.
Defaults resourceAccessor to | |
| Scope | back to summary |
|---|---|
| protected Scope(Scope parent, Map<String, Object> scopeValues) | |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, String value) Add a key value pair to the MDC using the MDC manager. This key value pair will be automatically removed from the MDC when this scope exits. | |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, String value, boolean removeWhenScopeExits) Add a key value pair to the MDC using the MDC manager.
| |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, Map<String, Object> value) Add a key value pair to the MDC using the MDC manager. This key value pair will be automatically removed from the MDC when this scope exits. | |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, Map<String, Object> value, boolean removeWhenScopeExits) Add a key value pair to the MDC using the MDC manager.
| |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, CustomMdcObject customMdcObject) Add a key value pair to the MDC using the MDC manager. This key value pair will be automatically removed from the MDC when this scope exits. | |
| addMdcValue | back to summary |
|---|---|
| public MdcObject addMdcValue(String key, CustomMdcObject customMdcObject, boolean removeWhenScopeExits) Add a key value pair to the MDC using the MDC manager.
| |
| child | back to summary |
|---|---|
| public static void child(Map<String, Object> scopeValues, Scope. Creates a new scope that is a child of this scope. | |
| child | back to summary |
|---|---|
| public static <ReturnType> ReturnType child(Map<String, Object> scopeValues, Scope. Creates a new scope that is a child of this scope. | |
| child | back to summary |
|---|---|
| public static void child(LiquibaseListener listener, Scope. Creates a new child scope that includes the given
| |
| child | back to summary |
|---|---|
| public static void child(LiquibaseListener listener, Map<String, Object> scopeValues, Scope. | |
| child | back to summary |
|---|---|
| public static <T> T child(LiquibaseListener listener, Map<String, Object> scopeValues, Scope. | |
| child | back to summary |
|---|---|
| public static void child(String newValueKey, Object newValue, Scope. Creates a new scope that is a child of this scope. | |
| child | back to summary |
|---|---|
| public static void child(Enum<E extends Enum<E>> newValueKey, Object newValue, Scope. | |
| describe | back to summary |
|---|---|
| public String describe() | |
| enter | back to summary |
|---|---|
| public static String enter(Map<String, Object> scopeValues) throws Exception Convenience version of | |
| enter | back to summary |
|---|---|
| public static String enter(LiquibaseListener listener, Map<String, Object> scopeValues) throws Exception Creates a new scope without passing a ScopedRunner.
This mainly exists for tests where you have a setup/cleanup method pattern.
The recommended way to create Scopes is the "child" methods.
When done with the scope, call
| |
| exit | back to summary |
|---|---|
| public static void exit(String scopeId) throws Exception Exits the scope started with
| |
| generateScopeId | back to summary |
|---|---|
| private String generateScopeId() | |
| get | back to summary |
|---|---|
| public synchronized <T> T get(Enum<E extends Enum<E>> key, Class<T> type) | |
| get | back to summary |
|---|---|
| public <T> T get(Enum<E extends Enum<E>> key, T defaultValue) | |
| get | back to summary |
|---|---|
| public <T> T get(String key, Class<T> type) Return the value associated with the given key in this scope or any parent scope.
The value is converted to the given type if necessary using | |
| get | back to summary |
|---|---|
| public synchronized <T> T get(String key, T defaultValue) Return the value associated with the given key in this scope or any parent scope.
If the value is not defined, the passed defaultValue is returned.
The value is converted to the given type if necessary using | |
| getChecksumVersion | back to summary |
|---|---|
| public ChecksumVersion getChecksumVersion() | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader() | |
| getClassLoader | back to summary |
|---|---|
| public ClassLoader getClassLoader(boolean fallbackToContextClassLoader) | |
| getCurrentScope | back to summary |
|---|---|
| public static Scope getCurrentScope() | |
| getDatabase | back to summary |
|---|---|
| public Database getDatabase() | |
| getFileEncoding | back to summary |
|---|---|
| public Charset getFileEncoding()
Deprecated | |
| getLineSeparator | back to summary |
|---|---|
| public String getLineSeparator() | |
| getListeners | back to summary |
|---|---|
| public <T extends LiquibaseListener> Collection Returns | |
| getLog | back to summary |
|---|---|
| public Logger getLog(Class<T> clazz) | |
| getMdcManager | back to summary |
|---|---|
| public MdcManager getMdcManager() Get the current MDC manager. | |
| getParent | back to summary |
|---|---|
| public Scope getParent() Returns the parent scope to this scope. Returns null if this is a root scope. | |
| getResourceAccessor | back to summary |
|---|---|
| public ResourceAccessor getResourceAccessor() | |
| getServiceLocator | back to summary |
|---|---|
| public ServiceLocator getServiceLocator() | |
| getSingleton | back to summary |
|---|---|
| public synchronized <T extends SingletonObject> T getSingleton(Class<T> type) Looks up the singleton object of the given type. If the singleton has not been created yet, it will be instantiated. The singleton is a singleton based on the root scope and the same object will be returned for all child scopes of the root. | |
| getUI | back to summary |
|---|---|
| public UIService getUI() | |
| has | back to summary |
|---|---|
| public boolean has(String key) Return true if the given key is defined. | |
| has | back to summary |
|---|---|
| public boolean has(Enum<E extends Enum<E>> key) Return true if the given key is defined. | |
| isMdcKeyPresent | back to summary |
|---|---|
| public boolean isMdcKeyPresent(String key) Check if the provided mdc key is present
| |
| removeMdcObjectWhenScopeExits | back to summary |
|---|---|
| private void removeMdcObjectWhenScopeExits(boolean removeWhenScopeExits, MdcObject mdcObject) | |
| setScopeManager | back to summary |
|---|---|
| public static void setScopeManager(ScopeManager scopeManager) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
getResourceAccessor() or getDatabase()
| Modifier and Type | Field and Description |
|---|---|
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | fileEncoding
Deprecated
use
GlobalConfiguration#FILE_ENCODING
|
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. | |
| public static final Scope. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Scope. | |
| public static Scope. |
| changeLogHistoryService | back to summary |
|---|---|
| public static final Scope. | |
| changeSet | back to summary |
|---|---|
| public static final Scope. | |
| checksumVersion | back to summary |
|---|---|
| public static final Scope. | |
| classLoader | back to summary |
|---|---|
| public static final Scope. | |
| database | back to summary |
|---|---|
| public static final Scope. | |
| databaseChangeLog | back to summary |
|---|---|
| public static final Scope. | |
| executeMode | back to summary |
|---|---|
| public static final Scope. | |
| fileEncoding | back to summary |
|---|---|
| public static final Scope. Deprecated | |
| latestChecksumVersion | back to summary |
|---|---|
| public static final Scope. | |
| lineSeparator | back to summary |
|---|---|
| public static final Scope. | |
| lockService | back to summary |
|---|---|
| public static final Scope. | |
| logService | back to summary |
|---|---|
| public static final Scope. | |
| osgiPlatform | back to summary |
|---|---|
| public static final Scope. | |
| quotingStrategy | back to summary |
|---|---|
| public static final Scope. | |
| resourceAccessor | back to summary |
|---|---|
| public static final Scope. | |
| serviceLocator | back to summary |
|---|---|
| public static final Scope. | |
| ui | back to summary |
|---|---|
| public static final Scope. | |
| Attr | back to summary |
|---|---|
| private Attr() | |
| valueOf | back to summary |
|---|---|
| public static Scope. | |
| values | back to summary |
|---|---|
| public static Scope. | |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| run | back to summary |
|---|---|
| public void run() throws Exception | |
| Modifier and Type | Method and Description |
|---|---|
| public T |
| run | back to summary |
|---|---|
| public T run() throws Exception | |