001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.event;
018
019import org.apache.wicket.Application;
020import org.apache.wicket.Component;
021import org.apache.wicket.Page;
022import org.apache.wicket.Session;
023import org.apache.wicket.request.cycle.RequestCycle;
024
025/**
026 * Defines the event broadcast type.
027 * 
028 * @author igor
029 */
030public enum Broadcast {
031        /**
032         * Breadth first traversal. Supported sinks in order of traversal:
033         * 
034         * <ol>
035         * <li>{@link Application}</li>
036         * <li>{@link Session}</li>
037         * <li>{@link RequestCycle}</li>
038         * <li>{@link Page}</li>
039         * <li>{@link Component}s</li>
040         * </ol>
041         * 
042         * Components receive the event with a preorder breadth-first traversal, eg: Apply recursively:
043         * <ol>
044         * <li>The component receives the event</li>
045         * <li>The component's children receive the event</li>
046         * </ol>
047         * 
048         * Any sink along the path can be specified and traversal will start with the specified sink as
049         * root, eg:
050         * 
051         * <ul>
052         * <li>If a component inside the page is specified then only the component and all its children
053         * will receive the event</li>
054         * <li>If Session is specified then the session, the request cycle, the page and all its
055         * components will receive the event</li>
056         * </ul>
057         */
058        BREADTH,
059        /**
060         * Depth first traversal. Supported sinks in order of traversal:
061         * 
062         * <ol>
063         * <li>{@link Component}s</li>
064         * <li>{@link Page}</li>
065         * <li>{@link RequestCycle}</li>
066         * <li>{@link Session}</li>
067         * <li>{@link Application}</li>
068         * </ol>
069         * 
070         * Components receive the event with a postorder depth-first traversal, eg: Apply recursively:
071         * <ol>
072         * <li>The component's children receive the event</li>
073         * <li>The component receives the event</li>
074         * </ol>
075         * 
076         * Any sink along the path can be specified and traversal will start with the specified sink as
077         * root, eg:
078         * 
079         * <ul>
080         * <li>If a component inside the page is specified then only the component and all its children
081         * will receive the event</li>
082         * <li>If Session is specified then the session, the request cycle, the page and all its
083         * components will receive the event</li>
084         * </ul>
085         * 
086         */
087        DEPTH,
088        /**
089         * A bubble-up traversal. In a bubble-up traversal only the sink and its parents are notified.
090         * 
091         * Supported sinks in order of traversal are:
092         * <ol>
093         * <li>{@link Component}s</li>
094         * <li>{@link Page}</li>
095         * <li>{@link RequestCycle}</li>
096         * <li>{@link Session}</li>
097         * <li>{@link Application}</li>
098         * </ol>
099         * 
100         * Any sink along the path can be specified and traversal will start at the specified sink and
101         * work its way up to the {@link Application}, eg:
102         * 
103         * <ul>
104         * <li>If a component inside the page is specified then only the component, its parents, the
105         * request cycle, the session, and the application will be notified.
106         * <li>If Session is specified then the session, the application will be notified</li>
107         * </ul>
108         */
109        BUBBLE,
110        /**
111         * Only the specified sink receives the event
112         */
113        EXACT
114}