Standard implementation of the Wrapper interface that represents an individual servlet definition. No child Containers are allowed, and the parent Container must be a Context.
| 65 | * Containers are allowed, and the parent Container must be a Context. |
| 66 | */ |
| 67 | public class StandardWrapper extends ContainerBase implements ServletConfig, Wrapper, NotificationEmitter { |
| 68 | |
| 69 | private final Log log = LogFactory.getLog(StandardWrapper.class); // must not be static |
| 70 | |
| 71 | /** |
| 72 | * Default servlet methods supported by this wrapper. |
| 73 | */ |
| 74 | protected static final String[] DEFAULT_SERVLET_METHODS = new String[] { "GET", "HEAD", "POST" }; |
| 75 | |
| 76 | // ----------------------------------------------------------- Constructors |
| 77 | |
| 78 | |
| 79 | /** |
| 80 | * Create a new StandardWrapper component with the default basic Valve. |
| 81 | */ |
| 82 | public StandardWrapper() { |
| 83 | |
| 84 | super(); |
| 85 | swValve = new StandardWrapperValve(); |
| 86 | pipeline.setBasic(swValve); |
| 87 | broadcaster = new NotificationBroadcasterSupport(); |
| 88 | |
| 89 | } |
| 90 | |
| 91 | |
| 92 | // ----------------------------------------------------- Instance Variables |
| 93 | |
| 94 | |
| 95 | /** |
| 96 | * The date and time at which this servlet will become available (in milliseconds since the epoch), or zero if the |
| 97 | * servlet is available. If this value equals Long.MAX_VALUE, the unavailability of this servlet is considered |
| 98 | * permanent. |
| 99 | */ |
| 100 | protected long available = 0L; |
| 101 | |
| 102 | /** |
| 103 | * The broadcaster that sends EE notifications. |
| 104 | */ |
| 105 | protected final NotificationBroadcasterSupport broadcaster; |
| 106 | |
| 107 | /** |
| 108 | * The count of allocations that are currently active. |
| 109 | */ |
| 110 | protected final AtomicInteger countAllocated = new AtomicInteger(0); |
| 111 | |
| 112 | |
| 113 | /** |
| 114 | * The facade associated with this wrapper. |
| 115 | */ |
| 116 | protected final StandardWrapperFacade facade = new StandardWrapperFacade(this); |
| 117 | |
| 118 | |
| 119 | /** |
| 120 | * The (single) possibly uninitialized instance of this servlet. |
| 121 | */ |
| 122 | protected volatile Servlet instance = null; |
| 123 | |
| 124 |