1 /* 2 * Copyright 2002-2014 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 module hunt.stomp.support.InterceptableChannel; 18 19 import hunt.stomp.support.ChannelInterceptor; 20 21 import hunt.collection.List; 22 23 /** 24 * A {@link hunt.stomp.MessageChannel MessageChannel} that 25 * maintains a list {@link hunt.stomp.support.ChannelInterceptor 26 * ChannelInterceptors} and allows interception of message sending. 27 * 28 * @author Rossen Stoyanchev 29 * @since 4.1 30 */ 31 interface InterceptableChannel { 32 33 /** 34 * Set the list of channel interceptors clearing any existing interceptors. 35 */ 36 void setInterceptors(ChannelInterceptor[] interceptors); 37 38 /** 39 * Add a channel interceptor to the end of the list. 40 */ 41 void addInterceptor(ChannelInterceptor interceptor); 42 43 /** 44 * Add a channel interceptor at the specified index. 45 */ 46 void addInterceptor(int index, ChannelInterceptor interceptor); 47 48 /** 49 * Return the list of configured interceptors. 50 */ 51 List!(ChannelInterceptor) getInterceptors(); 52 53 /** 54 * Remove the given interceptor. 55 */ 56 bool removeInterceptor(ChannelInterceptor interceptor); 57 58 /** 59 * Remove the interceptor at the given index. 60 */ 61 ChannelInterceptor removeInterceptor(int index); 62 63 }