Skip to content

Commit aaa315c

Browse files
committed
Merge branch 'managed-folders' into 'main'
Discover and deploy managed MBean folders in resources model section See merge request weblogic-cloud/weblogic-deploy-tooling!1776
2 parents 4245e90 + 4facb50 commit aaa315c

File tree

8 files changed

+38
-105
lines changed

8 files changed

+38
-105
lines changed

core/src/main/python/wlsdeploy/aliases/alias_entries.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import copy
@@ -61,6 +61,9 @@
6161
from wlsdeploy.aliases.model_constants import HEALTH_SCORE
6262
from wlsdeploy.aliases.model_constants import JOLT_CONNECTION_POOL
6363
from wlsdeploy.aliases.model_constants import JPA
64+
from wlsdeploy.aliases.model_constants import MANAGED_EXECUTOR_SERVICE_TEMPLATE
65+
from wlsdeploy.aliases.model_constants import MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE
66+
from wlsdeploy.aliases.model_constants import MANAGED_THREAD_FACTORY_TEMPLATE
6467
from wlsdeploy.aliases.model_constants import ODL_CONFIGURATION
6568
from wlsdeploy.aliases.model_constants import OHS
6669
from wlsdeploy.aliases.model_constants import OPSS_INITIALIZATION
@@ -146,6 +149,9 @@ class AliasEntries(object):
146149
'JMSSystemResource',
147150
JOLT_CONNECTION_POOL,
148151
'MailSession',
152+
MANAGED_EXECUTOR_SERVICE_TEMPLATE,
153+
MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE,
154+
MANAGED_THREAD_FACTORY_TEMPLATE,
149155
'MessagingBridge',
150156
ODL_CONFIGURATION,
151157
OHS,

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
MAIL_SESSION_OVERRIDE = 'MailSessionOverride'
185185
MAIL_SESSION_PROPERTIES = 'Properties'
186186
MANAGED_EXECUTOR_SERVICE_TEMPLATE = 'ManagedExecutorServiceTemplate'
187-
MANAGED_SCHEDULED_EXECUTOR_SERVICE = 'ManagedScheduledExecutorService'
187+
MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE = 'ManagedScheduledExecutorServiceTemplate'
188188
MANAGED_THREAD_FACTORY_TEMPLATE = 'ManagedThreadFactoryTemplate'
189189
MAX_DYNAMIC_SERVER_COUNT = 'MaximumDynamicServerCount'
190190
MAX_THREADS_CONSTRAINT = 'MaxThreadsConstraint'

core/src/main/python/wlsdeploy/tool/deploy/resources_deployer.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""
2-
Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import wlsdeploy.util.dictionary_utils as dictionary_utils
6+
from wlsdeploy.aliases.model_constants import MANAGED_EXECUTOR_SERVICE_TEMPLATE
7+
from wlsdeploy.aliases.model_constants import MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE
8+
from wlsdeploy.aliases.model_constants import MANAGED_THREAD_FACTORY_TEMPLATE
69
from wlsdeploy.aliases.model_constants import SHUTDOWN_CLASS
710
from wlsdeploy.aliases.model_constants import STARTUP_CLASS
811
from wlsdeploy.aliases.wlst_modes import WlstModes
@@ -97,6 +100,8 @@ def _add_resources(self, location):
97100
common_deployer.add_system_components(self._resources, location)
98101
common_deployer.add_ohs_components(self._resources, location)
99102

103+
self._add_managed_folders(location)
104+
100105
def _add_startup_classes(self, location):
101106
"""
102107
Add startup class elements at the specified location.
@@ -112,3 +117,17 @@ def _add_shutdown_classes(self, location):
112117
"""
113118
shutdown_nodes = dictionary_utils.get_dictionary_element(self._resources, SHUTDOWN_CLASS)
114119
self._add_named_elements(SHUTDOWN_CLASS, shutdown_nodes, location)
120+
121+
def _add_managed_folders(self, location):
122+
"""
123+
Add managed folder elements at the specified location.
124+
:param location: the location to deploy elements
125+
"""
126+
template_nodes = dictionary_utils.get_dictionary_element(self._resources, MANAGED_EXECUTOR_SERVICE_TEMPLATE)
127+
self._add_named_elements(MANAGED_EXECUTOR_SERVICE_TEMPLATE, template_nodes, location)
128+
129+
template_nodes = dictionary_utils.get_dictionary_element(self._resources, MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE)
130+
self._add_named_elements(MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE, template_nodes, location)
131+
132+
template_nodes = dictionary_utils.get_dictionary_element(self._resources, MANAGED_THREAD_FACTORY_TEMPLATE)
133+
self._add_named_elements(MANAGED_THREAD_FACTORY_TEMPLATE, template_nodes, location)

