103928aee4356845252ac6b662d5c72c29903813eJake Slack//
203928aee4356845252ac6b662d5c72c29903813eJake Slack//  ========================================================================
303928aee4356845252ac6b662d5c72c29903813eJake Slack//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
403928aee4356845252ac6b662d5c72c29903813eJake Slack//  ------------------------------------------------------------------------
503928aee4356845252ac6b662d5c72c29903813eJake Slack//  All rights reserved. This program and the accompanying materials
603928aee4356845252ac6b662d5c72c29903813eJake Slack//  are made available under the terms of the Eclipse Public License v1.0
703928aee4356845252ac6b662d5c72c29903813eJake Slack//  and Apache License v2.0 which accompanies this distribution.
803928aee4356845252ac6b662d5c72c29903813eJake Slack//
903928aee4356845252ac6b662d5c72c29903813eJake Slack//      The Eclipse Public License is available at
1003928aee4356845252ac6b662d5c72c29903813eJake Slack//      http://www.eclipse.org/legal/epl-v10.html
1103928aee4356845252ac6b662d5c72c29903813eJake Slack//
1203928aee4356845252ac6b662d5c72c29903813eJake Slack//      The Apache License v2.0 is available at
1303928aee4356845252ac6b662d5c72c29903813eJake Slack//      http://www.opensource.org/licenses/apache2.0.php
1403928aee4356845252ac6b662d5c72c29903813eJake Slack//
1503928aee4356845252ac6b662d5c72c29903813eJake Slack//  You may elect to redistribute this code under either of these licenses.
1603928aee4356845252ac6b662d5c72c29903813eJake Slack//  ========================================================================
1703928aee4356845252ac6b662d5c72c29903813eJake Slack//
1803928aee4356845252ac6b662d5c72c29903813eJake Slack
1903928aee4356845252ac6b662d5c72c29903813eJake Slackpackage org.eclipse.jetty.server;
2003928aee4356845252ac6b662d5c72c29903813eJake Slack
2103928aee4356845252ac6b662d5c72c29903813eJake Slackimport org.eclipse.jetty.util.component.LifeCycle;
2203928aee4356845252ac6b662d5c72c29903813eJake Slack
2303928aee4356845252ac6b662d5c72c29903813eJake Slack/**
2403928aee4356845252ac6b662d5c72c29903813eJake Slack * A Handler that contains other Handlers.
2503928aee4356845252ac6b662d5c72c29903813eJake Slack * <p>
2603928aee4356845252ac6b662d5c72c29903813eJake Slack * The contained handlers may be one (see @{link {@link org.eclipse.jetty.server.handler.HandlerWrapper})
2703928aee4356845252ac6b662d5c72c29903813eJake Slack * or many (see {@link org.eclipse.jetty.server.handler.HandlerList} or {@link org.eclipse.jetty.server.handler.HandlerCollection}.
2803928aee4356845252ac6b662d5c72c29903813eJake Slack *
2903928aee4356845252ac6b662d5c72c29903813eJake Slack */
3003928aee4356845252ac6b662d5c72c29903813eJake Slackpublic interface HandlerContainer extends LifeCycle
3103928aee4356845252ac6b662d5c72c29903813eJake Slack{
3203928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------ */
3303928aee4356845252ac6b662d5c72c29903813eJake Slack    /**
3403928aee4356845252ac6b662d5c72c29903813eJake Slack     * @return array of handlers directly contained by this handler.
3503928aee4356845252ac6b662d5c72c29903813eJake Slack     */
3603928aee4356845252ac6b662d5c72c29903813eJake Slack    public Handler[] getHandlers();
3703928aee4356845252ac6b662d5c72c29903813eJake Slack
3803928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------ */
3903928aee4356845252ac6b662d5c72c29903813eJake Slack    /**
4003928aee4356845252ac6b662d5c72c29903813eJake Slack     * @return array of all handlers contained by this handler and it's children
4103928aee4356845252ac6b662d5c72c29903813eJake Slack     */
4203928aee4356845252ac6b662d5c72c29903813eJake Slack    public Handler[] getChildHandlers();
4303928aee4356845252ac6b662d5c72c29903813eJake Slack
4403928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------ */
4503928aee4356845252ac6b662d5c72c29903813eJake Slack    /**
4603928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param byclass
4703928aee4356845252ac6b662d5c72c29903813eJake Slack     * @return array of all handlers contained by this handler and it's children of the passed type.
4803928aee4356845252ac6b662d5c72c29903813eJake Slack     */
4903928aee4356845252ac6b662d5c72c29903813eJake Slack    public Handler[] getChildHandlersByClass(Class<?> byclass);
5003928aee4356845252ac6b662d5c72c29903813eJake Slack
5103928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------ */
5203928aee4356845252ac6b662d5c72c29903813eJake Slack    /**
5303928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param byclass
5403928aee4356845252ac6b662d5c72c29903813eJake Slack     * @return first handler of all handlers contained by this handler and it's children of the passed type.
5503928aee4356845252ac6b662d5c72c29903813eJake Slack     */
5603928aee4356845252ac6b662d5c72c29903813eJake Slack    public <T extends Handler> T getChildHandlerByClass(Class<T> byclass);
5703928aee4356845252ac6b662d5c72c29903813eJake Slack}
58