code: public void release() 
      { 
          if (!_hasAcquired)
              return;
  
          // Deliver the onRelease event to the registered listeners
          for (ResourceEvents resourceListener : _listeners)
              resourceListener.onRelease();
  
          // Unregister this ResourceContext with associated container context
          _containerContext.removeResourceContext(this, _bean);
  
          // Reset the flag to indicate resources have been released.
          _hasAcquired = false;
      }
docs: ResourceContext.release()