@@ -65,7 +65,6 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name):
65
65
class_name = _class_name , method_name = _method_name )
66
66
location = LocationContext (base_location )
67
67
subfolder_result = PyOrderedDict ()
68
-
69
68
attribute_helper = self ._info_helper .get_info_attribute_helper (location )
70
69
if attribute_helper is None :
71
70
_logger .warning ('WLSDPLY-06753' , model_type , str_helper .to_string (attribute_helper ), mbean_name ,
@@ -76,13 +75,22 @@ def discover_custom_mbean(self, base_location, model_type, mbean_name):
76
75
class_name = _class_name , method_name = _method_name )
77
76
short_name = attribute_helper .get_mbean_name ()
78
77
# This is not like other custom interface names and should be changed to be more flexible
79
- interface_name = security_provider_interface_name (attribute_helper .get_mbean_instance (),
80
- attribute_helper .get_mbean_interface_name ())
78
+
79
+ if self ._model_context .is_wlst_offline ():
80
+ interface_name = security_provider_interface_name (attribute_helper .get_mbean_instance (),
81
+ attribute_helper .get_mbean_interface_name ())
82
+ else :
83
+ mbi = self ._wlst_helper .get_mbi ()
84
+ descriptor = mbi .getDescriptor ()
85
+ interface_name = descriptor .getFieldValue ('interfaceclassname' )
86
+ interface_name = _strip_mbean_from_string (interface_name )
87
+
81
88
subfolder_result [mbean_name ][interface_name ] = PyOrderedDict ()
82
89
_logger .info ('WLSDPLY-06751' , model_type , short_name , class_name = _class_name , method_name = _method_name )
83
90
_logger .info ('WLSDPLY-06752' , mbean_name , model_type , short_name ,
84
91
class_name = _class_name , method_name = _method_name )
85
92
subfolder_result [mbean_name ][interface_name ] = self .get_model_attribute_map (location , attribute_helper )
93
+
86
94
_logger .exiting (class_name = _class_name , method_name = _method_name )
87
95
return subfolder_result
88
96
@@ -374,15 +382,18 @@ def security_provider_interface_name(mbean_instance, mbean_interface_name):
374
382
result = mbean_interface_name
375
383
_logger .warning ('WLSDPLY-06779' , str_helper .to_string (mbean_instance ),
376
384
class_name = _class_name , method_name = _method_name )
385
+
377
386
except (Exception , JException ):
378
387
_logger .warning ('WLSDPLY-06778' , mbean_interface_name , class_name = _class_name , method_name = _method_name )
379
388
result = mbean_interface_name
389
+ return _strip_mbean_from_string (result )
390
+
391
+ def _strip_mbean_from_string (result ):
380
392
idx = result .rfind ('MBean' )
381
393
if idx > 0 :
382
394
result = result [:idx ]
383
395
return result
384
396
385
-
386
397
def attribute_type (attribute_helper , attribute_name ):
387
398
"""
388
399
Use the attribute helper to return the attribute type.
0 commit comments