core/src/main/python/wlsdeploy/tool/discover/global_resources_discoverer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def discover(self):
6767
self.discover_domain_single_mbean(model_constants.SNMP_AGENT, self._dictionary)
6868
self.discover_domain_named_mbeans(model_constants.SNMP_AGENT_DEPLOYMENT, self._dictionary)
6969

70+
self.discover_domain_named_mbeans(model_constants.MANAGED_EXECUTOR_SERVICE_TEMPLATE, self._dictionary)
71+
self.discover_domain_named_mbeans(model_constants.MANAGED_SCHEDULED_EXECUTOR_SERVICE_TEMPLATE, self._dictionary)
72+
self.discover_domain_named_mbeans(model_constants.MANAGED_THREAD_FACTORY_TEMPLATE, self._dictionary)
73+
7074
_logger.exiting(class_name=_class_name, method_name=_method_name)
7175
return self._dictionary
7276

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,6 @@ def discover(self):
143143
model_folder_name, folder_result = self._get_xml_registries()
144144
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
145145

146-
model_folder_name, folder_result = self.get_managed_executor_template()
147-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
148-
149-
model_folder_name, folder_result = self.get_managed_thread_factory_template()
150-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
151-
152-
model_folder_name, folder_result = self.get_managed_scheduled_executor_service()
153-
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
154-
155146
model_folder_name, folder_result = self._get_ws_securities()
156147
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
157148

@@ -711,96 +702,6 @@ def _get_xml_registries(self):
711702
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
712703
return model_top_folder_name, result
713704

