org.eclipse.jetty.servlet

## Class Holder<T>

- java.lang.Object
- - org.eclipse.jetty.util.component.AbstractLifeCycle
  - - org.eclipse.jetty.servlet.Holder<T>

All Implemented Interfaces:
  Dumpable, LifeCycle

Direct Known Subclasses:
  FilterHolder, ServletHolder

    public class Holder<T>
    extends AbstractLifeCycle
    implements Dumpable

### Nested Class Summary

Nested Classes
`protected class` `Holder.HolderConfig`
`protected class` `Holder.HolderRegistration`

### Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

`AbstractLifeCycle.AbstractLifeCycleListener`

### Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

`LifeCycle.Listener`

### Field Summary

Fields
`protected boolean` `_asyncSupported`
`protected Class<? extends T>` `_class`
`protected String` `_className`
`protected String` `_displayName`
`protected boolean` `_extInstance`
`protected Map<String,String>` `_initParams`
`protected String` `_name`
`protected ServletHandler` `_servletHandler`

### Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

`_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING`

### Constructor Summary

Constructors
`protected` `Holder()`

### Method Summary

Methods
`void` `destroyInstance(Object instance)`
`void` `doStart()`
`void` `doStop()`
`String` `dump()`
`void` `dump(Appendable out, String indent)`
`String` `getClassName()`
`String` `getDisplayName()`
`Class<? extends T>` `getHeldClass()`
`String` `getInitParameter(String param)`
`Enumeration` `getInitParameterNames()`
`Map<String,String>` `getInitParameters()`
`String` `getName()`
`ServletHandler` `getServletHandler()`
`protected void` `illegalStateIfContextStarted()`
`boolean` `isAsyncSupported()`
`boolean` `isInstance()`
`void` `setAsyncSupported(boolean suspendable)`
`void` `setClassName(String className)`
`void` `setDisplayName(String name)`
`void` `setHeldClass(Class<? extends T> held)`
`void` `setInitParameter(String param, String value)`
`void` `setInitParameters(Map<String,String> map)`
`void` `setName(String name)` The name is a primary key for the held object.
`void` `setServletHandler(ServletHandler servletHandler)`
`String` `toString()`

### Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

`addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### _class

    protected transient Class<? extends T> _class

#### _initParams

    protected final Map<String,String> _initParams

#### _className

    protected String _className

#### _displayName

    protected String _displayName

#### _extInstance

    protected boolean _extInstance

#### _asyncSupported

    protected boolean _asyncSupported

#### _name

    protected String _name

#### _servletHandler

    protected ServletHandler _servletHandler

### Constructor Detail

#### Holder

    protected Holder()

### Method Detail

#### isInstance

    public boolean isInstance()

Returns:
  True if this holder was created for a specific instance.

#### doStart

    public void doStart()
                 throws Exception

Overrides:
  `doStart` in class `AbstractLifeCycle`
Throws:
  `Exception`

#### doStop

    public void doStop()
                throws Exception

Overrides:
  `doStop` in class `AbstractLifeCycle`
Throws:
  `Exception`

#### getClassName

    public String getClassName()

#### getHeldClass

    public Class<? extends T> getHeldClass()

#### getDisplayName

    public String getDisplayName()

#### getInitParameter

    public String getInitParameter(String param)

#### getInitParameterNames

    public Enumeration getInitParameterNames()

#### getInitParameters

    public Map<String,String> getInitParameters()

#### getName

    public String getName()

#### getServletHandler

    public ServletHandler getServletHandler()

Returns:
  Returns the servletHandler.

#### destroyInstance

    public void destroyInstance(Object instance)
                         throws Exception

Throws:
  `Exception`

#### setClassName

    public void setClassName(String className)

Parameters:
  `className` - The className to set.

#### setHeldClass

    public void setHeldClass(Class<? extends T> held)

Parameters:
  `held` - The class to hold

#### setDisplayName

    public void setDisplayName(String name)

#### setInitParameter

    public void setInitParameter(String param,
                        String value)

#### setInitParameters

    public void setInitParameters(Map<String,String> map)

#### setName

    public void setName(String name)

The name is a primary key for the held object. Ensure that the name is set BEFORE adding a Holder (eg ServletHolder or FilterHolder) to a ServletHandler.

Parameters:
  `name` - The name to set.

#### setServletHandler

    public void setServletHandler(ServletHandler servletHandler)

Parameters:
  `servletHandler` - The `ServletHandler` that will handle requests dispatched to this servlet.

#### setAsyncSupported

    public void setAsyncSupported(boolean suspendable)

#### isAsyncSupported

    public boolean isAsyncSupported()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### illegalStateIfContextStarted

    protected void illegalStateIfContextStarted()

#### dump

    public void dump(Appendable out,
            String indent)
              throws IOException

Specified by:
  `dump` in interface `Dumpable`
Throws:
  `IOException`

#### dump

    public String dump()

Specified by:
  `dump` in interface `Dumpable`