NamingResources (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.util.descriptor.web, interface: NamingResources

# Interface NamingResources

All Known Implementing Classes:
  `NamingResourcesImpl`

public interface NamingResources
Defines an interface for the object that is added to the representation of a JNDI resource in web.xml to enable it to also be the implementation of that JNDI resource. Only Catalina implements this interface but because the web.xml representation is shared this interface has to be visible to Catalina and Jasper.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addEnvironment(ContextEnvironment ce)`
  Add an environment entry for this web application.
  `void`
  `addResource(ContextResource cr)`
  Add a resource reference for this web application.
  `void`
  `addResourceLink(ContextResourceLink crl)`
  Add a resource link for this web application.
  `Object`
  `getContainer()`
  `void`
  `removeEnvironment(String name)`
  Remove any environment entry with the specified name.
  `void`
  `removeResource(String name)`
  Remove any resource reference with the specified name.
  `void`
  `removeResourceLink(String name)`
  Remove any resource link with the specified name.

- ## Method Details

  - ### addEnvironment

    void addEnvironment(ContextEnvironment ce)
    Add an environment entry for this web application.
    Parameters:
      `ce` - New environment entry

  - ### removeEnvironment

    void removeEnvironment(String name)
    Remove any environment entry with the specified name.
    Parameters:
      `name` - Name of the environment entry to remove

  - ### addResource

    void addResource(ContextResource cr)
    Add a resource reference for this web application.
    Parameters:
      `cr` - New resource reference

  - ### removeResource

    void removeResource(String name)
    Remove any resource reference with the specified name.
    Parameters:
      `name` - Name of the resource reference to remove

  - ### addResourceLink

    void addResourceLink(ContextResourceLink crl)
    Add a resource link for this web application.
    Parameters:
      `crl` - New resource link

  - ### removeResourceLink

    void removeResourceLink(String name)
    Remove any resource link with the specified name.
    Parameters:
      `name` - Name of the resource link to remove

  - ### getContainer

    Object getContainer()
    Returns:
      the container with which the naming resources are associated.