public class DeprecationUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DeprecationUtils.EnvironmentVariableKey
Keywords for the environment variable
PW_DEPRECATED |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PW_DEPRECATED
Environment variable used to switch off deprecation phase implementation
|
Modifier and Type | Method and Description |
---|---|
static void |
clearEnv()
Sets the environment variable PW_DEPRECATED to an empty string, meaning
all flags corresponding to the deprecation phase will be active by default.
|
static void |
phase2(java.lang.Class clazz,
java.lang.String method,
java.lang.String message)
According to the deprecation policy this method implements the phase 2 which
involves logging a warning and making a small pause in the execution thread.
|
static void |
phase3(java.lang.Class clazz,
java.lang.String method,
java.lang.String message)
According to the deprecation policy this method implements the phase 3 which
involves throwing a runtime exception.
|
static void |
setEnv(DeprecationUtils.EnvironmentVariableKey... keys)
Helper hack to set the environment variable from Java.
|
public static final java.lang.String PW_DEPRECATED
public static void phase2(java.lang.Class clazz, java.lang.String method, java.lang.String message)
clazz
- deprecated classmethod
- name of deprecated methodmessage
- the log messagepublic static void phase3(java.lang.Class clazz, java.lang.String method, java.lang.String message)
clazz
- deprecated classmethod
- name of deprecated methodmessage
- the log messagepublic static void setEnv(DeprecationUtils.EnvironmentVariableKey... keys)
For example if all keys are passed as parameter, this will set the environment variable PW_DEPRECATED=nolog,nodelay,noexception
keys
- the variables to set in the environment variablepublic static void clearEnv()