public static void isManagementResourceRemoveable ( OperationContext context , PathAddress otherManagementEndpoint ) throws OperationFailedException { ModelNode remotingConnector ; try { remotingConnector = context . readResourceFromRoot ( PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , "jmx" ) , PathElement . pathElement ( "remoting-connector" , "jmx" ) ) , false ) . getModel ( ) ; } catch ( Resource . NoSuchResourceException ex ) { return ; } if ( ! remotingConnector . hasDefined ( USE_MGMT_ENDPOINT ) || ( remotingConnector . hasDefined ( USE_MGMT_ENDPOINT ) && context . resolveExpressions ( remotingConnector . get ( USE_MGMT_ENDPOINT ) ) . asBoolean ( true ) ) ) { try { context . readResourceFromRoot ( otherManagementEndpoint , false ) ; } catch ( NoSuchElementException ex ) { throw RemotingLogger . ROOT_LOGGER . couldNotRemoveResource ( context . getCurrentAddress ( ) ) ; } } }
Manual check because introducing a capability can t be done without a full refactoring . This has to go as soon as the management interfaces are redesigned .