code: public void close(final ComponentDescriptor<?> descriptor, final Object component, final boolean success) {
          final Set<CloseMethodDescriptor> closeMethods = descriptor.getCloseMethods();
          for (final CloseMethodDescriptor closeDescriptor : closeMethods) {
              if (_includeNonDistributedTasks || closeDescriptor.isDistributed()) {
                  if (success && closeDescriptor.isEnabledOnSuccess()) {
                      closeDescriptor.close(component);
                  } else if (!success && closeDescriptor.isEnabledOnFailure()) {
                      closeDescriptor.close(component);
                  } else {
                      logger.debug("Omitting close method {} since success={}", closeDescriptor, success);
                  }
              }
          }
      }
docs: Closes a component after use.
  
  @param descriptor
  @param component