|
1 | 1 | """ |
2 | | -Copyright (c) 2020, Oracle Corporation and/or its affiliates. |
| 2 | +Copyright (c) 2020, 2022, Oracle Corporation and/or its affiliates. |
3 | 3 | Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. |
4 | 4 | """ |
5 | 5 |
|
6 | 6 | from java.io import IOException |
7 | 7 | from java.lang import Long |
8 | 8 | from java.lang import NumberFormatException |
| 9 | +from java.lang import System |
9 | 10 |
|
10 | | -from wlsdeploy.exception import exception_helper |
11 | 11 | from wlsdeploy.logging.platform_logger import PlatformLogger |
12 | 12 | from wlsdeploy.util import path_utils |
13 | 13 | from wlsdeploy.util import string_utils |
|
36 | 36 | STOP_APP_TIMEOUT_DEFAULT = '180000' |
37 | 37 | SET_SERVER_GRPS_TIMEOUT_PROP = 'set.server.groups.timeout' |
38 | 38 | SET_SERVER_GRPS_TIMEOUT_DEFAULT = '30000' |
| 39 | +WLST_EDIT_LOCK_ACQUIRE_TIMEOUT_PROP = 'wlst.edit.lock.acquire.timeout' |
| 40 | +WLST_EDIT_LOCK_ACQUIRE_TIMEOUT_DEFAULT = '0' |
| 41 | +WLST_EDIT_LOCK_RELEASE_TIMEOUT_PROP = 'wlst.edit.lock.release.timeout' |
| 42 | +WLST_EDIT_LOCK_RELEASE_TIMEOUT_DEFAULT = '-1' |
| 43 | +WLST_EDIT_LOCK_EXCLUSIVE_PROP = 'wlst.edit.lock.exclusive' |
| 44 | +WLST_EDIT_LOCK_EXCLUSIVE_DEFAULT = 'false' |
| 45 | + |
| 46 | +# System Property overrides for WLST timeout properties |
| 47 | +SYS_PROP_PREFIX = 'wdt.config.' |
39 | 48 |
|
40 | 49 |
|
41 | 50 | class ModelConfiguration(object): |
@@ -107,12 +116,34 @@ def get_set_server_grps_timeout(self): |
107 | 116 | """ |
108 | 117 | return self._get_from_dict_as_long(SET_SERVER_GRPS_TIMEOUT_PROP, SET_SERVER_GRPS_TIMEOUT_DEFAULT) |
109 | 118 |
|
| 119 | + def get_wlst_edit_lock_acquire_timeout(self): |
| 120 | + """ |
| 121 | + Return the waitTimeInMillis for startEdit from tool properties |
| 122 | + :return: wlst edit lock acquire timeout |
| 123 | + """ |
| 124 | + return self._get_from_dict_as_long(WLST_EDIT_LOCK_ACQUIRE_TIMEOUT_PROP, WLST_EDIT_LOCK_ACQUIRE_TIMEOUT_DEFAULT) |
| 125 | + |
| 126 | + def get_wlst_edit_lock_release_timeout(self): |
| 127 | + """ |
| 128 | + Return the timeOutInMillis for startEdit from tool properties |
| 129 | + :return: wlst edit lock release timeout |
| 130 | + """ |
| 131 | + return self._get_from_dict_as_long(WLST_EDIT_LOCK_RELEASE_TIMEOUT_PROP, WLST_EDIT_LOCK_RELEASE_TIMEOUT_DEFAULT) |
| 132 | + |
| 133 | + def get_wlst_edit_lock_exclusive(self): |
| 134 | + """ |
| 135 | + Returns the exclusive value for startEdit from tool properties |
| 136 | + :return: the string 'true' or 'false' (default) |
| 137 | + """ |
| 138 | + return self._get_from_dict(WLST_EDIT_LOCK_EXCLUSIVE_PROP, WLST_EDIT_LOCK_EXCLUSIVE_DEFAULT) |
| 139 | + |
110 | 140 | def _get_from_dict(self, name, default_value=None): |
111 | 141 | _method_name = '_get_from_dict' |
112 | 142 | _logger.entering(name, default_value, class_name=_class_name, method_name=_method_name) |
113 | 143 | result = default_value |
114 | 144 | if name in self.__config_dict: |
115 | 145 | result = self.__config_dict[name] |
| 146 | + result = System.getProperty(SYS_PROP_PREFIX + name, result) |
116 | 147 | _logger.exiting(result=result, class_name=_class_name, method_name=_method_name) |
117 | 148 | return result |
118 | 149 |
|
|
0 commit comments