327 DCmd* const _ref;
328 public:
329 DCmdMark(DCmd* cmd) : _ref(cmd) {}
330 ~DCmdMark() {
331 if (_ref != NULL) {
332 _ref->cleanup();
333 if (_ref->is_heap_allocated()) {
334 delete _ref;
335 }
336 }
337 }
338 };
339
340 // Diagnostic commands are not directly instantiated but created with a factory.
341 // Each diagnostic command class has its own factory. The DCmdFactory class also
342 // manages the status of the diagnostic command (hidden, enabled). A DCmdFactory
343 // has to be registered to make the diagnostic command available (see
344 // management.cpp)
345 class DCmdFactory: public CHeapObj<mtInternal> {
346 private:
347 static Mutex* _dcmdFactory_lock;
348 static bool _send_jmx_notification;
349 static bool _has_pending_jmx_notification;
350 static DCmdFactory* _DCmdFactoryList;
351
352 // Pointer to the next factory in the singly-linked list of registered
353 // diagnostic commands
354 DCmdFactory* _next;
355 // When disabled, a diagnostic command cannot be executed. Any attempt to
356 // execute it will result in the printing of the disabled message without
357 // instantiating the command.
358 const bool _enabled;
359 // When hidden, a diagnostic command doesn't appear in the list of commands
360 // provided by the 'help' command.
361 const bool _hidden;
362 const uint32_t _export_flags;
363 const int _num_arguments;
364
365 public:
366 DCmdFactory(int num_arguments, uint32_t flags, bool enabled, bool hidden)
367 : _next(NULL), _enabled(enabled), _hidden(hidden),
|
327 DCmd* const _ref;
328 public:
329 DCmdMark(DCmd* cmd) : _ref(cmd) {}
330 ~DCmdMark() {
331 if (_ref != NULL) {
332 _ref->cleanup();
333 if (_ref->is_heap_allocated()) {
334 delete _ref;
335 }
336 }
337 }
338 };
339
340 // Diagnostic commands are not directly instantiated but created with a factory.
341 // Each diagnostic command class has its own factory. The DCmdFactory class also
342 // manages the status of the diagnostic command (hidden, enabled). A DCmdFactory
343 // has to be registered to make the diagnostic command available (see
344 // management.cpp)
345 class DCmdFactory: public CHeapObj<mtInternal> {
346 private:
347 static bool _send_jmx_notification;
348 static bool _has_pending_jmx_notification;
349 static DCmdFactory* _DCmdFactoryList;
350
351 // Pointer to the next factory in the singly-linked list of registered
352 // diagnostic commands
353 DCmdFactory* _next;
354 // When disabled, a diagnostic command cannot be executed. Any attempt to
355 // execute it will result in the printing of the disabled message without
356 // instantiating the command.
357 const bool _enabled;
358 // When hidden, a diagnostic command doesn't appear in the list of commands
359 // provided by the 'help' command.
360 const bool _hidden;
361 const uint32_t _export_flags;
362 const int _num_arguments;
363
364 public:
365 DCmdFactory(int num_arguments, uint32_t flags, bool enabled, bool hidden)
366 : _next(NULL), _enabled(enabled), _hidden(hidden),
|