Contained (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.catalina, interface: Contained

# Interface Contained

All Known Subinterfaces:
  `CatalinaCluster, Cluster, Pipeline, Realm`

All Known Implementing Classes:
  `AbstractAccessLogValve, AccessLogValve, AuthenticatedUserRealm, AuthenticatorBase, BasicAuthenticator, CallbackHandlerImpl, ClusterSingleSignOn, CombinedRealm, CrawlerSessionManagerValve, DataSourceRealm, DigestAuthenticator, ErrorReportValve, ExtendedAccessLogValve, FormAuthenticator, HealthCheckValve, JAASMemoryLoginModule, JAASRealm, JDBCAccessLogValve, JNDIRealm, JsonAccessLogValve, JsonErrorReportValve, JvmRouteBinderValve, LoadBalancerDrainingValve, LockOutRealm, MemoryRealm, NonLoginAuthenticator, NullRealm, ParameterLimitValve, PersistentValve, ProxyErrorReportValve, RealmBase, RemoteAddrValve, RemoteCIDRValve, RemoteHostValve, RemoteIpValve, ReplicationValve, RequestFilterValve, RewriteValve, SemaphoreValve, SimpleTcpCluster, SingleSignOn, SpnegoAuthenticator, SSLAuthenticator, SSLValve, StandardPipeline, StuckThreadDetectionValve, UserDatabaseRealm, ValveBase`

public interface Contained
Decoupling interface which specifies that an implementing class is associated with at most one Container instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Container`
  `getContainer()`
  Get the `Container` with which this instance is associated.
  `void`
  `setContainer(Container container)`
  Set the `Container` with which this instance is associated.

- ## Method Details

  - ### getContainer

    Container getContainer()
    Get the `Container` with which this instance is associated.
    Returns:
      The Container with which this instance is associated or `null` if not associated with a Container

  - ### setContainer

    void setContainer(Container container)
    Set the `Container` with which this instance is associated.
    Parameters:
      `container` - The Container instance with which this instance is to be associated, or `null` to disassociate this instance from any Container