714-
def get_managed_executor_template(self):
715-
"""
716-
Discover the domain managed executor template
717-
:return: model name for the folder: dictionary containing the discovered managed executor template
718-
"""
719-
_method_name = 'get_managed_executor_template'
720-
_logger.entering(class_name=_class_name, method_name=_method_name)
721-
model_top_folder_name = model_constants.MANAGED_EXECUTOR_SERVICE_TEMPLATE
722-
result = OrderedDict()
723-
location = LocationContext(self._base_location)
724-
location.append_location(model_top_folder_name)
725-
templates = self._find_names_in_folder(location)
726-
if templates is not None:
727-
_logger.info('WLSDPLY-06651', len(templates), class_name=_class_name, method_name=_method_name)
728-
typedef = self._model_context.get_domain_typedef()
729-
name_token = self._aliases.get_name_token(location)
730-
for template in templates:
731-
if typedef.is_filtered(location, template):
732-
_logger.info('WLSDPLY-06667', typedef.get_domain_type(), template, class_name=_class_name,
733-
method_name=_method_name)
734-
else:
735-
_logger.info('WLSDPLY-06652', template, class_name=_class_name, method_name=_method_name)
736-
location.add_name_token(name_token, template)
737-
result[template] = OrderedDict()
738-
self._populate_model_parameters(result[template], location)
739-
location.remove_name_token(name_token)
740-
741-
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
742-
return model_top_folder_name, result
743-
744-
745-
def get_managed_scheduled_executor_service(self):
746-
"""
747-
Discover the domain managed scheduled executor service
748-
:return: model name for the folder: dictionary containing the discovered managed scheduled executor
749-
"""
750-
_method_name = 'get_managed_scheduled_executor_service'
751-
_logger.entering(class_name=_class_name, method_name=_method_name)
752-
model_top_folder_name = model_constants.MANAGED_SCHEDULED_EXECUTOR_SERVICE
753-
result = OrderedDict()
754-
location = LocationContext(self._base_location)
755-
location.append_location(model_top_folder_name)
756-
services = self._find_names_in_folder(location)
757-
if services is not None:
758-
_logger.info('WLSDPLY-06653', len(services), class_name=_class_name, method_name=_method_name)
759-
typedef = self._model_context.get_domain_typedef()
760-
name_token = self._aliases.get_name_token(location)
761-
for service in services:
762-
if typedef.is_filtered(location, service):
763-
_logger.info('WLSDPLY-06668', typedef.get_domain_type(), service, class_name=_class_name,
764-
method_name=_method_name)
765-
else:
766-
_logger.info('WLSDPLY-06654', service, class_name=_class_name, method_name=_method_name)
767-
location.add_name_token(name_token, service)
768-
result[service] = OrderedDict()
769-
self._populate_model_parameters(result[service], location)
770-
location.remove_name_token(name_token)
771-
772-
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
773-
return model_top_folder_name, result
774-
775-
def get_managed_thread_factory_template(self):
776-
"""
777-
Discover the domain managed thread factory template
778-
:return: model name for the folder: dictionary containing the discovered managed thread factory templates """
779-
_method_name = 'get_managed_thread_factory_template'
780-
_logger.entering(class_name=_class_name, method_name=_method_name)
781-
model_top_folder_name = model_constants.MANAGED_SCHEDULED_EXECUTOR_SERVICE
782-
result = OrderedDict()
783-
location = LocationContext(self._base_location)
784-
location.append_location(model_top_folder_name)
785-
factories = self._find_names_in_folder(location)
786-
if factories is not None:
787-
_logger.info('WLSDPLY-06655', len(factories), class_name=_class_name, method_name=_method_name)
788-
typedef = self._model_context.get_domain_typedef()
789-
name_token = self._aliases.get_name_token(location)
790-
for factory in factories:
791-
if typedef.is_filtered(location, factory):
792-
_logger.info('WLSDPLY-06669', typedef.get_domain_type(), factory, class_name=_class_name,
793-
method_name=_method_name)
794-
else:
795-
_logger.info('WLSDPLY-06656', factory, class_name=_class_name, method_name=_method_name)
796-
location.add_name_token(name_token, factory)
797-
result[factory] = OrderedDict()
798-
self._populate_model_parameters(result[factory], location)
799-
location.remove_name_token(name_token)
800-
801-
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
802-
return model_top_folder_name, result
803-
804705
def _get_ws_securities(self):
805706
"""
806707
Discover the Webservice Security configuration for the domain

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/ManagedExecutorServiceTemplate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"copyright": "Copyright (c) 2022, Oracle Corporation and/or its affiliates.",
2+
"copyright": "Copyright (c) 2022, 2025, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"wlst_type": "ManagedExecutorServiceTemplate${:s}",
55
"child_folders_type": "multiple",
66
"version": "[12.2.1,)",
77
"short_name": "ManagedESTemplate",
88
"folders": {},
99
"attributes": {
10+
"DeploymentOrder": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DeploymentOrder", "wlst_path": "WP001", "default_value": 1000, "wlst_type": "integer"} ],
1011
"DispatchPolicy": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DispatchPolicy", "wlst_path": "WP001", "default_value": "", "wlst_type": "string"} ],
1112
"LongRunningPriority": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LongRunningPriority", "wlst_path": "WP001", "default_value": 5, "wlst_type": "integer"} ],
1213
"MaxConcurrentLongRunningRequests": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MaxConcurrentLongRunningRequests", "wlst_path": "WP001", "default_value": 10, "wlst_type": "integer"} ],
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"copyright": "Copyright (c) 2022, Oracle Corporation and/or its affiliates.",
2+
"copyright": "Copyright (c) 2022, 2025, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"wlst_type": "ManagedScheduledExecutorServiceTemplate${:s}",
55
"child_folders_type": "multiple",
66
"version": "[12.2.1,)",
77
"short_name": "ManagedSchedESTemplate",
88
"folders": {},
99
"attributes": {
10+
"DeploymentOrder": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DeploymentOrder", "wlst_path": "WP001", "default_value": 1000, "wlst_type": "integer"} ],
1011
"DispatchPolicy": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DispatchPolicy", "wlst_path": "WP001", "default_value": "", "wlst_type": "string"} ],
1112
"LongRunningPriority": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "LongRunningPriority", "wlst_path": "WP001", "default_value": 5, "wlst_type": "integer"} ],
1213
"MaxConcurrentLongRunningRequests": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MaxConcurrentLongRunningRequests", "wlst_path": "WP001", "default_value": 10, "wlst_type": "integer"} ],

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/ManagedThreadFactoryTemplate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"copyright": "Copyright (c) 2022, Oracle Corporation and/or its affiliates.",
2+
"copyright": "Copyright (c) 2022, 2025, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"wlst_type": "ManagedThreadFactoryTemplate${:s}",
55
"child_folders_type": "multiple",
66
"version": "[12.2.1,)",
77
"short_name": "ManagedThreadFactTemplate",
88
"folders": {},
99
"attributes": {
10+
"DeploymentOrder": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "DeploymentOrder", "wlst_path": "WP001", "default_value": 1000, "wlst_type": "integer"} ],
1011
"MaxConcurrentNewThreads": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "MaxConcurrentNewThreads", "wlst_path": "WP001", "default_value": 10, "wlst_type": "integer"} ],
1112
"Notes": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "default_value": null, "wlst_type": "string"} ],
1213
"Priority": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Priority", "wlst_path": "WP001", "default_value": 5, "wlst_type": "integer"} ],

0 commit comments

Comments
 (0)