| 1 |
/*
|
| 2 |
* Licensed to the Apache Software Foundation (ASF) under one
|
| 3 |
* or more contributor license agreements. See the NOTICE file
|
| 4 |
* distributed with this work for additional information
|
| 5 |
* regarding copyright ownership. The ASF licenses this file
|
| 6 |
* to you under the Apache License, Version 2.0 (the
|
| 7 |
* "License"); you may not use this file except in compliance
|
| 8 |
* with the License. You may obtain a copy of the License at
|
| 9 |
*
|
| 10 |
* http://www.apache.org/licenses/LICENSE-2.0
|
| 11 |
*
|
| 12 |
* Unless required by applicable law or agreed to in writing,
|
| 13 |
* software distributed under the License is distributed on an
|
| 14 |
* * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
| 15 |
* KIND, either express or implied. See the License for the
|
| 16 |
* specific language governing permissions and limitations
|
| 17 |
* under the License.
|
| 18 |
*/
|
| 19 |
|
| 20 |
package org.apache.synapse.mediators;
|
| 21 |
|
| 22 |
import org.apache.synapse.ManagedLifecycle;
|
| 23 |
import org.apache.synapse.Mediator;
|
| 24 |
|
| 25 |
import java.util.List;
|
| 26 |
|
| 27 |
/**
|
| 28 |
* The List mediator executes a given sequence/list of child mediators.
|
| 29 |
* <p>
|
| 30 |
* This interface extends {@link ManagedLifecycle}. An implementations must
|
| 31 |
* propagate lifecycle events to all children implementing the ManagedLifecycle
|
| 32 |
* interface.
|
| 33 |
*/
|
| 34 |
public interface ListMediator extends Mediator, ManagedLifecycle {
|
| 35 |
|
| 36 |
/**
|
| 37 |
* Appends the specified mediator to the end of this mediator's (children) list
|
| 38 |
* @param m the mediator to be added
|
| 39 |
* @return true (as per the general contract of the Collection.add method)
|
| 40 |
*/
|
| 41 |
public boolean addChild(Mediator m);
|
| 42 |
|
| 43 |
/**
|
| 44 |
* Appends all of the mediators in the specified collection to the end of this mediator's (children)
|
| 45 |
* list, in the order that they are returned by the specified collection's iterator
|
| 46 |
* @param c the list of mediators to be added
|
| 47 |
* @return true if this list changed as a result of the call
|
| 48 |
*/
|
| 49 |
public boolean addAll(List<Mediator> c);
|
| 50 |
|
| 51 |
/**
|
| 52 |
* Returns the mediator at the specified position
|
| 53 |
* @param pos index of mediator to return
|
| 54 |
* @return the mediator at the specified position in this list
|
| 55 |
*/
|
| 56 |
public Mediator getChild(int pos);
|
| 57 |
|
| 58 |
/**
|
| 59 |
* Removes the first occurrence in this list of the specified mediator
|
| 60 |
* @param m mediator to be removed from this list, if present
|
| 61 |
* @return true if this list contained the specified mediator
|
| 62 |
*/
|
| 63 |
public boolean removeChild(Mediator m);
|
| 64 |
|
| 65 |
/**
|
| 66 |
* Removes the mediator at the specified position in this list
|
| 67 |
* @param pos the index of the mediator to remove
|
| 68 |
* @return the mediator previously at the specified position
|
| 69 |
*/
|
| 70 |
public Mediator removeChild(int pos);
|
| 71 |
|
| 72 |
/**
|
| 73 |
* Return the list of mediators of this List mediator instance
|
| 74 |
* @return the child/sub mediator list
|
| 75 |
*/
|
| 76 |
public List<Mediator> getList();
|
| 77 |
}
|