2 // ========================================================================
3 // Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
4 // ------------------------------------------------------------------------
5 // All rights reserved. This program and the accompanying materials
6 // are made available under the terms of the Eclipse Public License v1.0
7 // and Apache License v2.0 which accompanies this distribution.
9 // The Eclipse Public License is available at
10 // http://www.eclipse.org/legal/epl-v10.html
12 // The Apache License v2.0 is available at
13 // http://www.opensource.org/licenses/apache2.0.php
15 // You may elect to redistribute this code under either of these licenses.
16 // ========================================================================
19 package org.eclipse.jetty.server;
21 import org.eclipse.jetty.util.annotation.ManagedAttribute;
22 import org.eclipse.jetty.util.annotation.ManagedObject;
23 import org.eclipse.jetty.util.component.LifeCycle;
26 * A Handler that contains other Handlers.
28 * The contained handlers may be one (see @{link {@link org.eclipse.jetty.server.handler.HandlerWrapper})
29 * or many (see {@link org.eclipse.jetty.server.handler.HandlerList} or {@link org.eclipse.jetty.server.handler.HandlerCollection}.
32 @ManagedObject("Handler of Multiple Handlers")
33 public interface HandlerContainer extends LifeCycle
35 /* ------------------------------------------------------------ */
37 * @return array of handlers directly contained by this handler.
39 @ManagedAttribute("handlers in this container")
40 public Handler[] getHandlers();
42 /* ------------------------------------------------------------ */
44 * @return array of all handlers contained by this handler and it's children
46 @ManagedAttribute("all contained handlers")
47 public Handler[] getChildHandlers();
49 /* ------------------------------------------------------------ */
52 * @return array of all handlers contained by this handler and it's children of the passed type.
54 public Handler[] getChildHandlersByClass(Class<?> byclass);
56 /* ------------------------------------------------------------ */
59 * @return first handler of all handlers contained by this handler and it's children of the passed type.
61 public <T extends Handler> T getChildHandlerByClass(Class<T> byclass);